Sharding
Spreading the rows of a table across several databases. Each keeps a part and gets a part of the traffic.
Analogy
Like splitting a phone book into volumes: A-F, G-L, M-R and S-Z.
Test yourself: Sharding
Sharding
What does each shard hold?
With 3 shards, each holds a third of the users, without repeating them.
Sharding
What's the downside of hash-based splitting?
Going from id % 4 to id % 5 moves almost 80% of rows to another shard.
Sharding
Which is a downside of sharding?
Joining orders on shard 1 with users on shard 3 means fetching data from 2 servers over the network.
0/3
â–¶ Play