Ever wonder why adding or removing servers doesn't mess up your favorite streaming service?
Image: United States Department of Energy, Public domain, via Wikimedia Commons
Ever wonder why adding or removing servers doesn't mess up your favorite streaming service?
Imagine you're organizing a party and want to ensure everyone gets a seat, even if some friends drop in or leave unexpectedly.
Think of consistent hashing like a party where each friend has a unique seat number. If a friend arrives or leaves, only a few friends need to move seats, not everyone.
Example
If you have 10 friends (keys) and 5 seats (slots), adding a new friend means only 2 friends (10/5) need to find new seats.
Remember this
Consistent hashing minimizes the need to rearrange seats (keys) when friends (servers) arrive or leave.
Text adapted from Wikipedia, licensed under CC BY-SA 4.0.
consistent hashing does: minimizes remapping when nodes join/leave
How can we efficiently share resources without constant reorganization?
Peer-to-peer
How do you find a lost friend in a huge city?
Locality-sensitive hashing
Locality-sensitive hashing (LSH) hashes similar items into the same buckets
ACID
ACID guarantees data validity in transactions
database sharding does: splits data across machines by a partition key
Why can't you just split a huge library into smaller ones?
Distributed hash table
Ever wondered how your favorite streaming service instantly starts playing a movie?
Swipe through 100 ML concepts daily
Open Pocket Polymath