Consistent hash ring Python library for building distributed apps with Redis

by thomas-ston 8/14/2015, 6:07 PMwith 6 comments

by jwatteon 8/15/2015, 2:07 AM

The hash ring is so dumb. I don't understand why it's still a thing (or was a thing to begin with.)

Just hash and mask some number of bits, and map each index you get to some node. Faster, simpler, even enough distribution.

If your number of nodes is not a power of two, map multiple buckets to each node.

When adding nodes, and the # buckets is too low, split each bucket in two by adding one bit to the mask.

Consistent table construction means you only need the set of nodes to construct the take, keeping lookups entirely in core.

Maybe I should blog this, but it feels a bit like "Hey you cab implement modulo power of two with a bit mask! Isn't that so crazy?"

by byronheon 8/15/2015, 7:37 AM

why not use Jump consistent hash?

by ameyamkon 8/15/2015, 12:11 AM

This is good - but isn't this problem is now solved with redis cluster?