Skip to content
All concepts

Concept

Consistent hashing

Consistent hashing places both servers and keys on a ring, and each key belongs to the next server along. When a server joins or leaves, only the keys on its own stretch of the ring move. Simple hashing by the number of servers would instead send almost every key somewhere new.

Watch a server join the ring: only the keys just before it change owner. A live step from the lesson Consistent hashing (Load balancing & consistent hashing). Timings and counts are illustrative.

Where you'll see it

Sources: Dynamo: Amazon's highly available key-value store (SOSP 2007) ↗ · Scaling Memcache at Facebook (NSDI '13) ↗ · Redis docs: cluster specification ↗ · Report a problem

The definition is in our own words; the sources are those of the lesson Consistent hashing.