Consistent Hashing and Membership Changes

Place keys and storage nodes on a ring and estimate which assignments change when serving membership changes.

Source
Anbloq
Language
English
Created
Updated
Chapters
2
Reading time
1 min
In this article2 chapters
  1. A node covers an interval in hash space
  2. Balance requires more than correct reassignment

A node covers an interval in hash space

Map nodes and keys to a circular order. Assign each key to the first node clockwise after its position. Inserting a node splits its successor’s interval, so only the part newly covered by the inserted node moves in this simple ownership rule. Removing a node transfers its interval to its successor. Reassigning by a simple modulus of node count generally changes many more keys when that count changes.

Balance requires more than correct reassignment

Uniform independently placed nodes can have unequal interval lengths. Virtual positions per server can spread that variance and let a capacity-aware policy assign several ranges. A frequent key can still concentrate traffic on its owning replicas. Load balancing distinguishes request skew from partition size. Quorum intersection requires care when placement changes which replicas may answer.[1]

References

  1. Giuseppe DeCandia et al., Dynamo: Amazon’s Highly Available Key-Value Store ↩