A revamped jump consistent hash algorithm for Go that supports node removal with zero memory allocations.
Doublejump is a Go implementation of a revamped jump consistent hash algorithm that extends Google's original design to support node removal. It solves the problem of distributing keys across nodes in distributed systems while allowing dynamic cluster changes without the limitation of fixed node sets. The library provides high-performance hashing with zero memory allocations.
Go developers building distributed systems, load balancers, or data partitioning solutions that require consistent hashing with dynamic node management.
Developers choose Doublejump because it offers the speed and consistency of Google's jump hash while adding critical node removal functionality, outperforming alternative consistent hash implementations by 10-20x in benchmarks with zero allocation overhead.
A revamped Google's jump consistent hash
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Overcomes the key limitation of Google's original jump hash by allowing dynamic node removal while maintaining consistency, essential for real-world distributed systems.
Operations perform with zero memory allocations, as shown in benchmarks with 0 B/op, making it highly memory-efficient and suitable for high-throughput systems.
Benchmarks demonstrate 22-46 ns/op performance, significantly faster than alternatives like StathatConsistent and SerialxHashring, enabling low-latency key distribution.
V2 offers a generic interface for Go 1.18+, providing type safety and modern Go features without sacrificing the minimalist design.
It's specific to Go, so projects in other languages cannot leverage its benefits, forcing polyglot teams to seek alternative implementations.
Focuses solely on core hashing without built-in support for weighted nodes, replication, or fault tolerance, requiring additional logic for advanced use cases.
The separation between V1 for Go <=1.17 and V2 for Go >=1.18 may confuse users and necessitate careful migration, especially in legacy codebases.