Consistent hashing.
Placing servers around a clock face so adding one only nudges a few neighbours, not everyone.
- 1
With plain key-%-N, the server count is baked in — change it and almost everything moves.
- 2
Consistent hashing seats the servers around a ring, like chairs around a clock face.
- 3
Each key belongs to the next server clockwise from where it lands.
- 4
Add a server and it only steals one arc of keys — everyone else stays put.
- 5
Remove a server and its arc simply passes to the next one along.
- 6
Virtual nodes place each server at many points, so the load spreads evenly.
Semicolony semicolony.dev/eli5/consistent-hashing/comic