[Paper Review] A Fast, Minimal Memory, Consistent Hash Algorithm
This paper introduces Jump Consistent Hash, a minimal-memory, O(log n) time consistent hashing algorithm that requires no persistent storage beyond registers. It achieves load balancing and minimal data movement during dynamic bucket resizing by using a pseudorandom walk over bucket indices, outperforming Karger et al.'s algorithm in speed and memory efficiency while maintaining strong balance properties.
This paper proposes round-hashing, which is suitable for data storage on distributed servers and for implementing external-memory tables in which each lookup retrieves at most one single block of external memory, using a stash. For data storage, round-hashing is like consistent hashing as it avoids a full rehashing of the keys when new servers are added. Experiments show that the speed to serve requests is tenfold or more than the state of the art. In distributed data storage, this guarantees better throughput for serving requests and, moreover, greatly reduces decision times for which data should move to new servers as rescanning data is much faster.
Motivation & Objective
- To design a consistent hashing algorithm that minimizes memory usage while maintaining load balance and low data movement during dynamic bucket resizing.
- To address the high memory overhead of Karger et al.'s consistent hashing, which requires thousands of bytes per shard for fair distribution.
- To enable efficient, scalable data storage systems where shards are added sequentially and must remain persistent.
- To reduce the computational and memory cost of consistent hashing in large-scale storage systems with frequent reconfiguration.
Proposed method
- The algorithm uses a pseudorandom walk over bucket indices, starting from 0 and advancing only when a random threshold is met.
- For each bucket index j, it checks whether to jump to j by comparing a hash-derived random value to 1/(j+1), ensuring correct probability of jump.
- The key insight is that the jump condition is based on a 64-bit key and a multiplicative constant (2862933555777941757ULL), followed by bit shifting and floating-point division to compute the next jump point.
- The loop terminates when the next bucket would exceed the target number of buckets, returning the last valid bucket index.
- The algorithm is implemented in under 5 lines of C++ code, using only integer and floating-point arithmetic.
- It leverages the fact that in data storage systems, buckets are added sequentially and never removed, enabling a simpler, stateless design.
Experimental results
Research questions
- RQ1Can a consistent hashing algorithm be designed with minimal memory usage while maintaining strong load balancing and low data movement during bucket resizing?
- RQ2How can the probability of key redistribution be mathematically bounded to ensure even distribution across buckets?
- RQ3What is the theoretical time complexity of a consistent hashing algorithm that avoids precomputed data structures?
- RQ4How does the performance of a stateless, minimal-memory consistent hashing algorithm compare to existing approaches under real-world memory access patterns?
- RQ5Can a consistent hashing algorithm be both simple and efficient enough for production use in large-scale data storage systems?
Key findings
- Jump Consistent Hash achieves O(log n) time complexity, significantly faster than Karger et al.'s O(n) or O(log n) variants with high memory cost.
- The algorithm is 3–4x faster than Karger et al.'s implementation with 1000 points per bucket for up to 1000 buckets, and 5–8x faster for up to 100,000 buckets.
- In environments with memory cache competition, Jump Consistent Hash maintains stable performance, while Karger’s implementations suffer from a sharp performance drop due to cache misses.
- The initialization time for Karger’s algorithm grows rapidly with the number of buckets—reaching over 110 seconds for 65,536 buckets with 1000 points per bucket—whereas Jump Consistent Hash requires no initialization.
- The algorithm uses only a few registers, requiring no persistent storage, which reduces memory usage from gigabytes (in Karger’s approach) to negligible levels.
- Empirical results show that Jump Consistent Hash provides better load balancing than Karger’s algorithm with 1000 points per bucket, as measured by standard deviation in key distribution.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.