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)$的知名一致性哈希算法更快。