AI engineering glossary · Data structures algorithms
What is consistent hashing?
Consistent hashing (also called hash ring): A scheme that places both servers and keys on a circular hash space and assigns each key to the next server clockwise. When servers are added or removed only a small fraction of keys move, unlike simple modulo assignment.
Consistent hashing: an example
With 4 cache servers, removing one moves only that server's keys to its neighbour, whereas key mod 4 to key mod 3 would remap almost every key.
Related terms
More Data structures algorithms terms
- Counting sort
- Cycle detection
- Data structure
- Depth-first search
- Deque
- Dijkstra's algorithm
- Directed acyclic graph
- Divide and conquer
Where you learn it
Consistent hashing is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.