Skip to content

Latest commit

 

History

History
39 lines (21 loc) · 1.36 KB

consistent-hashing.md

File metadata and controls

39 lines (21 loc) · 1.36 KB

一致性哈希

参考资料

Consistent Hashing: Algorithmic Tradeoffs

jump hash

注:我们可以参考guava中Hashing.consistentHash(long input, int buckets)方法的使用

guava-consistent-hashing

输出结果为

consistent-hashing output

我们实验表明:在jump-hashing的语境下server的数量可增可见

groupcache: 客户端、服务端一体的缓存系统

ps: groupcache代码很简洁,值得一读

优秀的函数特性

optimal functions

该方案在1997年CDN相关论文中提出,在2007年memcache和dynamo中发扬光大。

我们可以想象一个0..2^32-1的整数构成的环(ring)。

基本想法是将server映射到环上的某个点;如果需要根据key查找对应的server,那么从映射到的点开始顺序扫描。

Ring Hash

Jump Hash(2014)

Multi-Probe Consistent Hashing

Rendezvous Hashing(2015)

Maglev Hashing(2016)