Real-World Case Studies: Consistent Hashing

✅ Source-checked. Each deep dive names its source, and we kept only what that source says. Found an error, or something the source doesn't support? Report it on the tracking issue.

Consistent hashing with virtual nodes in Amazon's Dynamo and Apache Cassandra, and how Discord made ring lookups fast enough to reconnect millions of users.


📦 Deep Dive 1: Amazon Dynamo, Virtual Nodes

Source: Dynamo: Amazon's Highly Available Key-value Store (DeCandia et al., SOSP 2007). Everything in this section comes from the paper.


🗄️ Deep Dive 2: Apache Cassandra, Tokens on a Ring

Source: Apache Cassandra docs, Dynamo architecture. Everything in this section comes from it.


🎮 Deep Dive 3: Discord, Making Ring Lookups Fast

Sources: Stanislav Vishnevskiy, "How Discord Scaled Elixir to 5,000,000 Concurrent Users" (July 2017), and the ex_hash_ring README. Everything in this section comes from those.


ℹ️ An earlier version of this page said Discord sustains "over 100 million concurrent WebSocket connections", claimed 256 virtual nodes keep imbalance "less than 1-2%", and described Netflix EVCache's use of virtual nodes. The sources don't support those figures, so we removed them.

🎯 System Design Interview Takeaways

  1. Consistent hashing limits movement. Adding or removing a server moves only the keys next to it on the ring, not almost all keys as hash(key) % N does.
  2. Use virtual nodes. They spread a failed server's load across many servers, and let bigger machines take more of the ring.
  3. The lookup path matters too. Discord's ring was correct but too slow under reconnect storms. Make lookups cheap and local.