Skip to content

Commit 496f539

Browse files
aneubecklook
andauthored
Update crates/consistent-hashing/README.md
Co-authored-by: Luke Francl <look@github.com>
1 parent 99c69f3 commit 496f539

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

crates/consistent-hashing/README.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,15 @@ Common algorithms
1515

1616
where `N` is the number of nodes and `R` is the number of replicas.
1717

18-
| Algorithm | Lookup per key | Node add/remove | Memory | Lookup with replication |
19-
| | (no replication) | | | |
20-
|-------------------------|---------------------|----------------------------------------|---------------------------|-------------------------------------|
21-
| 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 |
22-
| 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) | 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 |
26-
| JumpBackHash | O(1) expected | 0 | O(1) | Not native |
27-
| **ConsistentChooseK** | **O(1) expected** | **0** | **O(1)** | **O(R^2)**; **O(R log(R))**: using heap |
18+
| Algorithm | Lookup per key<br>(no replication) | Node add/remove | Memory | Lookup with replication |
19+
|-------------------------|--------------------------------------------------------------------------|-----------------|----------------|-----------------------------------------------|
20+
| 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 |
21+
| Rendezvous | O(N): max score | O(1) | O(N) node list | O(N log R): pick top R scores |
22+
| Jump consistent hash | O(log(N)) expected | 0 | O(1) | O(R log N) |
23+
| AnchorHash | O(1) expected | O(1) | O(N) | Not native |
24+
| DXHash | O(1) expected | O(1) | O(N) | Not native |
25+
| JumpBackHash | O(1) expected | 0 | O(1) | Not native |
26+
| **ConsistentChooseK** | **O(1) expected** | **0** | **O(1)** | **O(R^2)**; **O(R log(R))**: using heap |
2827

2928
Replication of keys
3029
- Hash ring: replicate by walking clockwise to the next R distinct nodes. Virtual nodes help spread replicas more evenly. Replicas are not independently distributed.

0 commit comments

Comments
 (0)