← The collection

Consistent Hashing.

Add a server to a hash ring and inspect exactly which keys move.

Interactive experimentintuitiveField note ·
INTERACTIVE EXPERIMENT / P19

Consistent Hashing

Add a server to a hash ring and inspect exactly which keys move.

TEST THE MECHANISM

Place keys and servers on a clockwise ring from 0 to 99. Each key belongs to the first server at or after its position, wrapping at 99.

10356085
Servers
4
Keys moved from original ownership
0
Keys tested
20
Key assignments
Key positionOriginal serverCurrent server
31010
101010
173535
243535
313535
386060
456060
526060
596060
668585
738585
808585
871010
941010
11010
81010
153535
223535
293535
366060

Only keys in the new server’s preceding interval move. The toy ring has no virtual nodes, replication, real hash distribution or load guarantees.

The tiny deterministic ring has no virtual nodes, replication, adversarial keys or balanced-load guarantee. Keys and server positions are authored examples.

THE SHORT VERSION

Consistent Hashing, explained.

Consistent hashing assigns keys to positions in a shared hash space so membership changes remap a limited portion under the ring rule.

01 / THE MECHANISM

Why it happens

Twenty fixed keys belong to the first clockwise server at or after their positions. Adding server fifty moves only keys in its preceding interval; the ledger compares original and new ownership.

Consistent hashing assigns keys to positions in a shared hash space so membership changes remap a limited portion under the ring rule.

Read the result

Compare original and current owners for each unchanged key. Remapping is limited by the ring rule, while balance is a separate question.

02 / FOLLOW IT THROUGH

A worked example

Add a server inside one ownership interval

  1. Inspect original server positions ten, thirty-five, sixty and eighty-five.

  2. Add server fifty and identify keys between thirty-five and fifty that change owners.

  3. Verify that keys elsewhere retain their original owners, including wraparound assignments.

OPTIONAL DEEPER DETAILGo deeper: inside the model

Inside this model

Twenty fixed keys belong to the first clockwise server at or after their positions. Adding server fifty moves only keys in its preceding interval; the ledger compares original and new ownership.

03 / BEYOND THE EXPERIMENT

Where this idea is useful

A practical use

Plan a distributed-cache membership change while separating remapping cost from load balance.

CHECK YOUR INTUITION

A common misconception

THE TEMPTING CONCLUSION

“Limited remapping guarantees equal load on all servers.”

THE MORE USEFUL DISTINCTION

Remapping and balance are different properties. This small fixed ring lacks virtual nodes and supplies no balanced-load guarantee.

What this explanation leaves out

  • The tiny deterministic ring has no virtual nodes, replication, adversarial keys or balanced-load guarantee. Keys and server positions are authored examples.
ONE MORE QUESTION

Why does a key larger than the final server wrap around?

The ordered space is a ring, so the first clockwise server after the endpoint is the smallest listed position.

TAKE THE IDEA WITH YOU

Are you trying to minimise moved keys, balance work, or provide replication?

Associated thinkers

Associated withDavid Karger ↗

Associations marked provisional are awaiting source review.

Further reading

Explore the original research or the teaching reference behind this experiment.