
Highest random weight in Elixir
I've had 3 weeks off work and I've used the time to rekindle my passion for coding (the old way, by hand). Stumbled upon this alternative to consistent hashing called rendezvous hashing (or highest random weight) and did a little deep dive. It ended up turning into a basic library, including the basic algorithm, a couple of variations, and the skeleton pattern for O(log n) access.
It performs similar to ExHashRing for node counts <20, and with the skeleton optimization is competitive even in the tens of thousands of nodes, but it uses no NIFs or stateful processes, and the basic algorithm is essentially a one-liner.
Anyway, it was fun to learn about, hope you enjoy it too!