hash_ring 1.2. A Python library for consistent hashing with memcached, using MD5 and the same algorithm as libketama. Exposes an interface that is identical to regular memcache making this a drop-in replacement.
hash_ring 1.2. A Python library for consistent hashing with memcached, using MD5 and the same algorithm as libketama. Exposes an interface that is identical to regular memcache making this a drop-in replacement.
(drop-in replacement for django memcached cache backend)
Andreas - 5th May 2009 15:12 - #
People are still using MD5? It's not just theoretically-broken, it's actually-broken.
David Ulevitch - 5th May 2009 15:58 - #
That doesn't matter for this case - there are no security implications involved in using MD5 to pick one out of a group of caching servers.
Simon,
Actually, MD5 doesn't even have very good dispersion, so that it's fairly easy to get hot spots in your cache server pool.
The problem of hot keys is generally ignored, but you still want keys to be evenly distributed to minimize the likelihood that one server handles more than its share of keys.
For cache server selection, you want speed and distribution (aka uniformity).
I think you want Hsieh:
http://www.azillionmonkeys.com/qed/hash.html
Jeremy Dunck - 5th May 2009 23:17 - #
I wondered why the internal methods for getting keys in hash_ring were so... odd. That it's a clone of an existing algorithm answers half of the problem, at least.
Also, the current version replicates every node forty times to get reasonable dispersion.