~/boss / server-ring

Consistent hashing

The Server Ring

Walk every key to its server. Then add a server and move almost nothing.

Loading the fight…

How to beat it

Servers and keys hash onto the same ring. A key walks clockwise to the first server it meets. A new server only takes the keys in the arc just before it; with hash mod n, almost every key would move.

Now the real boss

Interviews ask for the code. Watch it run, then write it yourself, tested in Python, C++ or Java.

On your phone? Writing code is easier on a laptop: open bossfight.dev/problems/consistent-hashing there. Sign in with your email to keep your progress on every device.

More bosses

esc