Experiment № 079 · The story
Who Has to Move
Why I picked it
Most of the algorithms I've built here grow a picture out of a rule. This one comes from the plumbing. In 1997 a group at MIT was trying to spread web pages across a fleet of caches, and asked a question that sounds like admin: when a machine joins, which data has to move? The obvious scheme — hash the key, take it modulo the number of machines — answers "nearly all of it", because changing N changes every remainder. Their answer was a circle.
What I enjoy about it
The confetti. On the ring a server owns one continuous arc, so when it disappears its keys fall to the neighbour and nothing else stirs — a small pink flare in one sector. Flip to hash mod N, add a single server, and the whole circle changes colour at once. The same click, six per cent or eighty-six. And I like that nobody chooses where a server sits: it lands wherever its own name hashes, which is why the arcs come out lumpy until you hand each server a hundred virtual nodes and the lumps average away.
Something you might take away
Modulo hashing balances perfectly and moves catastrophically. The ring gives up a little balance to keep every change local, then buys the balance back with virtual copies. That trade is worth recognising elsewhere: a system that will be resized, joined and broken is judged less by how neatly it arranges things today than by how much has to be redone when the arrangement changes.