I’m surprised that rendezvous hashing[1] isn’t more popular given that it’s considerably easier to understand and implement than consistent hashing while having all the same pleasant properties.<p>[1] <a href="https://en.m.wikipedia.org/wiki/Rendezvous_hashing" rel="nofollow">https://en.m.wikipedia.org/wiki/Rendezvous_hashing</a>
Unfortunately, the purity of simplicity here is deceptive and doesn't scale well to the real world where some jobs are resource hogs (job variance) and hang (nondeterminism and error handling). This is reinventing an HA job scheduler but without retries or load leveling. If you want even working sets without hotspots, then you need a job scheduler aware of workers' load state. This cannot happen by blindly rolling dice and giving it a cute name.
Nice post! Couple things that might be useful:<p>1. While JCH will usually be the most performant hashing method, naively, removing a node will affect all nodes of higher order. This makes the logic of node deletions somewhat more complex than (say) Discord's hash ring. This is why JCH is more common for long-term, distributed, redundant storage -- where the topology changes far less frequently.<p>2. For sharding, what makes distribution hard is not so much the hashing but consensus on the cluster state -- this is the hidden problem. Bryan Hunter's talk on Waterpark (<a href="https://youtu.be/9qUfX3XFi_4" rel="nofollow">https://youtu.be/9qUfX3XFi_4</a>) is a excellent example of what you can do when you can set things up so that the topology is fixed. In fact, this approach makes things so straight forward that it is shared by Riak, where the number of vnodes is fixed.<p>However, if you have a rapidly changing topology (like several Kubernetes clusters that are frequently scaling up and down), you can often need some sort of consensus mechanism to make sure every node has a consistent view of the cluster. In my experience, this usually ends up being the most complex part of distribution problem to solve.
Worth noting Discord's consistent hash ring implementation in pure Elixir. It's very easy to use and maintained by Discord (yay): <a href="https://github.com/discord/ex_hash_ring/">https://github.com/discord/ex_hash_ring/</a>