A hashing technique that distributes data across nodes in a way that minimizes reassignments when nodes are added or removed.
In distributed systems (like caches, databases, or object stores), data must be spread across many nodes. When scaling up or down, we want to avoid reassigning all data. Consistent hashing helps by minimizing the impact of these changes.
Use consistent hashing when building scalable systems where nodes can dynamically be added or removed (e.g., distributed caches, sharded databases).
You need to know
Hash Ring Structure: Hash both data and servers into a circular space (0 to 2ⁿ-1). This is called the hash ring.
Data Mapping Rule: A data item is stored on the first server found clockwise from its hash position on the ring.
Virtual Nodes: Each server is mapped to multiple points (virtual nodes) on the ring to avoid uneven distribution (hotspots).
Popular technologies
Amazon DynamoDB – Distributed NoSQL database using consistent hashing for partitioning and fault tolerance.
Apache Cassandra – Peer-to-peer database that uses consistent hashing for data placement and replication.
Redis Cluster – Uses a form of consistent hashing to split keyspace and balance load across Redis nodes.
Like posts like this?
Every week, you'll get a new system design concept, broken down like this one.
Free subscribers also get a little bonus:
🎁 The System Design Interview Preparation Cheat Sheet
If you're into visuals, paid subscribers unlock:
→ My Excalidraw system design template – so you have somewhere to start
→ My Excalidraw component library – used in the diagram of this issue
No pressure though. Your support helps me keep writing, and I appreciate it more than you know ❤️