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.

Level: advancedTopic: Data structures algorithms

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

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.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.