Skip to main content

Eventual Consistency

1. Executive Summary​

Eventual consistency is a liveness-oriented guarantee for replicated systems: if updates stop and no new failures occur, all replicas will converge to the same value. During convergence, different clients may observe divergent states. Unlike linearizability, eventual consistency does not promise a single real-time order of operations—it promises that safety of convergence emerges when the system quiesces.

The model is central to the CAP theorem (Brewer conjecture; Gilbert & Lynch proof): under network partition, a system cannot simultaneously provide linearizable consistency and availability for all operations. Eventual consistency is the characteristic choice on the availability side of that tradeoff—Dynamo, Cassandra, Riak, DNS, and CDN caches all embody variants of "replicate now, reconcile later."

This chapter defines eventual consistency formally and informally, distinguishes safety (no permanent divergence after quiescence) from temporary anomalies (stale reads, write conflicts), covers convergence mechanisms (anti-entropy, read repair, gossip), operational and product implications, and principal-level decision criteria. Kleppmann (DDIA) and the Dynamo paper remain the canonical engineering references; Herlihy & Wing provide the contrast via linearizability as a stronger safety condition.

2. Why This Topic Matters​

Most large-scale consumer and internet systems are eventually consistent somewhere in the stack—even when marketing claims "strong consistency" at one layer. Principal architects must:

  • Explain what users can observe during inconsistency windows (stale reads, lost updates if misconfigured).
  • Design compensating mechanisms: idempotency, version vectors, CRDTs, sagas, and explicit conflict resolution.
  • Map CAP and PACELC to business requirements—not as slogans but as partition and latency behavior.
  • Avoid treating eventual consistency as "no consistency"—it is a defined guarantee with convergence obligations.

Interview failures include: assuming eventual consistency fixes itself without protocols, confusing it with causal consistency, or unable to quantify RPO/RTO and staleness SLOs for AP systems.

3. Problems Being Solved​

ProblemStrong consistency painEventual consistency approach
Regional partitionUnavailable writes/readsContinue serving; reconcile later
Write latency at global scaleQuorum + commit waitLocal write ack; async replicate
Peak traffic spikesLeader bottleneckMulti-master, local replicas
Cache and CDN freshnessExpensive invalidationTTL + eventual propagation
Offline/mobile clientsCannot reach leaderLocal queue; sync on reconnect
Cost of coordinationExpensive consensus clustersGossip, hinted handoff, repair

Eventual consistency solves availability and latency under partition and scale. It does not solve immediate global agreement—applications must tolerate or mask interim divergence.

4. Assumptions and System Model​

Assume partial failure, asynchronous network, and crash-stop replicas unless noted:

  • Replicas hold copies of data; writes may be accepted at one or many replicas.
  • Replication may be asynchronous; acknowledgments do not imply all replicas updated.
  • Quiescence: No new writes for sufficient time; all pending replication and repair complete.
  • Convergence function: After quiescence, all replicas return the same value for a given key (policy-dependent: last-writer-wins, merge, CRDT state).

CAP framing (Gilbert & Lynch): In a partition, CP systems sacrifice availability for linearizable behavior; AP systems remain available for operations but sacrifice strong consistency—typically eventual consistency with conflict handling.

Not assumed: Automatic conflict-free semantics without application or datatype support; bounded staleness unless explicitly added (e.g., session guarantees, CRDTs).

5. Essential Terminology​

TermDefinition
Eventual consistencyIf no new updates, all replicas eventually agree on value.
StalenessRead returns older value than another replica or than a prior acknowledged write.
ConvergenceProcess by which replicas reach identical state.
Anti-entropyBackground comparison and repair between replicas (Merkle trees, full scans).
Read repairRepair divergent replicas during read path when versions differ.
Hinted handoffTemporary redirect of writes when replica down; replay on recovery (Dynamo).
Sibling / conflictConcurrent versions detected via vector clocks; require merge.
LWW (last-writer-wins)Resolve conflicts by timestamp—implementation choice, can lose data.
AP systemAvailable + Partition-tolerant; typically eventual consistency.
PACELCIf Partition: A vs C; Else: Latency vs Consistency (Abadi, 2012).
Read-your-writesSession guarantee stronger than pure eventual—client sees own writes.

Mnemonic: Eventual = eventually the same, not always the same now.

6. Core Mechanism​

Informal guarantee​

For each data item:

  1. Replicas may diverge after concurrent or partitioned writes.
  2. Replication and repair propagate updates.
  3. When updates cease and repairs complete, all replicas return identical content per the system's resolution policy.

Convergence pathways​

Figure 1: Write accepted at one replica; async replication plus repair paths drive eventual convergence.

CAP partition behavior​

Figure 2: Under partition, AP systems accept writes on both sides; convergence required after heal. CP systems reject operations.

Version metadata and conflicts​

Figure 3: Concurrent writes create siblings; eventual consistency requires a merge policy—not silent data loss.

7. Step-by-Step Walkthrough​

Scenario: Dynamo-style shopping cart across three nodes (N=3, W=1, R=1 for availability).

StepEventStateClient observation
1Client writes cart to N1N1 has v1; N2,N3 staleWrite ack fast
2Client reads from N2N2 staleStale read—empty cart
3Read repair triggeredN2 updated from N1—
4Client re-reads N2v1 visibleConverged for this key
5Partition isolates N3N3 receives divergent write v2Divergence
6Partition healsAnti-entropy compares VVSiblings if concurrent
7Application mergeUnion cart policyConvergence with semantics

Insight: Step 2 is not a violation of eventual consistency—it is expected before convergence. Product must handle staleness (UI refresh, versioning) or tighten W/R (higher latency, less availability).

8. Invariants and Guarantees​

PropertyTypeStatement
Eventual convergenceSafety (asymptotic)Quiescent system → all replicas agree
Availability during partitionLiveness (AP)Some operations complete despite partition
Immediate consistencyNot guaranteedStale reads possible
Conflict freedomNot guaranteedConcurrent writes need policy
DurabilitySeparate dimensionDepends on W, fsync, quorum ack
MonotonicityOptional session guaranteeNot inherent to eventual

Safety vs liveness: Eventual consistency is a weak safety claim about the limit of execution, not about intermediate states. Lost updates are safety violations of application invariants, not of eventual consistency itself—often caused by LWW without proper versioning.

9. Failure Scenarios​

Scenario 1: Permanent divergence without repair​

Setup: Replica permanently lost; no replication factor replacement; W=1.

Effect: Safety violation of convergence—quiescent system still disagrees.

Mitigation: Replication factor, replacement, monitoring replica health, W>1 when needed.

Scenario 2: LWW clock skew​

Setup: Two regions write same key; EU clock ahead of US.

Effect: EU write wins always—data loss of US writes.

Mitigation: Logical clocks, version vectors, CRDTs, avoid wall-clock LWW across regions.

Scenario 3: Sibling explosion​

Setup: High write concurrency; vector clocks grow; no merge.

Effect: Reads return growing sibling lists; latency and storage blow up.

Mitigation: Prune policy, CRDT migration, partition keys to reduce conflicts.

Scenario 4: Read repair amplification​

Setup: Hot key; every read triggers cross-replica repair.

Effect: Liveness degradation—repair storm, latency spikes.

Mitigation: Probabilistic read repair, dedicated anti-entropy, raise R selectively.

Scenario 5: "Eventually" never arrives​

Setup: Continuous writes; backlog; under-provisioned replication.

Effect: System never quiesces; replicas chronically stale.

Mitigation: Capacity planning, lag SLOs, backpressure.

10. Performance Characteristics​

DimensionEventual (AP)Strong (CP)
Write latencyOften local/one replicaQuorum + leader RTT
Read latencyLocal replicaLeader or sync read
ThroughputHigh multi-masterLeader bounded
Tail latencyRepair spikesConsensus tails
Partition behaviorServes requestsErrors/timeouts

Qualitative: eventual consistency optimizes normal-case latency and availability; pays complexity and anomaly cost in application layer. Do not cite universal staleness bounds without measured replication lag.

11. Scalability Limits​

  • Conflict rate: Scales inversely with merge complexity—hot keys don't scale with naive multi-master.
  • Metadata: Vector clocks O(replicas) per object—bounds sibling detection cost.
  • Repair bandwidth: Anti-entropy full scans don't scale to petabytes without incremental/Merkle approaches.
  • Cognitive scale: Teams must reason about anomalies—organizational limit.

When eventual consistency scales well: Read-heavy, low conflict, tolerate staleness (social likes, view counts with approximation).

When it struggles: Financial balances, inventory without reservation, global uniqueness constraints.

12. Operational Considerations​

  • Define staleness SLOs: p99 replication lag, not just "eventual."
  • Monitor: Replica lag, repair rate, sibling count, hinted handoff queue depth.
  • Runbooks: Partition heal procedures; conflict merge escalation; replica replacement.
  • Client contracts: Document AP behavior; retries with idempotency keys.
  • Chaos testing: Partition tests before production; verify convergence time bounds empirically.

13. Security Considerations​

  • Conflict injection: Attacker writes divergent versions on partitioned replica—merge policy must not privilege attacker (e.g., unsigned LWW).
  • Stale read information leakage: Low-security replica in wrong region—consistency interacts with data residency.
  • Repair paths: Anti-entropy must authenticate peers; otherwise poisoned state spreads.
  • Availability vs abuse: AP systems stay up under DDoS—rate limiting still required.

Eventual consistency does not weaken authentication; it complicates integrity during divergence windows.

14. Cost Considerations​

  • Infrastructure: More replicas, cross-region bandwidth for repair vs fewer strongly consistent clusters.
  • Engineering: CRDT design, merge UX, testing concurrent histories—higher than "single primary SQL."
  • Incident cost: Subtle bugs (stale config rollout) expensive to debug without version metadata.
  • Revenue: Availability during partition may outweigh temporary inconsistency for some products.

Decision criterion: Choose eventual when downtime cost and latency SLO dominate immediate global correctness.

15. Production Implementations​

Amazon Dynamo (2007)​

Quorum-configurable N, R, W; vector clocks; hinted handoff; read repair—canonical AP design. DeCandia et al. explicitly trade consistency for availability. Modern DynamoDB differs—product evolution; read AWS docs for current models.

Apache Cassandra​

Tunable consistency per query (ONE, QUORUM, etc.); eventual by default at low levels; LWW on cells unless lightweight transactions (Paxos)—different mechanism, higher cost.

Riak​

Vector clocks and siblings; operational lessons on sibling proliferation informed later designs.

DNS and CDNs​

Extreme eventual consistency—TTL-driven; global convergence on the order of minutes acceptable.

CouchDB / Cloudant​

Multi-master replication with revision trees; conflicts explicit in document _rev.

Distinction: Implementation choices (W=1 vs W=quorum) change durability and staleness without changing the broad AP label.

16. Alternatives and Tradeoffs​

ModelPartition behaviorClient anomaliesComplexity
EventualAvailableStale, conflictsRepair + merge
CausalAvailable (often)No causal violationsVector metadata
LinearizableUnavailable or degradedNone (scoped)Consensus
Strong sessionAvailable with routingReduced for one clientSticky + versions
CRDTAvailableAlgebraic mergeDatatype design

PACELC: Without partition, still choose latency vs consistency (e.g., Cassandra LOCAL_ONE vs QUORUM).

17. Common Misconceptions​

MisconceptionReality
"Eventual = inconsistent forever"Converges when quiescent if repair works.
"No consistency"Weak but defined limit behavior.
"CAP means pick 2 of 3 always"Partition-specific tradeoff; normal case differs.
"Read repair fixes everything synchronously"Probabilistic; may lag.
"AP can't lose data"W=1, LWW, and partitions can lose or hide writes.
"Same as causal consistency"Causal is strictly stronger on happens-before.

18. Principal Architect Perspective​

  1. Quantify "eventual": Minutes vs milliseconds changes architecture acceptance.
  2. Own merge semantics: Infrastructure can't guess business merge for cart, calendar, or inventory.
  3. Partition drills: AP value only if you stay up safely enough—define "safely."
  4. Educate product: Users may see stale UI—design feedback loops.
  5. Layer guarantees: CDN eventual + DB strong is valid—state each layer's model.

Executives hear "eventual" as "broken." Translate to availability during failure and convergence SLO.

Convergence budgeting: Treat replication lag like a queue with a service-level objective. Measure p50/p99 lag per replica set; during incidents, lag spikes are often the first sign that "eventual" is stretching into user-visible minutes. Capacity plans should include repair bandwidth, not only write throughput—anti-entropy and read repair compete for the same cross-AZ links as foreground traffic. Kleppmann (DDIA) recommends making staleness and conflict behavior explicit in API contracts so client teams implement retries, versioning, and UI refresh against documented bounds rather than assuming instantaneous global agreement.

19. Architecture Review Exercise​

Scenario: Multi-region user profile store; W=1, R=1; profile includes email (unique) and avatar URL.

Review prompts:

  1. Can two regions register same email during partition?
  2. Is avatar staleness acceptable? Email uniqueness?
  3. What W/R for email vs avatar in same document?
  4. Idempotency for profile updates?
  5. Migration path to stronger consistency for email only?

Expected findings: Unique constraints need coordination; split document or regional authority; eventual alone insufficient for uniqueness without extra protocol.

20. Whiteboard Explanation​

90-second version:

"Eventual consistency means if we stop writing and let replication finish, all replicas agree. Until then, reads can be stale and concurrent writes can conflict. It's the AP side of CAP—stay available during partition, reconcile after. Dynamo did this with quorums you tune: low W and R for speed, higher for less staleness. You need version vectors or similar to detect conflicts, read repair and anti-entropy to converge, and application merge policy—LWW is easy but loses data. Kleppmann stresses it's not absence of consistency but a guarantee about the limit. Principal architects pick it when downtime hurts more than temporary wrong reads, and invest in idempotency and conflict handling."

21. Interview Questions​

  1. Define eventual consistency.

    • Signals: Quiescence, convergence, interim divergence allowed.
  2. CAP theorem—what is sacrificed in AP?

    • Signals: Linearizable consistency during partition; availability retained.
  3. How does Dynamo converge?

    • Signals: Read repair, anti-entropy, hinted handoff, quorums.
  4. What is a sibling?

    • Signals: Concurrent versions; vector clock compare.
  5. Risks of W=1, R=1?

    • Signals: Stale reads, durability loss on node failure.
  6. Eventual vs causal consistency?

    • Signals: Causal preserves happens-before; eventual does not.
  7. Can eventual consistency lose writes?

    • Signals: Yes—LWW, partition, no durable quorum.
  8. What is read repair?

    • Signals: Fix replicas on read when versions differ.
  9. PACELC extension?

    • Signals: Latency vs consistency without partition.
  10. How do CRDTs relate?

    • Signals: Stronger convergence semantics for datatypes; still often AP.
  11. Design idempotency for eventual consumers.

    • Signals: Dedup keys, version checks, at-least-once delivery.
  12. Staleness SLO for AP system?

    • Signals: Lag metrics, p99 bound, client refresh strategy.
  13. When reject eventual consistency?

    • Signals: Invariants need immediate global agreement (unique, balance).
  14. Hinted handoff purpose?

    • Signals: Write availability when replica down; replay later.

22. Interview Follow-Ups​

  1. Measure convergence time after partition heal?

    • Signals: Lag dashboards, chaos experiments, key sampling.
  2. Email uniqueness under AP?

    • Signals: Central authority, consensus per email, or accept risk.
  3. Compare Dynamo quorums to Cassandra consistency levels.

    • Signals: Tunable R/W; LOCAL vs GLOBAL scope.
  4. Executive wants both CAP C and A?

    • Signals: Impossible under partition; scope reduction, mitigation.
  5. Migrate AP cart to stronger model?

    • Signals: Per-user leader, CRDT, or CP metadata service.

22A. Production Low-Level Design (Interview + Game Day)​

Design AP/EL preferences with explicit merge and a CP carve-out. Production LLD and Game Day Standard.

Data model​

Field classModelConflict strategy
Theme / localeEventualLWW or CRDT merge
Marketing flagsEventualVersion vector + UI resolve
Password / 2FACP / strongSingle-region or consensus

Step-by-step flow:

StepGuaranteeClient UX
1–2Local durabilityFast write
3–4Eventual visibilitySession guarantee optional
5–6ConvergenceDeterministic merge

SLO​

Staleness SLO: p99 replication lag < X seconds; conflict rate dashboard.


22B. Game Day Playbooks​

#DrillInjectDetectMitigateVerify
GD-1Replication lagPause async channelLag SLO burnRead repair / throttle writesConvergence after heal
GD-2Concurrent conflictDual-region write same keyConflict metricMerge rule firesConverged value matches spec
GD-3Security field on EL pathTry weak write on 2FAAuthz denyForce CP pathStrong path only

GD-2 — Concurrent update merge​

23. Strong Answer Example​

Question: "Design a globally available user settings service."

Answer this as a 45-minute greenfield design using the PRACTICE framework. Below is how a strong student sounds aloud—AP/EL for preferences, with explicit merge and a CP carve-out for security-critical fields.

PRACTICE interview answer map for globally available user settings

Figure A: PRACTICE map — Problem → Requirements → Assumptions → Capacity → Topology → Invariants → Constraints → Evolution.


Student interview script (PRACTICE)​

P — Problem framing​

"We're designing a user settings service that must stay available worldwide—theme, locale, notification prefs, etc. Users should update settings near them without waiting on a distant quorum, and keep reading during a regional outage.

That points to eventual consistency: local write ACK, async replicate, converge when healthy. Settings tolerate brief staleness; money and passwords do not.

Non-goals: Spanner for every preference field, or 'Cassandra will sync eventually' without conflict policy."

R — Requirements​

TypeRequirement
FRGet/put user settings document (or field patch); multi-device sync
NFRGlobal availability under partition; p99 write ACK low (local); lag SLO (e.g. p99 < 5–30s)
ConsistencyEventual converge; read-your-writes for the editing user when possible
Security carve-outPassword / MFA / billing flags → CP sub-path
OpsLag alerts; conflict metrics; documented merge rules

"I'll ask: active-active all regions? Field-level vs whole-doc? I'll assume multi-region active-active, per-user_id document, soft prefs vs hard security split."

A — Assumptions (state aloud)​

AssumptionWhy it matters
Soft settings can diverge brieflyEnables AP writes
Concurrent edits rare but real (two devices)Need vectors / CRDT / field policy
Sticky routing or session affinity availableHelps read-your-writes
Dynamo/Cassandra/Cosmos-style store OKTunable W/R
Wall-clock LWW alone is weakPrefer versions / CRDTs for critical merges

"If they insist always-fresh everywhere, I'd push PACELC: that costs EC latency or PC unavailability—wrong default for theme prefs."

C — Capacity (back-of-envelope)​

Users → 100M (say)
Settings reads/user/day → high (every session)
Settings writes/user/day → low (few)
Peak write QPS → thousands (bursty, still modest)
Doc size → few KB JSON
Replication lag SLO → p99 < 5–30s; page at breach
Conflict rate → should be tiny; alert if spikes

"This workload is read-heavy, write-light—perfect for local write + async fan-out."

T — Topology (draw this)​

Global user settings active-active topology

Figure B: US/EU/APAC local stores; async replicate; sticky region for read-your-writes; CRDT/field LWW merge; lag SLO.

Pattern choice: Multi-region AP/EL for preference docs; CP microservice for security/billing flags.

ConcernApproach
Write pathLocal region ACK; async replicate
Read-your-writesSticky region / session; or read repair / quorum for that user
Concurrent editsVersion vector / per-field version; CRDT for sets/counters
Non-critical field conflictField-level LWW with version (not raw wall clock alone)
Anti-entropyGossip / stream / Dynamo-style repair
CachingShort TTL; don't hide conflicts longer than lag SLO

Settings write path under eventual consistency

Figure C: Local ACK → async replicate → sticky read-your-writes → merge concurrent edits → converge.

API sketch:

  1. PUT /users/{id}/settings with If-Match / client version (idempotent upsert).
  2. Persist in local region; return 200 + new version.
  3. Replicate asynchronously; consumers merge by policy.
  4. GET from sticky region when possible; else accept staleness within SLO or use quorum read for "important" prefs.

I — Invariants (safety)​

"Non-negotiable:

  1. Convergence: after quiescence, all regions agree on the settings doc (modulo policy).
  2. No silent lost updates without a defined merge—detect concurrency (vectors).
  3. Security fields never on the AP path—password/MFA → CP.
  4. Idempotent PUT—retries don't fork phantom versions carelessly.
  5. Staleness is bounded by SLO—breach ⇒ alert, not surprise."

C — Constraints (second C)​

ConstraintDesign response
Two devices edit offlineField merge / CRDT; show "synced" UX
Cross-region read after writeSticky routing; optional sync read API
CDN caching settingsVery short TTL or bypass for authenticated GET
Billing language / tax regionTreat as CP or strongly consistent flag
Wall-clock LWWAvoid for multi-writer; use HLC/version

E — Evolution (phased + prove)​

Phased delivery:

PhaseDeliverable
M1Single-region settings + versioned PUT
M2Multi-region async replicate; lag SLI/SLO
M3Sticky read-your-writes; conflict metrics
M4Field-level merge policies / CRDTs where needed
M5Split CP auth settings; chaos partition game day

Failure modes:

FailureMitigation
Partition both sides writeVector detect + merge policy
Long lagAlert; degrade UX ("settings may take a minute")
Cache serves ancient prefsTTL bound ≤ lag SLO
Password on eventual storeMove to CP—non-negotiable
LWW clock skew wrong winnerVersions / HLC

Observability: replication_lag_p99, conflict/merge count, sticky miss rate, CP vs AP traffic split.


Closing line (interview)​

"So: globally available settings = AP/EL—local write, async replicate, versioned merge, lag SLO, sticky read-your-writes. I'd use Dynamo/Cassandra-style storage with explicit conflict policy—not hope. Passwords and billing flags stay CP. Eventual consistency is a contract with convergence, not 'no consistency.'"

Scoring signals​

StrongWeak / red flag
AP/EL + lag SLO"Cassandra syncs eventually"
Conflict detection / merge policyNo concurrent-edit story
Read-your-writes (sticky)Ignores own-write visibility
CP carve-out for securityPassword on eventual store
Idempotent versioned PUTBlind overwrite
Anti-entropy / repairCache-only "fix"

Compact outline (if time-boxed to 2 minutes)​

"AP multi-region settings doc keyed by user_id. Local ACK, async replicate, lag p99 SLO. Version vectors / field merge; sticky region for read-your-writes. Idempotent PUT. Password/MFA on CP service. Alert on lag and conflicts. Not for balances."

24. Weak Answer Example​

Question: "Design a globally available user settings service."

"Use Cassandra with eventual consistency. It'll sync eventually. Add caching for speed."

Why weak / red flags: No W/R tuning, no conflict detection, no field-level policies, no security exception, no staleness SLO; caching can worsen staleness.

25. Hands-On Exercise​

Lab: labs/lab-005-eventual-consistency/ — convergence simulator on :8099

cd labs/lab-005-eventual-consistency
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
pytest tests/ -v
docker compose -p lab005 -f docker/docker-compose.yml up --build -d
chmod +x scripts/demo_consistency.sh && ./scripts/demo_consistency.sh
StepEndpointWhat happens
1POST /v1/keys/{key}W=1 write on chosen replica
2GET /v1/keys/{key}?replica=r2Stale read before async replication
3POST /v1/replicate/runBackground anti-entropy push
4POST /v1/chaos/partitionIsolate replica during writes
5POST /v1/keys/{key}/repairRead repair converges lagging replica

Swagger: http://localhost:8099/docs

Engineer guide: how the local stack works​

  1. 3 replicas — async replication with configurable delay; W=1 fast path, R=1 default read.
  2. Version tokens — each write increments version; reads return replica-local value (may be stale).
  3. Anti-entropy worker — POST /v1/replicate/run pushes pending updates to peers.
  4. Partition chaos — isolate a replica; observe divergent reads until heal + repair.
  5. Read repair — on-demand push of latest version without incrementing write version.

Pairs with Amazon DynamoDB Consistency and Lab 002 vector clocks.

Build-from-scratch exercise (optional)​

  1. Simulate 3 replicas, async replication delay, W=1, R=1.
  2. Inject concurrent writes during partition; log divergent reads.
  3. Implement read repair on read; measure time to convergence after heal.
  4. Add LWW vs vector sibling merge; compare data loss cases.
  5. Write product-facing doc: what users may see for 60s after edit.

Success criteria: Demonstrate stale read before repair; document one scenario where LWW loses a write.

26. Knowledge Check​

  1. What triggers convergence in theory? (Quiescence—no new writes, repair complete.)
  2. AP during partition sacrifices what? (Strong/linearizable consistency.)
  3. Does read repair run on every read in Dynamo? (Design choice—often probabilistic.)
  4. Sibling detection mechanism? (Vector/version clock concurrent compare.)
  5. Is W=1 durable? (Not necessarily—depends on failure before replication.)
  6. PACELC "else" branch? (Latency vs consistency without partition.)

27. Flashcards​

#FrontBack
1Eventual consistencyQuiescent replicas converge to same value.
2CAP (partition)Linearizability vs availability—not both.
3AP systemAvailable under partition; typically eventual.
4StalenessRead older than another replica or prior write.
5Read repairUpdate lagging replicas during read.
6Anti-entropyBackground replica reconciliation.
7Hinted handoffBuffer writes for temporarily down replica.
8SiblingConcurrent conflicting versions.
9LWW riskClock skew → silent data loss.
10PACELCPartition: A/C; else: Latency/Consistency.
11DynamoN,R,W tunable quorums; vector clocks.
12Not guaranteedImmediate consistency, conflict freedom.

28. Cheat Sheet​

EVENTUAL CONSISTENCY
- Stop writes + repair → replicas agree
- During: stale reads, conflicts OK (by model)
- AP / CAP availability side

CONVERGE VIA
- Async replication
- Read repair (often probabilistic)
- Anti-entropy / gossip
- Hinted handoff

CONFLICTS
- Version vectors → siblings
- LWW (risky), app merge, CRDTs

TUNE
- N, R, W quorums (Dynamo)
- Cassandra CL per query

INTERVIEW
- Not "no consistency"
- vs causal, vs linearizable
- Kleppmann: define merge policy

30. References​

Primary sources​

Production and engineering​

Textbooks​

  • Martin Kleppmann, Designing Data-Intensive Applications (O'Reilly) — Chapters 5, 7, 9 on replication, consistency, and conflict resolution.
  • Herlihy, M., & Shavit, N. (2020). The Art of Multiprocessor Programming — consistency spectrum context for concurrent objects.

Distinction​

Claim typeSource
CAP partition tradeoffGilbert & Lynch (2002)
Dynamo mechanismsDeCandia et al. (2007)
PACELCAbadi (2012)
Linearizability contrastHerlihy & Wing (1990)
Convergence time in productionOperational measurement—no universal bound