Learning path

Full curriculum

Full curriculum

Unit content

Data replication and replica lag

Replication stores copies of data on more than one node.

Replicas can improve availability, read capacity and geographic proximity, but every write must somehow reach the copies that should reflect it.

If updates propagate asynchronously, replicas can temporarily disagree. A client may write to one replica and then read an older value from another. The delay between accepting an update and another replica applying it is replica lag.

Replication therefore creates a coordination question: which copies must acknowledge a write before it is considered complete, and what may a read return while copies disagree?

More replicas do not automatically mean stronger reliability. The protocol must define how failures, recovery and divergent state are handled.