System Design Patterns: From Fundamentals to Real Systems
0% completed
Consistent Hashing
1. The Incident
The sharding design uses four shards, which are machines that each hold part of the data. The routing rule is hash(customer_id) % 4, and each shard handles 625 writes per second. The previous lesson looked at a move from 4 shards to 8. Now consider a smaller change: two years later, traffic growth requires only one more shard, a fifth. You change the rule from % 4 to % 5.
Before deployment, the team calculates its effect. The function hash(customer_id) turns the customer ID, which is the key, into a number
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%