Replication & Partitioning
Copying data survives failure and scales reads. Splitting data scales writes and storage. Two different answers to two different problems, and confusing them is expensive.
Prerequisites: Databases 101 — transactions and indexes.
Cover these firstDatabases 101
After this: Separate the two concerns and explain what each one costs on the read and write path.
Suggested first pass: Read sections 1–5, answer each section in your own words, then use the remaining failure modes and exercises as the advanced pass.
| Replication | Partitioning (sharding) | |
|---|---|---|
| What it does | Same data on several machines | Different data on different machines |
| Read capacity | yes | yes |
| Write capacity | no | yes |
| Storage beyond one box | no | yes |
| Survives a node loss | yes | no |
Every replica applies every write, which is why replication never adds write throughput. Every partition holds one copy of its slice, which is why partitioning never adds durability. Real systems do both: partition the data, then replicate each partition.
Name the problem before the mechanism. "We need more write throughput, so partition" and "we need to survive a node loss, so replicate" are different sentences, and swapping them is the mistake.