• ↑↓ pour naviguer
  • pour ouvrir
  • pour sélectionner
  • ⌘ ⌥ ↵ pour ouvrir dans un panneau
  • ←→ pour naviguer
  • esc pour rejeter
⌘ '
raccourcis clavier

The Problem

Strong consistency limits availability and throughput because it requires synchronous coordination before every read. Many applications can tolerate temporary inconsistency in exchange for higher availability and lower latency.

Core Idea

After a write, reads will eventually see it — typically within milliseconds — as data is replicated asynchronously across nodes. The system guarantees convergence: given enough time without new writes, all replicas will hold the same value. Between the write and convergence, reads may return stale data.

How It Works

  1. Client writes to one node: The write is acknowledged immediately without waiting for replicas. The write is placed in a replication log.
  2. Asynchronous propagation: The replication log is streamed to other nodes in the background. Propagation delay depends on network latency, load, and batch size.
  3. Stale reads during window: A read to a node that hasn’t received the replication log returns the old value.
  4. Convergence: Once all replicas have processed the log, every read returns the latest write. If no new writes occur, the system becomes consistent.

Visual Explanation

G cluster_timeline Time → t0 T0: Write X=10 to Primary t1 T1: Read from Replica → old value (X=5) t0->t1 t2 T2: Async replication in progress t1->t2 t3 T3: Replication complete All reads return X=10 t2->t3 primary Primary X=10 replica_before Replica X=5 (stale) primary->replica_before async replication replica_after Replica X=10 (converged) replica_before->replica_after propagation done

Key Properties

  • Convergence guaranteed: Given no new writes, all replicas will eventually hold the same value
  • Asynchronous replication: Writes are acknowledged immediately; replication happens in the background
  • Temporary inconsistency window: Brief period between write and full propagation where stale reads are possible
  • Works in DNS (TTL propagation), email (SMTP delay), and many NoSQL databases (DynamoDB, Cassandra)

Connections

Edge Cases & Gotchas

  • Write conflicts: Concurrent writes to different replicas may produce conflicts that require reconciliation (last-write-wins, CRDTs, application-level merging).
  • Staleness bounds are application-defined: DNS uses TTLs to bound inconsistency. Without explicit bounds, staleness can grow arbitrarily under heavy load or network issues.
  • Read-your-write consistency is not guaranteed: A client that writes to one node and immediately reads from another may not see its own write. Session consistency or quorum reads can mitigate this.