Skip to content

Comment on Consistent hashing

Comments

Is it just me or can you describe the whole scheme in one sentence?

tl;dr: subdivide your hash space (say, [0, 2^64)) by the number of slots, then utilize the index of the slot your hash falls in.

Or, in another sense: rely on / rather than % for distribution.

Is this accurate or am I missing something?

You're missing that the hash space is not divided uniformly. Which means one can vary the number of slots without recomputing the hash space division -- and without reassigning all of the existing entries.

I must've totally misunderstood what I read then. I'll give it another read, thanks!

That's the naive method which tends to redistribute most objects when the number of slots changes.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.