Rendezvous hashing
Rendezvous or highest random weight (HRW) hashing is an algorithm that allows clients to achieve distributed agreement on a set of k options out of a possible set of n options.[src] A typical application is when clients need to agree on which sites (or proxies) objects are assigned to.[src] Consistent hashing addresses the special case k = 1 using a different method.[src] Rendezvous hashing is both much simpler and more general than consistent hashing (see below).[src]
Rendezvous or highest random weight (HRW) hashing is an algorithm that allows clients to achieve distributed agreement on a set of k options out of a possible set of n options.[src] A typical application is when clients need to agree on which sites (or proxies) objects are assigned to.[src] Consistent hashing addresses the special case k = 1 using a different method.[src] Rendezvous hashing is both much simpler and more general than consistent hashing (see below).[src] Rendezvous hashing solves a general version of the distributed hash table problem: We are given a set of n sites (servers or proxies, say).[src] How can any set of clients, given an object O , agree on a k-subset of sites to assign to O ?[src] The standard version of the problem uses k = 1.[src] Each client is to make its selection independently, but all clients must end up picking the same subset of sites.[src] This is non-trivial if we add a minimal disruption constraint, and require that when a site fails or is removed, only objects mapping to that site need be reassigned to other sites.[src] The basic idea is to give each site S_j a score (a weight) for each object O_i , and assign the object to the highest scoring site.[src] All clients first agree on a hash function h(\cdot) .[src] For object O_i , the site S_j is defined to have weight w_{i, j} = h(O_i, S_j) .[src] Each client independently computes these weights w_{i, 1}, w_{i, 2} \dots w_{i, n} and picks the k sites that yield the k largest hash values.[src] The clients have thereby achieved distributed k -agreement.[src] If a site S is added or removed, only the objects mapping to S are remapped to different sites, satisfying the minimal disruption constraint above.[src] The HRW assignment can be computed independently by any client, since it depends only on the identifiers for the set of sites S_1, S_2 \dots S_n and the object being assigned.[src] HRW easily accommodates different capacities among sites.[src] If site S_k has twice the capacity of the other sites, we simply represent S_k twice in the list, say, as S_{k, 1}, S_{k, 2} .[src] Clearly, twice as many objects will now map to S_k as to the other sites.[src] Consider the simple version of the problem, with k = 1, where all clients are to agree on a single site for an object O.[src] Approaching the problem naively, it might appear sufficient to treat the n sites as buckets in a hash table and hash the object name O into this table.[src] Unfortunately, if any of the sites fails or is unreachable, the hash table size changes, forcing all objects to be remapped.[src] This massive disruption makes such direct hashing unworkable.[src] Under rendezvous hashing, however, clients handle site failures by picking the site that yields the next largest weight.[src] Remapping is required only for objects currently mapped to the failed site, and disruption is minimal.[src] Rendezvous hashing has the following properties: Low overhead: The hash function used is efficient, so overhead at the clients is very low.[src] Load balancing: Since the hash function is randomizing, each of the n sites is equally likely to receive the object O.[src] Loads are uniform across the sites.[src] Site capacity: Sites with different capacities can be represented in the site list with multiplicity in proportion to capacity.[src] A site with twice the capacity of the other sites will be represented twice in the list, while every other site is represented once.[src] High hit rate: Since all clients agree on placing an object O into the same site S O , each fetch or placement of O into S O yields the maximum utility in terms of hit rate.[src] The object O will always be found unless it is evicted by some replacement algorithm at S O .[src] Minimal disruption: When a site fails, only the objects mapped to that site need to be remapped.[src] Disruption is at the minimal possible level.[src] Distributed k-agreement: Clients can reach distributed agreement on k sites simply by selecting the top k sites in the ordering.[src] The standard version of Rendezvous Hashing described above works quite well for moderate n, but when n is extremely large, the hierarchical use of Rendezvous Hashing achieves O(\log n) running time.[src] This approach creates a virtual hierarchical structure (called a "skeleton"), and achieves O(\log n) running time by applying HRW at each level while descending the hierarchy.[src] The idea is to first choose some constant m and organize the n sites into c = \lceil n / m \rceil clusters C_1 = \left\{ S_1, S_2 \dots S_m \right\}, C_2 = \left\{ S_{m+1}, S_{m+2} \dots S_{2m} \right\} \dots Next, build a virtual hierarchy by choosing a constant f and imagining these c clusters placed at the leaves of a tree T of virtual nodes, each with fanout f .[src] In the accompanying diagram, the cluster size is m = 4 , and the skeleton fanout is f = 3 .[src] Assuming 108 sites (real nodes) for convenience, we get a three-tier virtual hierarchy.[src] Since f = 3 , each virtual node has a natural numbering in octal.[src] Thus, the 27 virtual nodes at the lowest tier would be numbered 000, 001, 002, ..., 221, 222 in octal (we can, of course, vary the fanout at each level - in that case, each node will be identified with the corresponding mixed-radix number).[src] The easiest way to understand the virtual hierarchy is by starting at the top, and descending the virtual hierarchy.[src] We successively apply Rendezvous Hashing to the set of virtual nodes at each level of the hierarchy, and descend the branch defined by the winning virtual node.[src] We can in fact start at any level in the virtual hierarchy.[src] Starting lower in the hierarchy requires more hashes, but may improve load distribution in the case of failures.[src] For example, instead of applying HRW to all 108 real nodes in the diagram, we can first apply HRW to the 27 lowest-tier virtual nodes, selecting one.[src] We then apply HRW to the four real nodes in its cluster, and choose the winning site.[src] We only need 27 + 4 = 31 hashes, rather than 108.[src] If we apply this method starting one level higher in the hierarchy, we would need 9 + 3 + 4 = 16 hashes to get to the winning site.[src] The figure shows how, if we proceed starting from the root of the skeleton, we may successively choose the virtual nodes (2)_3 , (20)_3 , and (200)_3 , and finally end up with site 74.[src] The virtual hierarchy need not be stored, but can be created on demand, since the virtual nodes names are simply prefixes of base- f (or mixed-radix) representations.[src] We can easily create appropriately sorted strings from the digits, as required.[src] In the example, we would be working with the strings 0, 1, 2 (at tier 1), 20, 21, 22 (at tier 2), and 200, 201, 202 (at tier 3).[src] Clearly, T has height h = O(\log c) = O(\log n) , since m and f are both constants.[src] The work done at each level is O(1) , since f is a constant.[src] The value of m can be chosen based on factors like the anticipated failure rate and the degree of desired load balancing.[src] A higher value of m leads to less load skew in the event of failure at the cost of higher search overhead.[src] The choice m = n is equivalent to non-hierarchical rendezvous hashing.[src] In practice, the hash function h(\cdot) is very cheap, so m = n can work quite well unless n is very high.[src] For any given object, it is clear that each leaf-level cluster, and hence each of the n sites, is chosen with equal probability.[src] Rendezvous hashing (HRW) is much simpler conceptually and in practice.[src] It also distributes objects uniformly over all sites, given a uniform hash function.[src] Unlike consistent hashing, HRW requires no precomputing or storage of tokens.[src] Consider k =1.[src] An object O_i is placed into one of n sites S_1, S_2 \dots S_n by computing the n hash values h(O_i, S_j) and picking the site S_k that yields the highest hash value.[src] If a new site S_{n+1} is added, new object placements or requests will compute n+1 hash values, and pick the largest of these.[src] If an object already in the system at S_k maps to this new site S_{n+1} , it will be fetched afresh and cached at S_{n+1} .[src] All clients will henceforth obtain it from this site, and the old cached copy at S_k will ultimately be replaced by the local cache management algorithm.[src] If S_k is taken offline, its objects will be remapped uniformly to the remaining n-1 sites.[src] Variants of the HRW algorithm, such as the use of a skeleton (see below), can reduce the O(n) time for object location to O(\log n) , at the cost of less global uniformity of placement.[src] When n is not too large, however, the O(n) placement cost of basic HRW is not likely to be a problem.[src] HRW completely avoids all the overhead and complexity associated with correctly handling multiple tokens for each site and associated metadata.[src] Rendezvous hashing also has the great advantage that it provides simple solutions to other important problems, such as distributed k -agreement.[src] Rendezvous hashing is both simpler and more general than consistent hashing.[src] Consistent hashing can be shown to be a special case of HRW by an appropriate choice of a two-place hash function.[src] From the site identifier S the simplest version of consistent hashing computes a list of token positions, e.g., t_s = h_c(S) where h_c hashes values to locations on the unit circle.[src] Define the two place hash function h(S, O) to be \frac{1}{\min_S ( h_c(O) - t_s )} where h_c(O) - t_s denotes the distance along the unit circle from h_c(O) to t_s (since h_c(O) - t_s has some minimal non-zero value there is no problem translating this value to a unique integer in some bounded range).[src] This will duplicate exactly the assignment produced by consistent hashing.[src] It is not possible, however, to reduce HRW to consistent hashing (assuming the number of tokens per site is bounded), since HRW potentially reassigns the objects from a removed site to an unbounded number of other sites.[src] import mmh3 import math from dataclasses import dataclass def hash_to_unit_interval(s: str) -> float: """Hashes a string onto the unit interval (0, 1]""" return (mmh3.hash128(s) + 1) / 2**128 @dataclass class Node: """Class representing a node that is assigned keys as part of a weighted rendezvous hash.""" name: str weight: float def compute_weighted_score(self, key: str) -> float: score: float = hash_to_unit_interval(f"{self.name}: {key}") log_score: float = 1.0 / -math.log(score) return self.weight * log_score def determine_responsible_node(nodes: list[Node], key: str) -> Node: """Determines which node of a set of nodes of various weights is responsible for the provided key.""" return max(nodes, key=lambda node: node.compute_weighted_score(key), default=None) Example outputs of WRH: import wrh from collections import Counter from wrh import Node node1: Node = Node("node1", 100) node2: Node = Node("node2", 200) node3: Node = Node("node3", 300) print(str(wrh.determine_responsible_node([node1, node2, node3], "foo"))) prints: "Node(name='node1', weight=100)" print(str(wrh.determine_responsible_node([node1, node2, node3], "bar"))) prints: "Node(name='node2', weight=300)" print(str(wrh.determine_responsible_node([node1, node2, node3], "hello"))) prints: "Node(name='node2', weight=300)" nodes: list[Node] = [node1, node2, node3] responsible_nodes: list[Node] = [wrh.determine_responsible_node( nodes, f"key: {key}").name for key in range(45_000)] print(Counter(responsible_nodes)) prints: Counter({'node3': 22487, 'node2': 15020, 'node1': 7493})[src]
85 sentences · 85 cited inline · 0 references stored
References
No reference rows published for this article.
Cite this article
MLA
"Rendezvous hashing." encyclopegia.org, 2026, https://encyclopegia.org/wiki/rendezvous-hashing. Accessed 30 November 2026.
Chicago
"Rendezvous hashing." encyclopegia.org. Accessed November 30, 2026. https://encyclopegia.org/wiki/rendezvous-hashing.
APA
encyclopegia.org. (2026). Rendezvous hashing. Retrieved November 30, 2026, from https://encyclopegia.org/wiki/rendezvous-hashing
Accessed November 30, 2026 · CC BY-SA 4.0 · citation page · JSON