|
From: Doug C. <cu...@ap...> - 2008-03-11 21:49:17
|
Ning Li wrote: >> > 1 Consistent hashing uses hash values because hash values >> > distribute uniformly on the ring. Can we support >> > application-specified keys for the ring? >> >> Seems like we could allow the user to specify their own hash value. >> What's the usecase here? > > An example application can be an online email system. > The keys of a user's emails are prefixed by the user name, > so a user's emails are located together on the ring. When > a user searches his/her emails, the query is only sent to > servers which cover that range, instead of the entire ring. We could just define doc ids as 128-bit numbers rather than strings. Then user-provided hash values wouldn't be a special case. A constructor could convert string ids to 128-bit ids, and also store the original string in a field named "id". 128-bits is big enough that we shouldn't see collisions. http://en.wikipedia.org/wiki/Birthday_attack By my reading, it would take over a trillion collections of a trillion documents each before a collision is probable. Doug |