CMD Guide
HomeSystem DesignSystem Design Trade-offs

Strong vs Eventual Consistency

The mechanism: what does the client wait for?

The whole distinction collapses to one decision the storage engine makes on every write: does the write block until other replicas confirm it, or does it return the instant one node has stored it? Strong consistency blocks — the write is replicated synchronously and is not acknowledged to the client until enough replicas have durably applied it, so every later read is guaranteed to observe it. Eventual consistency does not block — the write is acknowledged as soon as a single node stores it, then propagated to the others asynchronously in the background, so a read that races that propagation can still see the old value.

Before going further, separate three terms that get treated as synonyms but are not the same model — this is the single most common mistake in the topic:

So the honest phrasing is: strong consistency in practice means linearizability; strict consistency is the impossible ideal above it; sequential consistency is a distinct, weaker model below it. The original “strict consistency or linearizability” gloss flattened three levels into one.

Eventual consistency: optimistic background propagation

Eventual consistency guarantees only that if no new writes arrive, all replicas will converge to the same value in finite time. It never promises when. A node applies a local write, returns success immediately, and ships the change to peers in the background via an anti-entropy or gossip mechanism. Because two replicas can accept conflicting writes concurrently, the system needs a convergence rule — commonly last-write-wins keyed on a timestamp or version, or a merge via vector clocks / CRDTs. The bet is that conflicts are rare or cheap to reconcile, so the system trades momentary correctness for the ability to answer every request from a nearby node without global coordination.

diagram
diagram

A worked trace: x = 10 across three regions

Take three replicas — leader US-West, plus US-East (one-way network delay ≈ 35 ms) and Europe (≈ 85 ms). The value x currently holds 5 everywhere. A client updates it to 10 on US-West at t=0. Under eventual consistency the write is acknowledged after only the leader stores it, and the two remote replicas catch up when the background replication packets arrive:

TimeEventUS-WestUS-EastEurope
t = 0 msClient writes x: 5 → 10 on US-West1055
t = 1 msUS-West returns OK to client1055
t = 30 msRead hits Europe → returns 5 (stale)1055
t = 40 msUS-East applies the replicated write10105
t = 90 msEurope applies the replicated write101010
t = 95 msRead hits Europe → returns 10 (converged)101010

The window t=1…90 ms is the inconsistency window: two users reading the same key legitimately get different answers. Nothing is broken — the system is behaving exactly as specified. A linearizable system would instead have made the client at t=0 wait until the required replicas confirmed, so the t=30 ms Europe read could never have returned 5.

Making a read guaranteed-fresh: quorums and R + W > N

Leaderless, Dynamo-style stores buy strong per-key read freshness — a quorum read is guaranteed to observe the latest committed value — without a single leader, by forcing read and write sets to overlap. Note the precise claim: this is freshness, not linearizability. Quorum reads do not order concurrent, in-flight writes, so a later-starting read can still return an older value than an earlier one (the classic non-linearizable anomaly proved on the dedicated quorum page); making quorum reads linearizable additionally requires synchronous read-repair with write-back (ABD) or falling back to a leader/consensus. With N replicas, a write must be acknowledged by W of them and a read must collect responses from R of them. The register-level invariant is:

R + W > N ⇒ the read set and the most-recent write set share at least one node, so a read always touches a replica holding the newest version.

Concretely, take N = 3, W = 2, R = 2 (so R + W = 4 > 3):

  1. t=0 — client writes x=10 (version v2) to the coordinator; it fans out to all three replicas.
  2. t=40 ms — West and East have applied v2, giving W=2 acks → the write commits and the client gets OK. Europe still holds v1 (x=5).
  3. A later read gathers R=2 replicas. Whatever pair it draws — {West,East}, {West,EU}, or {East,EU} — it must include West or East (the two that hold v2), because only one replica (EU) still has v1. The read compares version numbers and returns v2 → x=10.

Choosing W > N/2 additionally prevents two writes from both committing on disjoint majorities. A related knob is W = N (synchronous to every replica) for maximum read speed, versus W = 1 (fast writes, weak reads). Caveat: quorum overlap gives freshness per key; it is not full linearizability by itself — concurrent in-flight writes, sloppy quorums, and read-repair races still need care (Kleppmann details the edge cases).

diagram
diagram

Side-by-side comparison

AspectStrong (linearizable)Eventual
Read guaranteeEvery read returns the latest committed write; behaves like a single up-to-date copy.Reads may be stale right after a write; replicas converge over time once writes stop.
Write pathSynchronous — blocks until W replicas (or all) durably ack.Asynchronous — acks after 1 node; peers updated in the background.
LatencyHigher; a write pays at least one cross-replica round trip.Lower; served from the nearest node with no global coordination.
Availability under partitionMay refuse writes/reads rather than risk divergence (CP in CAP terms).Stays available; each side keeps serving and reconciles later (AP).
Conflict handlingSerialized by the protocol; conflicts cannot commit.Needs LWW / vector clocks / CRDTs to merge concurrent writes.
Typical homesSpanner, CockroachDB, etcd, ZooKeeper, single-leader SQL with sync replicas.DynamoDB (default), Cassandra, Riak, DNS, CDNs, caches (BASE).

The spectrum in between

Strong and eventual are the endpoints, not a binary. Several intermediate models fix specific pain points of plain eventual consistency without paying for full linearizability:

Many stores make this a per-operation knob (tunable consistency): Cassandra picks ONE / QUORUM / ALL per query, DynamoDB has a ConsistentRead flag, and Azure Cosmos DB exposes exactly these five named levels. That lets one system run strong reads for a balance check and eventual reads for a view counter.

When to use which — and against what

Decide per data class, not per system. The pivot question is: “If two users see different values for this key for a few hundred milliseconds, does anything actually go wrong?”

Choose strong consistency when a stale read causes a correctness or money bug: account balances, inventory decrements (selling the last unit twice), seat/room booking, idempotency keys, unique-username claims, leader election and config that other services trust. Concrete signals: the value is read-then-written under contention, or a human/downstream system takes an irreversible action on it.

Choose eventual consistency when the value is informational, high-volume, or geo-distributed and a short lag is invisible or harmless: like/view counters, feeds and timelines, product recommendations, presence indicators, DNS, CDN-cached assets, full-text search indexes.

Trade-off vs the named alternative. Strong consistency buys a mental model with zero anomalies but costs a cross-replica round trip on the critical path (tens to hundreds of ms across regions) and forfeits availability during partitions — a minority side must reject writes. Eventual consistency buys local-latency reads/writes and survival through partitions but costs you an inconsistency window and the obligation to write conflict-resolution logic (LWW silently drops a concurrent write; CRDTs avoid that but add memory and complexity). Put a number on the crossover: a US-West↔Europe replica pays ≈85 ms one-way, so a synchronous W=ALL write commits in ~170 ms+ (a full round trip), whereas an eventual W=1 write acks at local-SSD speed (sub-millisecond) and leaves an inconsistency window equal to the replication-lag SLA. That gap is why a multi-region feed absorbing on the order of 500k writes/s cannot afford a cross-region quorum on every write and must instead segment by data class — strong for the few keys where a stale read is a bug, eventual for the high-volume rest. Net rule: choose strong when a stale read is a bug; prefer eventual when a stale read is merely old news — and when unsure, reach for an intermediate model (read-your-writes or causal) before defaulting to either extreme.

Pitfalls

Takeaways


Re-authored and deepened for this guide. Sources: Martin Kleppmann, Designing Data-Intensive Applications (ch. 5 & 9, on replication, quorums, and linearizability); Werner Vogels, “Eventually Consistent” (ACM Queue, 2008); Gilbert & Lynch’s formal treatment of the CAP theorem; Herlihy & Wing on linearizability and Lamport on sequential consistency; the Google Spanner (OSDI 2012) and Amazon Dynamo (SOSP 2007) papers; Kyle Kingsbury’s Jepsen “Consistency Models” reference; and the Cassandra, DynamoDB, and Azure Cosmos DB consistency-level documentation.

🤖 Don't fully get this? Learn it with Claude

Stuck on Strong vs Eventual Consistency? Open Claude, copy a block below, and it'll teach you this exact concept — visually and interactively.

🎨 Explain it visually

Build the mental picture, not memorization.

I just read a lesson on **Strong vs Eventual Consistency** (System Design) and want to truly understand it. Explain Strong vs Eventual Consistency from first principles using ONE vivid real-world analogy and a visual mental model — draw it as ASCII art or a clear step-by-step diagram — with a concrete example using real numbers. Then ask me one question to check I got the mental picture, and wait for my reply. If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.
🤔 Walk me through it (interactive)

Socratic — adapts to where you're stuck.

Teach me **Strong vs Eventual Consistency** interactively. Ask me ONE guiding question at a time, wait for my answer, and adapt to my confusion — build the idea with me step by step instead of explaining it all at once. If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.
🧪 Quiz me & fix my gaps

Active recall exposes what you missed.

Quiz me on **Strong vs Eventual Consistency** with 5 questions, easy to tricky, ONE at a time. Tell me if each answer is right; at the end, explain clearly what I got wrong and why. If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.
🧠 Make it stick

Intuition + hook + flashcards for long-term memory.

Help me remember **Strong vs Eventual Consistency** for the long term: give the one-sentence intuition, a memorable hook/mnemonic, a tiny worked example, and 3 active-recall flashcards (Q -> A). If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.

📝 My notes