EASYwalkthrough

Hash Ring Basics

1 of 8
3 related
How do we map keys to servers without reshuffling everything when a server dies? With modular hashing (hash % N), changing N from 5 to 4 remaps 4/5=80%4/5 = 80\% of keys.
The hash ring fixes this by mapping both keys and servers onto a circular space from 0 to 23212^{32} - 1. To find a key's server, walk clockwise from the key's hash position until you hit a server.
At 500M keys, that is 400M cache misses hitting the database simultaneously.
When a server is removed, only keys between it and its counter-clockwise neighbor move to the next clockwise server: 1/N of total keys, not N1/NN-1/N. Akamai invented consistent hashing in 1997 to route CDN requests across 300,000+ edge servers.
Trade-off: the ring introduces a binary search lookup step and requires every proxy to hold ring metadata.
Why it matters in interviews
The hash ring is the foundational concept interviewers expect you to draw first. Explaining why modular hashing fails (80% remap) and how the ring limits remapping to 1/N shows you understand the core problem.
Related concepts