Consistency Models
Choose the weakest consistency promise that still protects the product’s invariants and user expectations.
2–5 minute refresher
A consistency model defines which histories clients are allowed to observe
30second
refresher
refresher
A consistency model constrains what values a read may return and how operations appear ordered. Stronger models simplify application reasoning; weaker models reduce coordination and often improve latency and availability.
The useful spectrum
- Linearizable: each operation appears atomic and respects real-time order.
- Sequential: all clients agree on one order, which need not match wall-clock order.
- Causal: causes appear before their effects; unrelated writes may differ in order.
- Session guarantees: one user sees read-your-writes or monotonic reads.
- Eventual: replicas converge after writes stop, without promising when.
Explore replica visibility
Interactive lab
Consistency explorer
Write to one replica, propagate the version, and see what each read contract may return.
Possible readv1
Strong reads coordinate to return the latest committed version.
Decision guide
Key trade-offs
| Choice | What you gain | What it costs |
|---|---|---|
| Linearizable | Simple invariants and one current value | Coordination on the critical path |
| Causal / session | Intuitive user journeys with less global coordination | More metadata and narrower guarantees |
| Eventual | Low-latency local operation and availability | Stale reads, conflicts, and convergence logic |
What happens if?
A user updates a profile then reads from a lagging replica
Eventual consistency may show the old profile. Read-your-writes can pin the session to a replica or carry a version token so the user does not move backward.
What happens if?
Two clients reserve the last item
A stale availability read is harmless only until both writes commit. Inventory requires an authoritative conditional write even if browsing remains eventually consistent.
Senior interview modeIs sequential consistency stronger than causal consistency?Show answer
Yes. Sequential consistency requires one total order observed by everyone. Causal consistency orders only operations related by cause and effect, allowing concurrent operations to appear differently.