Skip to content
All articles

Databases · Scaling writes

Replicas copy your writes. Partitions split them.

Read replicas add read capacity and a failover target. They do not raise the write ceiling, because every replica applies every write. Splitting the data is what divides the writes.

· 3 min read

Replication: a leader takes every write and copies it to replica 1, replica 2 and replica 3, each of which applies every write, so reads scale but the write load is copied, never divided. Partitioning: a router sends each key to its one home, shard 1 for keys A–H, shard 2 for keys I–P and shard 3 for keys Q–Z, so each write lands on one shard and writes and storage divide. Three ceilings replication can't raise: write throughput, dataset size and maintenance blast radius.

A database is CPU-bound on writes, and someone proposes adding three read replicas. It is a reasonable instinct, because replicas fixed the last capacity problem. They will not fix this one.

Replicas copy, they don't divide

Replication solved a read problem. Every replica holds a full copy, so you can keep adding readers until the leader's replication bandwidth gives out. What replication cannot do is make the dataset smaller or the write rate lower, because every replica does every write. Ten replicas do not give you ten times the write throughput. They give you ten copies of the same write throughput.

Replicas still earn their place: they add read capacity and a failover target. But short of making each write cheaper, raising the write ceiling means splitting the data so that each machine owns part of the writes.

Three ceilings, usually in this order

CeilingThe symptom you actually see
Write throughputReplication lag grows during peak and never fully drains; followers fall behind and your read-your-writes window widens
Dataset sizeThe working set stops fitting in RAM, and query latency steps up sharply because reads start hitting disk
Operational blast radiusEvery maintenance action, whether an index build, a major version upgrade or a restore, touches 100% of your customers at once

Partitioning splits the data so that each machine owns a disjoint subset. Writes divide, storage divides, and maintenance can be done one shard at a time.

Engineering Insight

That is the whole gain, and the course is blunt that everything else in this part of the course is the bill: choosing the key, the tenant that is 40% of your traffic, what moves when you grow, keeping track of where each key lives, resharding while live, secondary indexes, and work that crosses shards.

Get one diagram a week

A short article built around one engineering diagram, from the same library as these courses.

One diagram-led article a week on AI and systems engineering. We email you once to confirm, and every newsletter has an unsubscribe link. Privacy policy