Module P-11·34 min read

Strong, causal, eventual, and monotonic reads as product decisions — plus quorum reads and writes and where R + W > N stops helping.

JJS
Written by Jatin Jain Saraf · Senior Software Engineer

Module P-11 — Consistency Models

What this module covers: Module P-10 established that under partition you must choose, and that even without partition you trade latency against consistency. This module is the menu you're choosing from. It builds the models as a hierarchy — linearizable, sequential, causal, the session guarantees, eventual — and anchors each to the bug report it produces rather than to its formal definition. Then the quorum arithmetic: why R + W > N gives overlap, worked for N=3, and the four places it stops helping. Finally the dials you actually turn in production — Cassandra's consistency levels, DynamoDB's strong versus eventual reads — and why session guarantees are what most products genuinely need.


"Eventual Consistency" Is a Promise About the Future, Not About Now

Module P-5 left you with a set of symptoms rather than a theory. A user changes their display name and the next page render shows the old one. A support agent marks a ticket resolved, refreshes, and it's open again. An order confirmation page says "you have no orders". The diagnosis in each case was replication lag, and the remedies were ad hoc: route that read to the primary, add a delay, cache the value client-side.

Those remedies work, but they're guesses, because "replication lag" names a cause rather than a contract. What you actually need is the ability to say: this read is allowed to be stale, this one is not, and this one may be stale but must never go backwards. That sentence is a consistency model. A consistency model is a contract between the storage system and the application about which orderings of operations an observer is permitted to see.

The critical framing: models are defined by what they forbid. Eventual consistency forbids almost nothing — it promises only that if writes stop, replicas converge. It says nothing about how long, nothing about what you see in the meantime, and nothing about whether two observers see the same thing. Every stronger model is eventual consistency plus a specific prohibition, and every prohibition costs coordination, which costs latency or availability or both.

Analogy: consistency models are the promises a postal service makes. Eventual consistency promises only that every postcard arrives eventually, in whatever order the sorting office produces. Causal consistency promises that if your reply quotes my postcard, mine is delivered first — the sorting office reads the quotes and orders accordingly. Linearizability promises there is exactly one mailbox in the world, everyone queues at it in real time, and nobody may write until the person ahead of them has finished. The single mailbox is the fastest to reason about and the one with the longest queue.


The Hierarchy, and What Each Model Forbids

Read this table as a ladder. Each row down permits something the row above forbids, and in exchange stops requiring some coordination.

ModelForbidsPermitsWhat it costs
LinearizableAny read returning a value older than a write that has already completed. All observers see one global order consistent with real time.Nothing about staleness — there is no staleness.Consensus or a single leader on the read path. Every operation pays at least one round trip to a majority; cross-region that is Mumbai↔Virginia RTT ~180 ms. Unavailable under partition (Module P-10).
SequentialReplicas applying operations in different orders. Everyone agrees on one total order.That order need not match real time — your read may be arbitrarily stale, as long as it's stale in an order everyone agrees on.A total order still needs agreement on ordering, so most of linearizability's coordination without its recency benefit. Rarely a deliberate production choice.
CausalSeeing an effect before its cause. If write B was influenced by write A, no observer sees B without A.Concurrent writes — writes with no causal relationship — appearing in different orders to different observers.Tracking causal dependencies: vector clocks or version vectors on every value, which grow with the number of writers. Concurrent writes surface as siblings the application must resolve.
Read-your-writesA client failing to observe its own completed write.That client seeing nothing of other clients' writes. Other clients seeing nothing of this one.Per-session routing or a write position token carried with the session. Loses free load balancing across replicas.
Monotonic readsReads going backwards. Once you've seen a value, you never see an older one.Never seeing the newest value at all. Arbitrary staleness, as long as it's non-decreasing.Pinning a session to a replica, or tracking the highest position observed. A replica failure resets the guarantee.
Monotonic writesA client's own writes being applied out of the order it issued them.Other clients' writes interleaving arbitrarily.Serialising a session's writes, which removes the option of firing independent writes concurrently.
EventualNothing about ordering. Only: if writes stop, replicas converge.Everything above. Reads that jump forwards and backwards, effects before causes, your own write invisible to you.Nothing at coordination time. You pay in application complexity and user-visible weirdness.

Three things this table hides that matter:

The hierarchy is not a single line. Linearizable implies sequential implies causal, and causal implies all four session guarantees. But the session guarantees are incomparable with each other — read-your-writes does not imply monotonic reads, and a system can provide monotonic reads without read-your-writes. That's why they're usually specified as a set.

There's a fourth session guarantee the industry names less often: writes follow reads (sometimes "session causality"). It forbids your write being ordered before a write you read prior to making it. The concrete case: you read a comment, reply to it, and your reply must not be ordered before the comment you were replying to. This is causal consistency scoped to one session.

Causal is the strongest model that stays available under partition. This is the useful practical result sitting on top of Module P-10: if you insist on remaining available to every client during a network partition, causal consistency is the ceiling. Anything stronger requires refusing service to the minority side. That makes causal the natural target for a system that has genuinely chosen availability, rather than treating "eventual" as the only alternative to "strong".

A distinction people conflate constantly: linearizability is about a single object over time. Serializability (Module P-1) is about multiple objects within a transaction. They are orthogonal. Snapshot isolation gives you a consistent view across many rows and is deliberately not linearizable — a snapshot read is stale by construction. When someone says "we need strong consistency", the first question is whether they mean recency on one key or atomicity across several, because the mechanisms are different and so are the bills.


Every Violation Has a Bug Report

Formal definitions do not survive contact with a standup. What survives is the symptom. Learn the models through the tickets they generate, because that's the direction you'll be reasoning in — from a screenshot to a mechanism.

The bug reportModel violatedThe mechanism underneath
"A reply appears above the comment it's replying to."CausalComment and reply were written to different partitions or regions and replicated independently. The reply's replication finished first.
"I changed my profile photo, the page reloaded, and it's the old one."Read-your-writesThe write went to the primary, the follow-up read went to a replica that hasn't replayed it (Module P-5).
"A colleague's new photo showed up, then reverted, then came back."Monotonic readsTwo reads load-balanced to two replicas with different lag. The second replica was further behind than the first.
"I deleted the tag then renamed the item, and now the tag is back on the renamed item."Monotonic writesThe two writes took different paths and were applied in the opposite order.
"The counter went 41, 43, 42, 44."Monotonic readsSame as above, on a value that changes fast enough for the reordering to be obvious.
"The transfer debited one account and hasn't credited the other yet."Not a consistency violation — an atomicity oneThis is Module A-3's problem (2PC, saga, outbox), not a replication problem. Reaching for a stronger consistency level will not fix it.
"Two users both claimed the last ticket."Linearizability, specifically read-modify-writeA quorum read followed by a quorum write is not atomic. This needs compare-and-set, which needs consensus (Module A-1) or a lock (Module A-2).

That last row is the one worth internalising. No consistency level makes read-then-write safe. You can read at the strongest level available and write at the strongest level available and still lose an update, because the two operations are separate and something can happen between them. Uniqueness, "claim the last one", and balance checks are a different class of problem requiring a different mechanism.

Why this matters in production: the most expensive debugging sessions in distributed systems come from treating a consistency-model violation as a bug in the code that produced the symptom. The reply-above-the-comment ticket gets assigned to whoever owns the comments UI, who adds a client-side sort by timestamp, which papers over it until clock skew (Module A-1) makes the timestamps lie too. Naming the violated model tells you which layer to fix and which team owns it.


R + W > N: The Arithmetic, and What It Actually Buys

Quorum replication is the standard way to get a tunable guarantee out of a leaderless system. You have N replicas per key. A write must be acknowledged by W of them before the client is told it succeeded. A read must collect responses from R of them and returns the value with the highest version.

The claim is that if R + W > N, the read set and the write set must overlap by at least one replica, so the read is guaranteed to see the latest completed write. The arithmetic is pigeonhole, not magic:

text

Sign in to keep reading

The rest of this module is free — sign in with Google to unlock it and track your progress.

Sign in & Register

Discussion

0

Join the discussion

Loading comments...

© 2026 Jatin Jain Saraf (JJS). All rights reserved.