Skip to content
State and Consistency

06.03 · Concept

Replication and Consistency

Say what a replica guarantees, and why a read can be behind the write you just made.

Replication keeps data available across machines, but a replica only gives the consistency contract the system actually implements. With asynchronous followers, quorum choices, or eventually consistent stores, a successful write can be absent from the replica that serves your next read unless read-your-writes or stronger guarantees are enforced.

What this lesson answers

  • why can replicas return stale data after writes
  • what does read your writes consistency guarantee
  • how do quorums affect replica consistency

Notes

Replication and Consistency — Replication exists to keep copies of data on multiple machines for availability and latency, but without explicit consistency guarantees a client can write value and then read older value from a replica that has not yet received the update.

Key Concepts: - A replica is a copy of a dataset maintained on another node; with replicas, the system can often survive node failure while still serving reads. - In leader-based replication, writes go to a primary/leader first, then are copied to followers; a follower read can be stale if…

Common questions

Does replication mean every read sees the latest write?
No. Replication means data is copied to other nodes, not that every copy is current at every moment. If updates are applied asynchronously, a follower can still be behind when a client reads from it. The read behaviour depends on the system’s consistency model, routing, and replication lag.
Why can I write successfully and then read the old value?
The write may have committed on the leader, while the read is served by a follower that has not applied that update yet. From the database’s point of view, this can be valid if the read path only promises eventual consistency or ordinary follower reads, not read-your-writes consistency.
How do quorum reads and writes reduce stale reads?
Quorums make reads and writes contact overlapping sets of replicas. If the configured read and write quorums overlap, a read is more likely to encounter a replica that saw the latest acknowledged write. If the values are too weak, a read can be served entirely from replicas that missed the update.