Mission
Interactive Simulation
Before we explain anything — play. Push it until it breaks, then fix it.
Membership
Tuning
More virtual nodes even out how many keys each server owns, reducing hot spots.
Load distribution
busiest = 2.25× avgWhat just happened?
With modulo hashing, changing the server count changed key % N for nearly every key, so most keys moved. With consistent hashing on a ring, adding a server only reassigns the keys in its arc — a small fraction move.
The concept
Consistent hashing places both servers and keys on a circular hash ring. Each key belongs to the next server clockwise. When you add or remove a server, only the keys between it and its neighbor move — roughly 1/N of keys — instead of nearly all of them. Virtual nodes (multiple ring positions per server) even out the distribution and reduce hotspots.
Trade-offs
Nothing is free. Here's what this solution costs you.
In the real world
Conceptually similar to key distribution in Dynamo-style stores and distributed caches.
Mini quiz
Adding one server to N with consistent hashing moves roughly…
Interview me
The app becomes your interviewer. One question, in your own words.
Boss challenge
Rebalance with minimal movement
Scale your cache tier from 3 to 6 nodes.
Goal: Reach 6+ nodes, move under 25% of keys on the last change, and keep the busiest node within 30% of average.
Use the simulator above with no hints. These checks update live as you play.
Interview question
“Explain the ring, why only 1/N of keys move, what virtual nodes solve, and where you'd use consistent hashing in a real system.”