开发者

Consistant hashing with memcache

开发者_开发知识库I am setting up a new web app that will on the client side feature a multi-memcached server environment for reliability and performance.

Would it be wise for us to utilize something like Flexihash to make it better to replicate the data between the memcache servers?

Reference: http://github.com/pda/flexihash

Thanks!


Out of the 2 PECL extensions, memcache, and memcached, i would recommend memcached. It wraps libmemcached to access your memcached servers unlike, and in my experience has been far better. Also, just tell the memcached client what type of hashing to use http://uk.php.net/manual/en/memcached.addservers.php and it will handle everything for you, memcached does a good job by itself of data is replicated around the place so that losing one or some of your memcached servers doesn't ruin your day too much.

EDIT-- libmemcached home page. Just to add, it's really not worth trying to roll your own consistent hashing algorithim as its very very dark magic


Consistent hashing is always a good idea. Why do you have to roll your own memcache client? Just use any of the popular ones and they have options to use consistent hashing.

For efficiency, we use this PECL extension,

http://pecl.php.net/package/memcache

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜