Whenever data is copied to more than one machine, someone must decide what a reader sees right after a write. Strong consistency says "always the latest value" and eventual consistency says "the latest value, soon". You met both in the consistency and CAP lesson. This lesson turns them into a practical decision: which operations in your system need which guarantee, what each costs in latency, and how to mix them.
Detailed Notes
What Problem Are We Solving?
Recall from the replication lesson that a database keeps replicas (copies on other machines) for durability and read capacity. Copying takes time, so for a short window two replicas can hold different values. That window is replication lag, usually milliseconds within a data centre and 100 ms or more between continents.
During that window a reader may get an old value. We have two ways to handle it.
Strong consistency (also called linearizable): after a write succeeds, every later read, from anywhere, sees that write or something newer. The system behaves as if there were one copy.
Eventual consistency: if no new writes arrive, all replicas eventually hold the same value. In the meantime, reads can return stale data.
Strong consistency is not free. To guarantee it, a write must be confirmed by enough replicas (a quorum, a majority vote) before it is acknowledged, and reads must reach the leader or a quorum. That adds network round trips. Here is the cost across regions:
text
Assume a client in Mumbai, replicas in Mumbai, Frankfurt, Virginia
Round trip Mumbai <-> Frankfurt: about 120 ms
Round trip Mumbai <-> Virginia: about 200 ms
Strong write (needs 2 of 3 replicas to confirm):
local + nearest remote = about 120 ms before we can say "done"
Eventual write (confirm locally, copy in background):
local write only = about 5 ms
120 ms vs 5 ms: 24x slower, on every write.
During a network partition (two replica groups cannot talk), CAP forces a choice: refuse some requests to stay correct, or keep answering and risk staleness. Strong consistency picks the first, eventual consistency picks the second.
Strong vs Eventual ConsistencyComparison
Strong
wait for a quorum
1
Client writes to the leader
local region
2
Leader copies to replicas
2 of 3 must confirm
3
Acknowledge after the quorum
about 120 ms cross-region
4
Any later read sees the write
no stale answers
One-copy behaviour
Safe invariants (money, seats)
Slower writes
Writes fail without a quorum
Use where wrong data causes harm
Eventual
acknowledge, copy later
1
Client writes to the nearest replica
about 5 ms
2
Replica acknowledges at once
copy continues in background
3
Other replicas catch up
milliseconds to seconds
4
Early readers may see old data
then everyone converges
Fast local writes
Works during partitions
Stale reads
Conflicting writes need a rule
Use where staleness is harmless
Key point. Strong consistency makes the write wait. Eventual consistency makes the reader risk an old value.
What happens when a write is followed by a read from another region.
Option 1: Strong consistency
How it works
All writes go through a single leader, or through a consensus protocol (the distributed coordination lesson), and are acknowledged only after a quorum of replicas stores them. Reads are served by the leader or by a quorum of replicas, so they cannot miss a committed write. Relational databases with synchronous replication, and stores such as Spanner or etcd, work this way.
With quorum numbers: for N = 3 replicas, writing to W = 2 and reading from R = 2 gives W + R = 4 > 3, so any read set overlaps with any write set and at least one replica in every read has the latest value.
Pros
Simple mental model. Developers reason about one copy. No "why does my save not show up?" bugs.
Safe for invariants. Rules such as "balance never negative" or "a seat is sold once" can be enforced.
No conflict resolution. Writes are ordered, so two writers do not silently overwrite each other.
Cons
Higher latency. Every write waits for remote replicas. Cross-region writes cost hundreds of milliseconds.
Lower availability under partition. If the quorum is unreachable, writes (and sometimes reads) fail.
Harder to scale. Funnelling writes through a leader or consensus group limits throughput.
When to use it
Choose strong consistency when a stale or conflicting read causes real harm: money, inventory, bookings, uniqueness (usernames), locks and leader election, security permissions.
Realistic scenario. A bank transfer of 5,000 from account A to B. If the debit is visible but a read of B's balance comes from a stale replica, an app might show money vanished, or worse, allow a second transfer based on an old balance. Using a leader with synchronous replication and a transaction, the debit and credit commit together and every later read sees them. A 30 ms write is an acceptable price.
Option 2: Eventual consistency
How it works
A write is acknowledged by one replica (or a small number) and copied to the others asynchronously. Reads may be served by any nearby replica. If two replicas accept conflicting writes, the system resolves them with a rule such as last write wins (the newest timestamp wins; simple but can drop a write) or by merging values. Stores like Cassandra and DynamoDB (in their default modes) work this way, and so do caches and CDNs.
You can tune it. With N = 3, writing to W = 1 and reading from R = 1 is fastest and most available. Raising R or W (the quorum idea) moves you towards strong consistency per query.
Pros
Low latency. Writes complete locally in a few milliseconds.
High availability. Every region keeps working during a partition.
Scales well. Any replica can take traffic, and replicas can sit near users worldwide.
Cons
Stale reads. A user may not see their own update, or may see data go "back in time".
Conflicts. Concurrent writes in different regions need a resolution rule and can lose data.
Harder to reason about. Every feature must be designed to tolerate old data.
When to use it
Choose eventual consistency when short-lived staleness is harmless and availability or latency is the priority: like counts, view counts, feeds, recommendations, product catalog text, presence indicators, analytics.
Realistic scenario. A video shows "1.2M likes". Whether that is 1,200,000 or 1,200,041 for a few seconds matters to nobody, but making every like wait 120 ms for a cross-region quorum, at 50,000 likes per second, would cost throughput and money. The likes are accepted locally and merged in the background.
The hybrid: choose per operation
Real systems mix guarantees, and this is the answer interviewers want.
Read your writes. After a user posts a comment, route their next reads to the leader (or to a replica known to be caught up) for a few seconds. Everyone else can read from replicas. The author never sees their post vanish, and the system still scales reads.
Strong for the critical path, eventual for the rest. The checkout step uses a transactional database; the product page, recommendations and reviews come from replicated, cached stores.
Tunable quorums. Use W = 2, R = 2 for a payment lookup and W = 1, R = 1 for a view counter in the same cluster.
Read Your Writes on an Eventually Consistent SystemRequest flow
Key point. A small routing rule hides the staleness from the one person who would notice it.
Replica reads can lag, so the author's next read goes to the leader.
Interview Discussion
Do not label the whole system. Walk through operations and assign a guarantee to each.
List operations (for example create order, view product, like, search).
Ask "what is the cost of a stale read?" Money lost means strong. A slightly old number means eventual.
State the latency impact with a number, such as 5 ms vs 120 ms per write.
Describe the mitigation for the eventual parts (read-your-writes, idempotent updates, a periodic repair job).
Interview tip. "Eventual consistency" is not "data may be wrong forever". It means replicas converge once writes stop. Say how long: typically milliseconds to seconds. Also avoid claiming CAP forces you to pick two of three at all times; it only forces the choice during a partition.
Interview discussion. "I'd keep orders and payments strongly consistent using a leader and synchronous commit, because a stale read could double spend. Likes and view counts can be eventually consistent and merged asynchronously. For comments, I'd route the author's reads to the leader for a few seconds so they see their own post."
Trade-off thinking. Strong consistency buys correctness and simplicity and pays in latency and availability. Eventual consistency buys speed and uptime and pays in staleness and conflict handling. The cost is paid per operation, so pay it only where the business rule demands it.
Final Takeaway
Choose strong consistency when a stale or conflicting result causes real harm and the extra latency is acceptable. Choose eventual consistency when brief staleness is harmless and you need low latency, high availability or global scale. Mix them per operation, using read-your-writes to hide staleness from the person who just wrote. Always back the choice with a latency number and a clear statement of what a stale read costs.