<s>
Rendezvous	O
or	O
highest	B-Algorithm
random	I-Algorithm
weight	I-Algorithm
(	O
HRW	O
)	O
hashing	O
is	O
an	O
algorithm	O
that	O
allows	O
clients	O
to	O
achieve	O
distributed	O
agreement	O
on	O
a	O
set	O
of	O
options	O
out	O
of	O
a	O
possible	O
set	O
of	O
options	O
.	O
</s>
<s>
Consistent	B-Algorithm
hashing	I-Algorithm
addresses	O
the	O
special	O
case	O
,	O
using	O
a	O
different	O
method	O
.	O
</s>
<s>
Rendezvous	B-Algorithm
hashing	I-Algorithm
is	O
both	O
much	O
simpler	O
and	O
more	O
general	O
than	O
consistent	B-Algorithm
hashing	I-Algorithm
(	O
see	O
below	O
)	O
.	O
</s>
<s>
Rendezvous	B-Algorithm
hashing	I-Algorithm
was	O
invented	O
by	O
David	O
Thaler	O
and	O
Chinya	O
Ravishankar	O
at	O
the	O
University	O
of	O
Michigan	O
in	O
1996	O
.	O
</s>
<s>
Consistent	B-Algorithm
hashing	I-Algorithm
appeared	O
a	O
year	O
later	O
in	O
the	O
literature	O
.	O
</s>
<s>
Given	O
its	O
simplicity	O
and	O
generality	O
,	O
rendezvous	B-Algorithm
hashing	I-Algorithm
is	O
now	O
being	O
preferred	O
to	O
consistent	B-Algorithm
hashing	I-Algorithm
in	O
real-world	O
applications	O
.	O
</s>
<s>
Rendezvous	B-Algorithm
hashing	I-Algorithm
was	O
used	O
very	O
early	O
on	O
in	O
many	O
applications	O
including	O
mobile	O
caching	O
,	O
router	O
design	O
,	O
secure	O
key	O
establishment	O
,	O
and	O
sharding	B-General_Concept
and	O
distributed	B-Operating_System
databases	I-Operating_System
.	O
</s>
<s>
Other	O
examples	O
of	O
real-world	O
systems	O
that	O
use	O
Rendezvous	B-Algorithm
Hashing	I-Algorithm
include	O
the	O
Github	O
load	B-Application
balancer	I-Application
,	O
the	O
Apache	O
Ignite	O
distributed	B-Operating_System
database	I-Operating_System
,	O
the	O
Tahoe-LAFS	O
file	O
store	O
,	O
the	O
CoBlitz	O
large-file	O
distribution	O
service	O
,	O
Apache	O
Druid	O
,	O
IBM	O
's	O
Cloud	O
Object	O
Store	O
,	O
the	O
Arvados	O
Data	O
Management	O
System	O
,	O
Apache	O
Kafka	O
,	O
and	O
by	O
the	O
Twitter	O
EventBus	O
pub/sub	O
platform	O
.	O
</s>
<s>
One	O
of	O
the	O
first	O
applications	O
of	O
rendezvous	B-Algorithm
hashing	I-Algorithm
was	O
to	O
enable	O
multicast	O
clients	O
on	O
the	O
Internet	O
(	O
in	O
contexts	O
such	O
as	O
the	O
MBONE	B-Protocol
)	O
to	O
identify	O
multicast	O
rendezvous	O
points	O
in	O
a	O
distributed	O
fashion	O
.	O
</s>
<s>
It	O
was	O
used	O
in	O
1998	O
by	O
Microsoft	O
's	O
Cache	B-Protocol
Array	I-Protocol
Routing	I-Protocol
Protocol	I-Protocol
(	O
CARP	O
)	O
for	O
distributed	O
cache	O
coordination	O
and	O
routing	O
.	O
</s>
<s>
Some	O
Protocol	B-Protocol
Independent	I-Protocol
Multicast	I-Protocol
routing	O
protocols	O
use	O
rendezvous	B-Algorithm
hashing	I-Algorithm
to	O
pick	O
a	O
rendezvous	O
point	O
.	O
</s>
<s>
Rendezvous	B-Algorithm
hashing	I-Algorithm
solves	O
a	O
general	O
version	O
of	O
the	O
distributed	B-Operating_System
hash	I-Operating_System
table	I-Operating_System
problem	O
:	O
We	O
are	O
given	O
a	O
set	O
of	O
sites	O
(	O
servers	O
or	O
proxies	O
,	O
say	O
)	O
.	O
</s>
<s>
All	O
clients	O
first	O
agree	O
on	O
a	O
hash	B-Error_Name
function	I-Error_Name
.	O
</s>
<s>
Each	O
client	O
independently	O
computes	O
these	O
weights	O
and	O
picks	O
the	O
k	O
sites	O
that	O
yield	O
the	O
k	O
largest	O
hash	B-Error_Name
values	I-Error_Name
.	O
</s>
<s>
Approaching	O
the	O
problem	O
naively	O
,	O
it	O
might	O
appear	O
sufficient	O
to	O
treat	O
the	O
n	O
sites	O
as	O
buckets	O
in	O
a	O
hash	B-Algorithm
table	I-Algorithm
and	O
hash	B-Error_Name
the	O
object	O
name	O
O	O
into	O
this	O
table	O
.	O
</s>
<s>
Unfortunately	O
,	O
if	O
any	O
of	O
the	O
sites	O
fails	O
or	O
is	O
unreachable	O
,	O
the	O
hash	B-Algorithm
table	I-Algorithm
size	O
changes	O
,	O
forcing	O
all	O
objects	O
to	O
be	O
remapped	O
.	O
</s>
<s>
Under	O
rendezvous	B-Algorithm
hashing	I-Algorithm
,	O
however	O
,	O
clients	O
handle	O
site	O
failures	O
by	O
picking	O
the	O
site	O
that	O
yields	O
the	O
next	O
largest	O
weight	O
.	O
</s>
<s>
Rendezvous	B-Algorithm
hashing	I-Algorithm
has	O
the	O
following	O
properties	O
:	O
</s>
<s>
Low	O
overhead	O
:	O
The	O
hash	B-Error_Name
function	I-Error_Name
used	O
is	O
efficient	O
,	O
so	O
overhead	O
at	O
the	O
clients	O
is	O
very	O
low	O
.	O
</s>
<s>
Load	B-Application
balancing	I-Application
:	O
Since	O
the	O
hash	B-Error_Name
function	I-Error_Name
is	O
randomizing	O
,	O
each	O
of	O
the	O
n	O
sites	O
is	O
equally	O
likely	O
to	O
receive	O
the	O
object	O
O	O
.	O
Loads	O
are	O
uniform	O
across	O
the	O
sites	O
.	O
</s>
<s>
Because	O
of	O
its	O
simplicity	O
,	O
lower	O
overhead	O
,	O
and	O
generality	O
(	O
it	O
works	O
for	O
any	O
k	O
<	O
n	O
)	O
,	O
rendezvous	B-Algorithm
hashing	I-Algorithm
is	O
increasingly	O
being	O
preferred	O
over	O
consistent	B-Algorithm
hashing	I-Algorithm
.	O
</s>
<s>
Recent	O
examples	O
of	O
its	O
use	O
include	O
the	O
Github	O
load	B-Application
balancer	I-Application
,	O
the	O
Apache	O
Ignite	O
distributed	B-Operating_System
database	I-Operating_System
,	O
and	O
by	O
the	O
Twitter	O
EventBus	O
pub/sub	O
platform	O
.	O
</s>
<s>
Consistent	B-Algorithm
hashing	I-Algorithm
operates	O
by	O
mapping	O
sites	O
uniformly	O
and	O
randomly	O
to	O
points	O
on	O
a	O
unit	O
circle	O
called	O
tokens	O
.	O
</s>
<s>
If	O
sites	O
are	O
mapped	O
to	O
points	O
on	O
the	O
circle	O
randomly	O
by	O
hashing	O
200	O
variants	O
of	O
the	O
site	O
ID	O
,	O
say	O
,	O
the	O
assignment	O
of	O
any	O
object	O
requires	O
storing	O
or	O
recalculating	O
200	O
hash	B-Error_Name
values	I-Error_Name
for	O
each	O
site	O
.	O
</s>
<s>
However	O
,	O
the	O
tokens	O
associated	O
with	O
a	O
given	O
site	O
can	O
be	O
precomputed	O
and	O
stored	O
in	O
a	O
sorted	O
list	O
,	O
requiring	O
only	O
a	O
single	O
application	O
of	O
the	O
hash	B-Error_Name
function	I-Error_Name
to	O
the	O
object	O
,	O
and	O
a	O
binary	O
search	O
to	O
compute	O
the	O
assignment	O
.	O
</s>
<s>
Even	O
with	O
many	O
tokens	O
per	O
site	O
,	O
however	O
,	O
the	O
basic	O
version	O
of	O
consistent	B-Algorithm
hashing	I-Algorithm
may	O
not	O
balance	O
objects	O
uniformly	O
over	O
sites	O
,	O
since	O
when	O
a	O
site	O
is	O
removed	O
each	O
object	O
assigned	O
to	O
it	O
is	O
distributed	O
only	O
over	O
as	O
many	O
other	O
sites	O
as	O
the	O
site	O
has	O
tokens	O
(	O
say	O
100	O
–	O
200	O
)	O
.	O
</s>
<s>
Variants	O
of	O
consistent	B-Algorithm
hashing	I-Algorithm
(	O
such	O
as	O
Amazon	O
's	O
Dynamo	B-Application
)	O
that	O
use	O
more	O
complex	O
logic	O
to	O
distribute	O
tokens	O
on	O
the	O
unit	O
circle	O
offer	O
better	O
load	B-Application
balancing	I-Application
than	O
basic	O
consistent	B-Algorithm
hashing	I-Algorithm
,	O
reduce	B-Algorithm
the	O
overhead	O
of	O
adding	O
new	O
sites	O
,	O
and	O
reduce	B-Algorithm
metadata	O
overhead	O
and	O
offer	O
other	O
benefits	O
.	O
</s>
<s>
Rendezvous	B-Algorithm
hashing	I-Algorithm
(	O
HRW	O
)	O
is	O
much	O
simpler	O
conceptually	O
and	O
in	O
practice	O
.	O
</s>
<s>
It	O
also	O
distributes	O
objects	O
uniformly	O
over	O
all	O
sites	O
,	O
given	O
a	O
uniform	O
hash	B-Error_Name
function	I-Error_Name
.	O
</s>
<s>
Unlike	O
consistent	B-Algorithm
hashing	I-Algorithm
,	O
HRW	O
requires	O
no	O
precomputing	O
or	O
storage	O
of	O
tokens	O
.	O
</s>
<s>
An	O
object	O
is	O
placed	O
into	O
one	O
of	O
sites	O
by	O
computing	O
the	O
hash	B-Error_Name
values	I-Error_Name
and	O
picking	O
the	O
site	O
that	O
yields	O
the	O
highest	O
hash	B-Error_Name
value	I-Error_Name
.	O
</s>
<s>
If	O
a	O
new	O
site	O
is	O
added	O
,	O
new	O
object	O
placements	O
or	O
requests	O
will	O
compute	O
hash	B-Error_Name
values	I-Error_Name
,	O
and	O
pick	O
the	O
largest	O
of	O
these	O
.	O
</s>
<s>
Variants	O
of	O
the	O
HRW	O
algorithm	O
,	O
such	O
as	O
the	O
use	O
of	O
a	O
skeleton	O
(	O
see	O
below	O
)	O
,	O
can	O
reduce	B-Algorithm
the	O
time	O
for	O
object	O
location	O
to	O
,	O
at	O
the	O
cost	O
of	O
less	O
global	O
uniformity	O
of	O
placement	O
.	O
</s>
<s>
Rendezvous	B-Algorithm
hashing	I-Algorithm
also	O
has	O
the	O
great	O
advantage	O
that	O
it	O
provides	O
simple	O
solutions	O
to	O
other	O
important	O
problems	O
,	O
such	O
as	O
distributed	O
-agreement	O
.	O
</s>
<s>
Rendezvous	B-Algorithm
hashing	I-Algorithm
is	O
both	O
simpler	O
and	O
more	O
general	O
than	O
consistent	B-Algorithm
hashing	I-Algorithm
.	O
</s>
<s>
Consistent	B-Algorithm
hashing	I-Algorithm
can	O
be	O
shown	O
to	O
be	O
a	O
special	O
case	O
of	O
HRW	O
by	O
an	O
appropriate	O
choice	O
of	O
a	O
two-place	O
hash	B-Error_Name
function	I-Error_Name
.	O
</s>
<s>
From	O
the	O
site	O
identifier	O
the	O
simplest	O
version	O
of	O
consistent	B-Algorithm
hashing	I-Algorithm
computes	O
a	O
list	O
of	O
token	O
positions	O
,	O
e.g.	O
,	O
where	O
hashes	B-Error_Name
values	O
to	O
locations	O
on	O
the	O
unit	O
circle	O
.	O
</s>
<s>
Define	O
the	O
two	O
place	O
hash	B-Error_Name
function	I-Error_Name
to	O
be	O
where	O
denotes	O
the	O
distance	O
along	O
the	O
unit	O
circle	O
from	O
to	O
(	O
since	O
has	O
some	O
minimal	O
non-zero	O
value	O
there	O
is	O
no	O
problem	O
translating	O
this	O
value	O
to	O
a	O
unique	O
integer	O
in	O
some	O
bounded	O
range	O
)	O
.	O
</s>
<s>
This	O
will	O
duplicate	O
exactly	O
the	O
assignment	O
produced	O
by	O
consistent	B-Algorithm
hashing	I-Algorithm
.	O
</s>
<s>
It	O
is	O
not	O
possible	O
,	O
however	O
,	O
to	O
reduce	B-Algorithm
HRW	O
to	O
consistent	B-Algorithm
hashing	I-Algorithm
(	O
assuming	O
the	O
number	O
of	O
tokens	O
per	O
site	O
is	O
bounded	O
)	O
,	O
since	O
HRW	O
potentially	O
reassigns	O
the	O
objects	O
from	O
a	O
removed	O
site	O
to	O
an	O
unbounded	O
number	O
of	O
other	O
sites	O
.	O
</s>
<s>
In	O
the	O
standard	O
implementation	O
of	O
rendezvous	B-Algorithm
hashing	I-Algorithm
,	O
every	O
node	O
receives	O
a	O
statically	O
equal	O
proportion	O
of	O
the	O
keys	O
.	O
</s>
<s>
A	O
straightforward	O
mechanism	O
to	O
handle	O
this	O
case	O
is	O
to	O
assign	O
two	O
virtual	O
locations	O
to	O
this	O
node	O
,	O
so	O
that	O
if	O
either	O
of	O
that	O
larger	O
node	O
's	O
virtual	O
locations	O
has	O
the	O
highest	O
hash	B-Error_Name
,	O
that	O
node	O
receives	O
the	O
key	O
.	O
</s>
<s>
Several	O
modifications	O
to	O
rendezvous	B-Algorithm
hashing	I-Algorithm
have	O
been	O
proposed	O
to	O
overcome	O
this	O
limitation	O
.	O
</s>
<s>
The	O
Cache	B-Protocol
Array	I-Protocol
Routing	I-Protocol
Protocol	I-Protocol
(	O
CARP	O
)	O
is	O
a	O
1998	O
IETF	O
draft	O
that	O
describes	O
a	O
method	O
for	O
computing	O
load	O
factors	O
which	O
can	O
be	O
multiplied	O
by	O
each	O
node	O
's	O
hash	B-Error_Name
score	O
to	O
yield	O
an	O
arbitrary	O
level	O
of	O
precision	O
for	O
weighting	O
nodes	O
differently	O
.	O
</s>
<s>
Controlled	O
replication	O
under	O
scalable	O
hashing	O
or	O
CRUSH	O
is	O
an	O
extension	O
to	O
RUSH	O
that	O
improves	O
upon	O
rendezvous	B-Algorithm
hashing	I-Algorithm
by	O
constructing	O
a	O
tree	O
where	O
a	O
pseudo-random	O
function	O
(	O
hash	B-Error_Name
)	O
is	O
used	O
to	O
navigate	O
down	O
the	O
tree	O
to	O
find	O
which	O
node	O
is	O
ultimately	O
responsible	O
for	O
a	O
given	O
key	O
.	O
</s>
<s>
The	O
CRUSH	O
algorithm	O
is	O
used	O
by	O
the	O
ceph	B-Operating_System
data	O
storage	O
system	O
to	O
map	O
data	O
objects	O
to	O
the	O
nodes	O
responsible	O
for	O
storing	O
them	O
.	O
</s>
<s>
We	O
only	O
need	O
hashes	B-Error_Name
,	O
rather	O
than	O
108	O
.	O
</s>
<s>
If	O
we	O
apply	O
this	O
method	O
starting	O
one	O
level	O
higher	O
in	O
the	O
hierarchy	O
,	O
we	O
would	O
need	O
hashes	B-Error_Name
to	O
get	O
to	O
the	O
winning	O
site	O
.	O
</s>
<s>
Starting	O
lower	O
in	O
the	O
hierarchy	O
requires	O
more	O
hashes	B-Error_Name
,	O
but	O
may	O
improve	O
load	B-Application
distribution	I-Application
in	O
the	O
case	O
of	O
failures	O
.	O
</s>
<s>
The	O
value	O
of	O
can	O
be	O
chosen	O
based	O
on	O
factors	O
like	O
the	O
anticipated	O
failure	O
rate	O
and	O
the	O
degree	O
of	O
desired	O
load	B-Application
balancing	I-Application
.	O
</s>
<s>
The	O
choice	O
is	O
equivalent	O
to	O
non-hierarchical	O
rendezvous	B-Algorithm
hashing	I-Algorithm
.	O
</s>
<s>
In	O
practice	O
,	O
the	O
hash	B-Error_Name
function	I-Error_Name
is	O
very	O
cheap	O
,	O
so	O
can	O
work	O
quite	O
well	O
unless	O
is	O
very	O
high	O
.	O
</s>
<s>
In	O
2005	O
,	O
Christian	O
Schindelhauer	O
and	O
Gunnar	O
Schomaker	O
described	O
a	O
logarithmic	O
method	O
for	O
re-weighting	O
hash	B-Error_Name
scores	O
in	O
a	O
way	O
that	O
does	O
not	O
require	O
relative	O
scaling	O
of	O
load	O
factors	O
when	O
a	O
node	O
's	O
weight	O
changes	O
or	O
when	O
nodes	O
are	O
added	O
or	O
removed	O
.	O
</s>
<s>
Rendezvous	B-Algorithm
Hashing	I-Algorithm
is	O
being	O
used	O
widely	O
in	O
real-world	O
systems	O
.	O
</s>
<s>
A	O
partial	O
list	O
includes	O
Oracle	O
's	O
Database	O
in-memory	O
,	O
the	O
Github	O
load	B-Application
balancer	I-Application
,	O
the	O
Apache	O
Ignite	O
distributed	B-Operating_System
database	I-Operating_System
,	O
the	O
Tahoe-LAFS	O
file	O
store	O
,	O
the	O
CoBlitz	O
large-file	O
distribution	O
service	O
,	O
Apache	O
Druid	O
,	O
IBM	O
's	O
Cloud	O
Object	O
Store	O
,	O
the	O
Arvados	O
Data	O
Management	O
System	O
,	O
Apache	O
Kafka	O
,	O
and	O
by	O
the	O
Twitter	O
EventBus	O
pub/sub	O
platform	O
.	O
</s>
<s>
Implementation	O
is	O
straightforward	O
once	O
a	O
hash	B-Error_Name
function	I-Error_Name
is	O
chosen	O
(	O
the	O
original	O
work	O
on	O
the	O
HRW	O
method	O
makes	O
a	O
hash	B-Error_Name
function	I-Error_Name
recommendation	O
)	O
.	O
</s>
<s>
Each	O
client	O
only	O
needs	O
to	O
compute	O
a	O
hash	B-Error_Name
value	I-Error_Name
for	O
each	O
of	O
the	O
sites	O
,	O
and	O
then	O
pick	O
the	O
largest	O
.	O
</s>
<s>
If	O
the	O
hash	B-Error_Name
function	I-Error_Name
is	O
efficient	O
,	O
the	O
running	O
time	O
is	O
not	O
a	O
problem	O
unless	O
is	O
very	O
large	O
.	O
</s>
<s>
Python	O
code	O
implementing	O
a	O
weighted	O
rendezvous	O
hash	B-Error_Name
:	O
</s>
