What Is Database Replication?
On this page2
Database replication means keeping a copy of the same data on multiple machines connected by a network.
There are three main reasons you might want this:
- High availability — if one node goes down, another can serve reads and writes
- Reduced latency — keep data geographically close to your users
- Read throughput — spread read queries across multiple replicas
The challenge is that every write now has to propagate to all replicas. This is where the interesting trade-offs begin.
The core question
How do you ensure that every replica ends up with the same data? This is the problem of replication lag — the delay between a write landing on the leader and appearing on its followers.
The rest of this series will work through the three main approaches:
- Single-leader replication — one node accepts all writes, followers replicate the log
- Multi-leader replication — multiple nodes accept writes, must reconcile conflicts
- Leaderless replication — any replica accepts writes, clients read from a quorum
Each one makes different trade-offs between consistency, availability, and complexity.
References
- Martin Kleppmann, Designing Data-Intensive Applications, chapter 5 — the canonical treatment of replication this series works through.