Tech
Consistent Hashing: Distributing Load Without a Full Reshuffle
Consistent Hashing: Distributing Load Without a Full Reshuffle
Naive hashing ( hash(key) % N ) works fine until you add or remove a node — then N changes and almost every key maps to a different server. For a distributed cache or shard, that means a near-total cache miss storm or a mass data migration, right when you can least afford it.
Consistent hashing fixes this by mapping both nodes and keys onto the same ring, so a topology change only remaps the keys between the changed node and i...
Read the full discussion on Dev.to
This article was aggregated from Dev.to. Click to join the conversation.
View on Dev.to