一致性哈希为什么能减少分布式系统的‘重新分配’?
Why does consistent hashing reduce reallocation in distributed systems?
传统哈希在节点数变化时几乎全部 key 需重映射;一致性哈希把节点和 key 都排到同一个环上,只影响环上相邻的一段,使扩容时迁移量最小。
Plain hashing remaps nearly all keys when node count changes; consistent hashing places nodes and keys on one ring, so only the adjacent arc is affected, minimizing migration during scaling.
难度 专业 · 适合 大众
CC BY 4.0 · 已核验 · Verified 2026-11-04
来源 · Source
Xie, Chen,《Elastic Consistent Hashing for Distributed Storage Systems》,2017 IEEE International Parallel and Distributed Processing,2017 (DOI: 10.1109/ipdps.2017.88)
Xie, Chen, 'Elastic Consistent Hashing for Distributed Storage Systems', 2017 IEEE International Parallel and Distributed Processing, 2017, DOI: 10.1109/ipdps.2017.88
独立核验依据 · Independent verification: 核验依据 1 Crossref DOI 10.1109/ipdps.2017.88
#哈希 #分布式
哈希函数和鸽巢原理有什么关系?
How is a hash function related to the pigeonhole principle?
哈希把任意长输入映射到固定长度的摘要。由于输入空间远大于输出空间,鸽巢原理保证必然有‘碰撞’(不同输入同摘要),只能尽量让其难以被找到。
A hash maps arbitrary input to a fixed-length digest. Since inputs vastly outnumber outputs, the pigeonhole principle guarantees collisions exist; we only try to make them hard to find.
难度 进阶 · 适合 初中(12-15)
CC BY 4.0 · 已核验 · Verified 2026-08-23 · 2 条独立证据
来源 · Source
Graham, Knuth, Patashnik,《Concrete Mathematics》第2版,Addison-Wesley,1994
R. L. Graham et al., Concrete Mathematics, 2nd ed., Addison-Wesley, 1994
独立核验依据 · Independent verification: 核验依据 2 OPENLIBRARY 标识 /works/OL3951639W:Concrete mathematics(按标
#哈希 #碰撞
为什么查字典(哈希表)比逐个翻找快?
Why is looking up in a hash table faster than checking one by one?
哈希把‘键’直接变成存放位置,理想情况下一步到位,平均 O(1);而逐个查找要 O(n)。代价是需要处理碰撞。
A hash turns the key directly into a storage location, ideally in one step at average O(1), versus O(n) for linear search. The cost is handling collisions.
难度 入门 · 适合 幼儿(3-6)
CC BY 4.0 · 已核验 · Verified 2026-08-23 · 2 条独立证据
来源 · Source
Graham, Knuth, Patashnik,《Concrete Mathematics》第2版,Addison-Wesley,1994
R. L. Graham et al., Concrete Mathematics, 2nd ed., Addison-Wesley, 1994
独立核验依据 · Independent verification: 核验依据 2 OPENLIBRARY 标识 /works/OL3951639W:Concrete mathematics(按标
#哈希 #查找