← all experiments

Who Has to Move

Experiment № 079 · September 6, 2026

churn — servers come and go
servers5 points on the ring5 busiest server holds— keys moved, last change—

Every key and every server is hashed onto the same circle. A key belongs to the first server clockwise from where it lands.


Hover the ring to see where a key hashing there would go.

a key, at its own hash
a server, at its own hash
the arc a server owns
a key that just changed hands

share of the keys

The white notch is a fair share.

click the ring to add a server · click a server to lose it · m switches to hash mod N · v adds virtual nodes · r reshuffles · h hides the panel

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.