一致性hash

Nosql大行其道,尤其Memcached&redis,与传统的mysql相比,sharding一般会摒弃简单的求余模式,转而采用了consistent hash

介绍1篇比较好的理解的一致性hash简介:

http://blog.csdn.net/sparkliang/article/details/5279393

http://www.nowamagic.net/librarys/veda/detail/1336

http://blog.csdn.net/xinguan1267/article/details/7870308 有代码实例&性能对比。

看了这篇博文的性能对比有点疑惑:为毛二分查找,比遍历还慢。。。。

其中性能较好的代码作者blog:

http://paul.annesley.cc/2008/04/flexihash-consistent-hashing-php/

其项目的github地址:

https://github.com/pda/flexihash

posted @ 2013-08-07 12:08  代码会说话  阅读(208)  评论(0编辑  收藏  举报