SYSTEMSIM
CH 05·Consistent Hashing
Overview

Section · Overview

Designing consistent hashing

Horizontal scaling means handing requests and data across a fleet of servers that grows and shrinks over time. Naïve hashing makes adding or removing one server redistribute almost everything — cache hit rates collapse and the cluster thrashes. Consistent hashing changes the math so only a small, bounded fraction of keys move.

The shape of the chapter

  1. 01The rehashing problem with naïve hash(key) % N
  2. 02The hash ring, server placement, key placement
  3. 03Server lookup — clockwise sweep from the key
  4. 04Add & remove a server — only the affected arc redistributes
  5. 05Two issues with the basic approach (uniformity)
  6. 06Virtual nodes — replicas per server smooth distribution
  7. 07Wrap-up — Dynamo, Cassandra, Discord, Akamai, Maglev

Live Lab is in this same module

After the reference walkthrough, a Live Lab section lets you manipulate the ring directly — add and remove servers, dial vnode count, drop arbitrary keys, and run a backend stress test that reproduces the chapter's “5% std-dev at 200 vnodes” claim on demand.