Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> if you are into load balancing, you might also want to look into the 'power of 2 choices'.

You can do that better if you don't use a random number for the hash, instead flip a coin (well, check a bit of the hash of a hash), to make sure hash expansion works well.

This trick means that when you go from N -> N+1, all the keys move to the N+1 bucket instead of being rearranged across all of them.

I've seen this two decades ago and after seeing your comment, felt like getting Claude to recreate what I remembered from back then & write a fake paper [1] out of it.

See the MSB bit in the implementation.

That said, consistent hashes can split ranges by traffic not popularity, so back when I worked in this, the Membase protocol used capacity & traffic load to split the virtual buckets across real machines.

Hot partition rebalancing is hard with a fixed algorithm.

[1] - https://github.com/t3rmin4t0r/magic-partitioning/blob/main/M...



> This trick means that when you go from N -> N+1, all the keys move to the N+1 bucket instead of being rearranged across all of them.

Isn't that how rendezvous hashing (and consistent hashing) already work?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: