consistent-hashing

How to distribute (card game table) dealers across servers in a balanced way?

久未见 提交于 2021-01-29 05:56:25
问题 I am currently working on an online card game, similar to blackjack, which will consist of a series of tables where each table has a "dealer" and multiple human players. The dealer (a computer bot) is responsible for dealing and shuffling cards. The tables will be stored in a PostgreSQL database table and it will be possible for a human admin to add/remove/edit tables. The game will consist of a web front end and a REST/websocket API backend. I will probably use Kubernetes and Nginx as a load

How to checksum the file to be uploaded with javascript?

丶灬走出姿态 提交于 2019-12-22 13:49:11
问题 I want to checksum the files at browser side before uploading, then checksum and compare at server side to make sure the consistent. But how can I get the pure binary data of the file and checksum it? I tried the way below, but doesn't work: let fileSelect = document.getElementById('file') let files = fileSelect.files let file = files[0] var r = new FileReader(); r.onload = function(){ console.log(r.result); }; r.readAsArrayBuffer(file); var file_sha1 = sha1(r.result) 回答1: The library you are

Programming language to choose for implementing distributed message passing algorithms

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-21 04:39:29
问题 Basically, I would want to implement the following algorithms and analyze how the system built using these algorithms behave under different conditions. Gossip protocol Multiple paxos Consistent hashing My interest here is in these algorithms. I basically am looking for a programming language that lets me write these algorithms quickly and deeply understand these algorithms. Which language should I choose? Java, Scala, Erlang or anything else. Currently, I know Java and C++. 回答1: You could

Akka ConsistentHashingRoutingLogic not routing to the same dispatcher thread consistently

╄→гoц情女王★ 提交于 2019-12-13 05:42:28
问题 I am trying to use Akka's ConsistentHashingRoutingLogic to guarantee that messages with the same key are routed to the same Actor. It is important that messages with the same key are processed in FIFO ordering. Messages with different keys can be routed to different Actors and processed in parallel freely. I am not using Akka in distributed mode. The messages are actually JSON messages being read from a RabbitMQ broker so my Master actor receives an AMQP message and uses the routing key as

Cluster sharding client not connecting with host

最后都变了- 提交于 2019-12-12 04:30:58
问题 After recent investigation and a Stack over flow question I realise that the cluster sharding is a better option than a cluster-consistent-hash-router. But I am having trouble getting a 2 process cluster going. One process is the Seed and the other is the Client. The Seed node seems to continuously throw dead letter messages (see the end of this question). This Seed HOCON follows: akka { loglevel = "INFO" actor { provider = "Akka.Cluster.ClusterActorRefProvider, Akka.Cluster" serializers {

Custom hashing function in infinispan

蓝咒 提交于 2019-12-11 05:25:49
问题 I am using Infinispan version 8.2 .I already knew when an Node puts an entry to an Cache.It uses its internal hashing on the key and chooses a primary node in an cluster. I know that we can override this hashing with our custom hash function.But I don't know where to start and how to start.I have searched through a lot of documents and websites.But,none of them had a proper description in it. I want someone to help me in this. Thanks in advance. 回答1: If you speak about determining the

clustered consistent hash pool producing new routee for same mapping

佐手、 提交于 2019-12-10 22:23:44
问题 I have a solution with 2 command line projects that creates an akka.net cluster with a seed and client process. The seed starts the cluster and then instantiates a consistent-hash-cluster-router that performs hash mapping on any message that implements my interface "IHasRouting". So any IHasRouting message (from the seed or client) should end up at seed on a routee for the hash of that message. The projects start fine and the cluster forms without error. Both seed and client instantiate a

Memcached consistent hashing not working with 3 of 4 servers down

点点圈 提交于 2019-12-10 12:37:22
问题 Story I have 3 memcached servers running where I shutdown the one or the other to investigate how PHP-memcached behaves upon a server not beeing reachable. I have defined 4 servers in PHP, 1 to simulate a server that is mostly offline (spare server). When I shutdown 1 server (=> 2 are still online), the third ->get() gives me a result. When I shutdown one more server (=> 1 is still online), it won't find objects pushed to that last server. Sample output First run, 3 of 4 servers up: Entity

Consistent hashing as a way to scale writes

耗尽温柔 提交于 2019-12-06 05:31:14
问题 I am trying to figure out if I am on the right track. I am building a (real-time) statistics/analytics service and I use redis to store some sets and hashes. Now let's assume I have some success and I need to scale out. The hash ring technique looks nice, but I have an impression that it is only suited for caching scenarios. What if a node goes down? In theory, its keys are now owned by other nodes. In practice, they won't have the data. It is lost, right? Same with adding / removing nodes.

Consistent hashing as a way to scale writes

淺唱寂寞╮ 提交于 2019-12-04 09:55:53
I am trying to figure out if I am on the right track. I am building a (real-time) statistics/analytics service and I use redis to store some sets and hashes. Now let's assume I have some success and I need to scale out. The hash ring technique looks nice, but I have an impression that it is only suited for caching scenarios. What if a node goes down? In theory, its keys are now owned by other nodes. In practice, they won't have the data. It is lost, right? Same with adding / removing nodes. Am I missing some fundamental thing? Can this be a poor man's cluster? There are two reasons to use