Consistent hashing is a technique that can minimize key remapping when the number of hash buckets changes. The paper proposes a fast consistent hash algorithm (called power consistent hash) that has $O(1)$ expected time for key lookup, independent of the number of buckets. Hash values are computed in real time. No search data structure is constructed to store bucket ranges or key mappings. The algorithm has a lightweight design using $O(1)$ space with superior scalability. In particular, it uses two auxiliary hash functions to achieve distribution uniformity and $O(1)$ expected time for key lookup. Furthermore, it performs consistent hashing such that only a minimal number of keys are remapped when the number of buckets changes. Consistent hashing has a wide range of use cases, including load balancing, distributed caching, and distributed key-value stores. The proposed algorithm is faster than well-known consistent hash algorithms with $O(\log n)$ lookup time.
翻译:一致性哈希是一种在哈希桶数量变化时能够最小化键重新映射的技术。本文提出一种快速一致性哈希算法(称为幂次一致性哈希),其键查找的期望时间复杂度为$O(1)$,与桶数量无关。哈希值实时计算,无需构建任何搜索数据结构来存储桶范围或键映射。该算法设计轻量,空间复杂度为$O(1)$,具有卓越的可扩展性。具体而言,它利用两个辅助哈希函数实现分布均匀性,并达到$O(1)$期望时间复杂度的键查找。此外,该算法执行一致性哈希时,仅需在桶数量变化时重新映射最少数量的键。一致性哈希具有广泛的应用场景,包括负载均衡、分布式缓存及分布式键值存储。所提算法比查找时间复杂度为$O(\log n)$的知名一致性哈希算法更快。