Consistency Models
System Design: lesson 16 of 17
Same data, different promises about what a read may see.
Lesson 16 of 17 · 6 min
Consistency Models
Step 1 of 10
One key, three copies. The interesting question is not where it is stored — it is what a read is allowed to return.
The Idea
Replication hands every node a copy, so the real question is what a read may return. Strong consistency always shows the newest committed write. Eventual consistency may show any recent copy. Between them sit the guarantees users actually notice: read-your-writes, and causal order.
Real-World Example
You post a comment on a social feed, refresh, and it is gone. Your write landed on one replica and your read hit another. Read-your-writes pins the session to a replica that has your write, so the page stops contradicting you.
The Tradeoff
Strong reads cost a coordination round trip and stall during a failover. Weaker models are cheap and stay up, but hand the anomalies to your application. Choose the weakest model whose anomalies a user would never notice, then write that choice down where the next team will find it.
Your turn
Put the steps in the right order.
- The client is routed to a replica that has not applied it yet
- A write is accepted by the leader and acknowledged
- Later reads carry that version, so a lagging replica waits or forwards
- The refresh comes back missing the comment the user just posted
Mini quiz
1 / 3