All topicsTopic 15 / 24
Intermediate 1 minute
Database Replication
Replication copies database changes from one node to one or more other nodes. A primary may accept writes while replicas serve reads or provide failover capacity. Replicas improve availability and read scale, but copying takes time, so a read can briefly lag behind a write. A design must define which reads require the newest value.
Key idea
Copies improve resilience and read capacity, but introduce replication lag.
See it in one picture
Follow the arrowsPrimary
Changes
Replica 1
Replica 2
One copy sends changes to others
Real-world example
An article service writes new posts to a primary database and serves popular read traffic from replicas. After publishing, the author's own request may be routed to the primary to show the newest version.
Quick check