Semicolony ELI5 · comic

Consistent hashing.

Seats around a circle, so a newcomer bumps one neighbour instead of reshuffling the room.

  1. key % N srv 0srv 1srv 2 add one → almost all keys move
    1

    The divisor is the trap: every key’s home is computed from N, so changing N re-homes nearly all of them at once.

  2. seats round a ring
    2

    A server’s position comes from hashing its name — nothing about it depends on how many others exist.

  3. key next server clockwise
    3

    Each key walks clockwise to the first server it meets; no arithmetic ever mentions the server count.

  4. only one arc moves
    4

    The newcomer inherits only the arc just behind it — keys on the rest of the circle never hear the news.

  5. its arc passes to the next
    5

    Departure is the mirror image: the orphaned arc slides to the next server along, and nobody else moves.

  6. virtual nodes
    6

    Entering each server many times under different names irons out the luck of where the hashes landed.

Seat servers and keys around a ring so adding or removing one only nudges a few.
Semicolony semicolony.dev/eli5/consistent-hashing/comic
← All ELI5 explainers