Skip to content

Commit 90259e9

Browse files
committed
Update README.md
1 parent fc69a9e commit 90259e9

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

crates/consistent-hashing/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,17 @@ where `N` is the number of nodes and `R` is the number of replicas.
2020
|-------------------------|---------------------|----------------------------------------|---------------------------|-------------------------------------|
2121
| Hash ring (with vnodes) | O(log N): binary search over N points; O(1): with specialized structures | O(log N) | O(N) | O(log N + R): Take next R distinct successors |
2222
| Rendezvous | O(N): max score | O(1) | O(N) node list | O(N log R): pick top R scores |
23-
| Jump consistent hash | O(log(N)) expected | 0 | O(1) | Not native |
24-
| AnchorHash | O(1) expected | O(1)? | O(N)? | Not native |
25-
| DXHash | O(1) expected | O(1)? | O(N)? | Not native |
23+
| Jump consistent hash | O(log(N)) expected | 0 | O(1) | O(R log N) |
24+
| AnchorHash | O(1) expected | O(1) | O(N) | Not native |
25+
| DXHash | O(1) expected | O(1) | O(N) | Not native |
2626
| JumpBackHash | O(1) expected | 0 | O(1) | Not native |
2727
| **ConsistentChooseK** | **O(1) expected** | **0** | **O(1)** | **O(R^2)**; **O(R log(R))**: using heap |
2828

2929
Replication of keys
3030
- Hash ring: replicate by walking clockwise to the next R distinct nodes. Virtual nodes help spread replicas more evenly. Replicas are not independently distributed.
3131
- Rendezvous hashing: replicate by selecting the top R nodes by score for the key. This naturally yields R distinct owners and supports weights.
32-
- Jump consistent hash and variatns: the base function returns one bucket. Replication can be achieved by hashing (key, replica_index) and collecting R distinct buckets; this is simple but loses the consistency property!
32+
- Jump consistent hash: the base function doesn't support replication. But the math can be easily modified to support consistent replication.
33+
- JumpBackHash and variants: The trick of Jump consistent hash to support replication won't work here due to the additional state introduced.
3334
- ConsistentChooseK: Faster and more memory efficient than all other solutions.
3435

3536
Why replication matters

0 commit comments

Comments
 (0)