Grokking the System Design Interview, Volume II
0% completed
2. Consistent Hashing
Spread data across many machines, and adding or removing just one of them can force you to move almost everything. Consistent Hashing keeps that move small.
Background
Spreading data across a set of nodes is called data partitioning, and it raises two questions. First, given a piece of data, which node stores it? Second, when a node joins or leaves the cluster, which data has to move, and how do we keep that movement small?
A naive answer hashes the data key to a number, then picks a server by taking that number modulo the total number of servers. For example:
The scheme in the diagram
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%