Skip to main content
Replication Strategies

Track 3: Replication Strategies

How to copy data across nodes while maintaining consistency guarantees. Replication is the foundation of both reliability and performance in distributed systems — it ensures your data survives machine failures and allows read traffic to be spread across multiple servers. But it comes with a fundamental tension: the more copies you maintain, the harder it is to keep them all in sync, especially when the network is slow or partitioned.
Track Duration: 38-46 hours
Modules: 5
Key Topics: Single-leader, Multi-leader, Leaderless, Conflict Resolution, CRDTs

Module 11: Single-Leader Replication

The most common replication strategy.
Single-Leader Replication Architecture

Synchronous vs Asynchronous Replication

Leader waits for follower acknowledgment before confirming write.
Pros:
  • Follower guaranteed to be up-to-date
  • No data loss on leader failure
Cons:
  • Higher latency
  • Leader blocked if follower slow/dead

Replication Lag

Understanding Replication Lag

Replication Lag Timeline Replication lag is the time delay between when a write occurs on the leader and when it’s applied on a follower. The diagram above shows a 150ms lag where the follower is consistently behind the leader. Why Lag Happens (and why you cannot eliminate it entirely):
  • Network latency between leader and followers — speed-of-light physics; a cross-region replica 5000km away has at minimum ~17ms RTT just from physics
  • Follower processing slower than leader writes — the follower must apply writes in order, and a single slow query (e.g., index rebuild) stalls everything behind it
  • Follower temporarily offline or restarting — when it comes back, it must replay the entire backlog before it is “caught up”
  • High write throughput overwhelming followers — if the leader can write at 100K TPS but the follower’s disk can only sustain 80K TPS, the gap grows monotonically until you intervene
Measuring Lag:
Acceptable Lag: Depends on your use case
  • Financial systems: Milliseconds
  • Analytics: Minutes or hours acceptable
  • Caching: Seconds to minutes
Solutions to Lag Problems:
  • Sticky sessions: Route user’s reads to same follower
  • Read from leader: For critical reads after writes
  • Version vectors: Track causality explicitly

Implementing Read-Your-Writes Guarantees

One of the most common consistency issues users experience. Here’s how to implement it:
Production Implementation (Version Tracking):
Comparison of Approaches: Causal Consistency Tokens (Advanced): Systems like MongoDB use “causal consistency tokens” that encode the entire causal history, not just a single version. This ensures you see all causally-related writes, not just your own.

Handling Failover

│ │ │ STEP 1: DETECT LEADER FAILURE │ │ ───────────────────────────── │ │ • Heartbeat timeout (typically 10-30 seconds) │ │ • Multiple checks to avoid false positives │ │ │ │ STEP 2: ELECT NEW LEADER │ │ ──────────────────────── │ │ • Most up-to-date follower preferred │ │ • May use consensus (Raft) or controller node │ │ │ │ STEP 3: RECONFIGURE SYSTEM │ │ ───────────────────────── │ │ • Update clients to write to new leader │ │ • Other followers switch to new leader │ │ • DNS/load balancer update │ │ │ │ GOTCHAS: │ │ ──────── │ │ ┌──────────────────────────────────────────────────────────────────┐ │ │ │ SPLIT-BRAIN: Both old and new leader think they’re the leader │ │ │ │ DATA LOSS: Async replication means new leader may be behind │ │ │ │ CONFLICTS: Old leader comes back with conflicting writes │ │ │ └──────────────────────────────────────────────────────────────────┘ │ │ │ │ GITHUB 2012 INCIDENT: │ │ MySQL failover caused data loss │ │ Auto-incrementing IDs reused → foreign key violations │ │ │ └─────────────────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────────────────┐ │ MULTI-LEADER REPLICATION │ ├─────────────────────────────────────────────────────────────────────────────┤ │ │ │ Datacenter A │ Datacenter B │ │ │ │ │ ┌──────────────┐ │ ┌──────────────┐ │ │ │ Leader A │◄────────────┼────────►│ Leader B │ │ │ └──────┬───────┘ Async │ └──────┬───────┘ │ │ │ Sync │ │ │ │ ┌─────┴─────┐ │ ┌─────┴─────┐ │ │ ▼ ▼ │ ▼ ▼ │ │ ┌────────┐ ┌────────┐ │ ┌────────┐ ┌────────┐ │ │ │Follower│ │Follower│ │ │Follower│ │Follower│ │ │ └────────┘ └────────┘ │ └────────┘ └────────┘ │ │ │ │ │ Clients ───► Local Leader │ Clients ───► Local Leader │ │ │ │ └─────────────────────────────────────────────────────────────────────────────┘ USE CASES: ──────────
  1. Multi-datacenter operation (write locally, replicate globally) — This is the most common. Write latency stays local (~1-5ms instead of cross-continent ~100-200ms). Trade-off: conflicts.
  2. Offline-capable clients (phone writes locally, syncs later) — CouchDB and PouchDB were designed specifically for this pattern. Your phone is essentially a “leader” that syncs when connectivity returns.
  3. Collaborative editing (each user has local leader) — Google Docs uses a variant of this combined with Operational Transform.
WARNING: Multi-leader replication is one of the most conflict-prone patterns in distributed systems. Only use it when the latency or availability benefits clearly outweigh the complexity of conflict resolution. If you can tolerate routing all writes through a single leader (even with higher latency), do that instead — it is dramatically simpler to reason about.
CONFLICT SCENARIO: ────────────────── Time Leader A Leader B ──── ──────── ──────── t1 x = 1 x = 1 (Initial state) t2 x = 2 x = 3 (Concurrent writes!) t3 (replicate) ────────────── (replicate) t4 x = 2 AND 3? x = 3 AND 2? CONFLICT! WHEN TO DETECT: ─────────────── • Synchronous: Detect immediately (if possible) • Asynchronous: Detect during replication (too late to reject) Most multi-leader systems detect asynchronously → must resolve conflicts after the fact
  1. LAST-WRITE-WINS (LWW) ──────────────────────── Use timestamps, highest timestamp wins
Problem: Data loss (other write silently discarded) Problem: Clock skew can cause “wrong” winner Used by: Cassandra, DynamoDB (default)
  1. MERGE VALUES ──────────────── Combine conflicting values
x = 2 + x = 3 → x = [2, 3] Problem: Not always semantically meaningful
  1. CUSTOM RESOLUTION ──────────────────── Application-specific logic
Example: For shopping cart, union of items Example: For counter, add the deltas
  1. PROMPT USER ────────────── Show conflicts to user, let them choose
Used by: Git, some CMS systems
BEST STRATEGY: Avoid conflicts in the first place TECHNIQUES: ───────────
  1. ROUTE BY USER User’s writes always go to same leader No concurrent writes to same data
  2. ROUTE BY DATA Partition data, each partition has one leader
  3. GLOBAL LOCKING Acquire lock before write (defeats purpose of multi-leader though)
  4. CRDT DATA TYPES Data structures designed to merge without conflicts (covered in Module 15)
┌─────────────────────────────────────────────────────────────────────────────┐ │ LEADERLESS REPLICATION │ ├─────────────────────────────────────────────────────────────────────────────┤ │ │ │ NO LEADER! Client writes to multiple nodes directly. │ │ │ │ Client │ │ ┌───┐ │ │ │ │ │ │ └─┬─┘ │ │ Write │ Write │ │ ┌─────────────────┼─────────────────┐ │ │ ▼ ▼ ▼ │ │ ┌─────────┐ ┌─────────┐ ┌─────────┐ │ │ │ Node 1 │ │ Node 2 │ │ Node 3 │ │ │ │ x = 5 │ │ x = 5 │ │ x = 5 │ │ │ └─────────┘ └─────────┘ └─────────┘ │ │ │ │ QUORUMS: │ │ ──────── │ │ N = total nodes │ │ W = nodes that must acknowledge write │ │ R = nodes that must respond to read │ │ │ │ RULE: W + R > N (ensures overlap, some node has latest) │ │ │ │ COMMON CONFIGS: │ │ ─────────────── │ │ N=3, W=2, R=2: Balanced read/write, tolerates 1 failure │ │ N=3, W=3, R=1: Fast reads, writes need all nodes │ │ N=3, W=1, R=3: Fast writes, reads slower but consistent │ │ │ │ DATABASES: Cassandra, Riak, DynamoDB, Voldemort │ │ │ └─────────────────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────────────────┐ │ QUORUM INTERSECTION │ ├─────────────────────────────────────────────────────────────────────────────┤ │ │ │ WHY W + R > N WORKS: │ │ │ │ N = 5 nodes, W = 3, R = 3 │ │ │ │ Write touches: [1] [2] [3] ✓ [ ] [ ] │ │ Read touches: [1] ✓ [ ] [4] [5] ← Some overlap! │ │ ↑ │ │ This node has the latest write! │ │ │ │ OVERLAP = W + R - N = 3 + 3 - 5 = 1 │ │ At least 1 node in read set has latest value │ │ │ │ EDGE CASES: │ │ ─────────── │ │ W + R = N: Exactly 0 overlap possible (risky) │ │ W + R < N: May read stale data │ │ │ ├─────────────────────────────────────────────────────────────────────────────┤ │ │ │ SCENARIO: Some home nodes unreachable │ │ │ │ Client wants to write x = 5 │ │ Home nodes for x: [A, B, C] │ │ But node C is down! │ │ │ │ STRICT QUORUM: │ │ ────────────── │ │ Wait for C or fail (reduced availability) │ │ │ │ SLOPPY QUORUM: │ │ ────────────── │ │ Write to D instead of C (D is not home node) │ │ Still get W nodes, just not the “right” ones │ │ │ │ Write: [A ✓] [B ✓] [C ✗] [D ✓ hint] │ │ │ │ HINTED HANDOFF: │ │ ─────────────── │ │ When C comes back online: │ │ D says “I have a hint for you” → sends x = 5 to C │ │ D deletes hint after C acknowledges │ │ │ │ ┌────────────────────────────────────────────────────────────────┐ │ │ │ WARNING: With sloppy quorums, W + R > N doesn’t guarantee │ │ │ │ reading latest value! Reads might miss the hint node. │ │ │ └────────────────────────────────────────────────────────────────┘ │ │ │ └─────────────────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────────────────┐ │ ANTI-ENTROPY │ ├─────────────────────────────────────────────────────────────────────────────┤ │ │ │ Mechanisms to detect and repair inconsistencies │ │ │ │ 1. READ REPAIR │ │ ─────────────── │ │ During reads, detect stale replicas and update them │ │ │ │ Client reads x from [A, B, C]: │ │ A: x = 5 (version 3) │ │ B: x = 5 (version 3) │ │ C: x = 3 (version 2) ← Stale! │ │ │ │ Action: Send x = 5 to C (background repair) │ │ │ │ 2. MERKLE TREES │ │ ──────────────── │ │ Efficiently compare data between nodes │ │ │ │ ROOT (hash of children) │ │ / \ │ │ HASH(A,B) HASH(C,D) │ │ / \ / \ │ │ HASH(A) HASH(B) HASH(C) HASH(D) │ │ │ │ │ │ │ │ [Data A] [Data B] [Data C] [Data D] │ │ │ │ COMPARISON: │ │ ─────────── │ │ Node1 and Node2 exchange root hashes │ │ If same → all data matches (done!) │ │ If different → compare children, recursively find mismatches │ │ │ │ EFFICIENCY: O(log n) comparisons to find one mismatch │ │ │ └─────────────────────────────────────────────────────────────────────────────┘

Dotted Version Vectors (DVV)

Traditional Version Vectors can grow linearly with the number of nodes (O(N)O(N) overhead) and can be imprecise for concurrent updates to the same node. Dotted Version Vectors (DVV), used in Riak, solve this by separating the “dot” (a specific update) from the “causal context.” Key Benefit: DVVs accurately distinguish between “I have seen this update” and “This update is a sibling of that one,” leading to significantly fewer false conflicts during churn.

Last-Write-Wins (LWW) Deep Dive

Application-Level Resolution


Module 15: CRDTs

Conflict-free Replicated Data Types - data structures that automatically merge.
Advanced Topic: CRDTs are asked at Staff+ level interviews, especially at companies building collaborative tools.

Counter CRDTs

CRDT Counter Visualization

CRDT Counter Why CRDTs Are Powerful: Traditional approach:
CRDT approach:
Real-World CRDT Usage:
  • Redis: CRDT-based geo-replicated databases
  • Riak: Uses CRDTs for distributed counters and sets
  • Figma: Uses CRDTs for collaborative design
  • Apple Notes: CRDTs for offline-first sync
Tradeoff: CRDTs require more memory (store per-node state) but eliminate coordination overhead.

Set CRDTs

Register CRDTs

JSON CRDTs & Rich Text (Automerge/Yjs)

Modeling a simple counter or set is one thing, but how do you model a JSON Document or a Rich Text Document (like this one)?

1. JSON CRDT Architecture

A JSON CRDT models the document as a Tree of CRDTs.
  • Objects: Maps where keys map to other CRDTs.
  • Arrays: Sequences where each element has a unique ID and a pointer to the previous element (RGA - Replicated Growable Array).
  • Registers: For leaf values (strings, numbers).

2. The Interleaving Problem

In collaborative text editing, if Alice inserts “A” and Bob inserts “B” at the same position, a naive CRDT might result in “BA” for Alice and “AB” for Bob. Modern CRDTs like Yjs and Automerge use Causal Ordering and Unique IDs to ensure that all replicas agree on the order (e.g., “AB” for everyone).

Delta-CRDTs: Optimizing Bandwidth

The biggest drawback of State-based CRDTs (CvRDTs) is that the state grows over time. If you have a counter with 1,000 nodes, you must send all 1,000 counts every time you sync. Delta-CRDTs solve this by only sending the Delta (the changes) since the last successful synchronization.
  • Dot Store: A way to track which specific updates (dots) a neighbor has already seen.
  • Delta-Group: A collection of updates that are merged together before being sent.
  • Efficiency: Reduces bandwidth from O(N)O(N) to O(Δ)O(\Delta), making CRDTs viable for mobile devices on slow networks.

Garbage Collection & Tombstones

When you remove an element from a CRDT (like a 2P-Set or OR-Set), you must keep a Tombstone to prove to other nodes that the item was deleted. If you delete the tombstone too early, a node that hasn’t seen the deletion might “re-infect” the cluster with the old data.

Strategies for Cleaning Tombstones:

  1. Stable State GC: Only delete a tombstone once you have proof (via gossip) that every node in the cluster has seen the deletion.
  2. Time-based GC: Delete tombstones after a very long period (e.g., 30 days). If a node stays offline longer than that, it must be completely wiped and re-synced from scratch.

CRDT Usage in Practice

Multi-Paxos / Raft Groups (Sharded Consensus)

A single consensus group (e.g., one Raft cluster) is bottlenecked by the CPU and I/O of a single leader. To scale to millions of requests, you must use Sharded Consensus.

Architecture: Multi-Group

Instead of one large group, we partition the data into many small shards, each managed by its own independent consensus group.

The Challenge: Cross-Shard Transactions

When an operation affects multiple shards (e.g., Transfer($5) from Shard A to Shard B), you need a higher-level protocol like Two-Phase Commit (2PC) or Percolator to coordinate across the individual consensus groups. Used By: CockroachDB (Ranges), TiDB (Regions), and Google Spanner (Paxos Groups).

Chain Replication

Chain replication is a widely used technique for high-throughput, linearizable replication. It is used in systems like FAWN and CORFU.

Advanced Design Scenarios

Scenario 1: Global E‑Commerce Database Replication

You run a global e‑commerce platform with users in US, EU, and APAC. You want strong guarantees for orders and payments, but can tolerate slightly stale reads for product browsing. Design:
  • Topology:
    • Single write leader region (e.g., us-east-1) with synchronous followers in the same region.
    • Read replicas per region (EU, APAC) receiving asynchronous replication from the leader.
  • Write path:
    • All order and payment writes go to the regional leader in us-east-1.
    • Use semi-synchronous replication inside the leader region: commit after 1 follower ACK to avoid single-copy-of-truth.
  • Read path:
    • Critical reads (order status, payment status): hit the leader region or only replicas with replication lag < T ms.
    • Non-critical reads (product catalog, reviews): go to nearest regional replica even if seconds behind.
Consistency & failure behavior:
  • RPO/RTO:
    • With semi-sync in primary region, losing the leader does not lose committed transactions; failover to the in-region sync follower.
    • Cross-region replication remains async → if the entire region fails, you may lose up to (Δ) seconds of writes that haven’t replicated.
  • Patterns used:
    • From this module: single-leader replication, sync vs async, replication lag awareness, and failover.
    • Combined with consistency models: guarantee read-your-writes by routing post-write reads to the leader or using a min_lsn/min_commit_time threshold on replicas.

Scenario 2: Active‑Active User Profile Store

You want low-latency profile updates and reads from any region, and you’re willing to accept eventual consistency for some fields but not for others. Requirements:
  • Profile updates can happen in any region (multi-leader / active‑active).
  • Some fields (e.g., email, phone) must avoid conflicting values.
  • Other fields (e.g., last_seen_at, recently_viewed) can be merged.
Design:
  • Multi-leader replication between regions with a log for each leader.
  • Per-field conflict resolution strategy:
    • Identity fields (email, phone, name): Last-Write-Wins per field with server-side timestamps (avoid whole-record LWW).
    • Activity fields (recently_viewed, devices, tags): treat as CRDT sets or counters and merge.
Failure / partition behavior:
  • During a partition, each region continues accepting writes.
  • On healing:
    • For scalars, keep value with newer timestamp (assuming bounded skew, or use hybrid logical clocks).
    • For sets/counters, apply CRDT merge (no conflicts).
This scenario composes:
  • Multi-leader replication + conflict detection (version vectors or timestamps).
  • Conflict resolution strategies and CRDTs for different fields in the same entity.

Scenario 3: Leaderless Metrics Store with Tunable Consistency

You’re designing a high-throughput metrics and logs store similar to Dynamo/Cassandra. Availability and write throughput matter more than strict consistency. Design:
  • Leaderless replication with parameters (N, W, R):
    • (N = 3) replicas per key.
    • For writes: (W = 2) for production metrics, (W = 1) for debug logs.
    • For reads: (R = 1) for dashboards where staleness is acceptable, (R = 2) for alerting queries.
  • Anti-entropy:
    • Enable read repair on reads (update stale replicas in background).
    • Periodically run Merkle tree comparisons between nodes to reconcile drift.
Partition & failure behavior:
  • Partial node failures: As long as at least (W) nodes are reachable for writes and (R) for reads, the system remains available with overlapping quorums.
  • Sloppy quorums + hinted handoff:
    • When a home replica is down, temporarily write to a substitute node (hinted handoff) to keep (W) high.
    • On recovery, hints are replayed to repair the downed node.
  • Trade-offs:
    • For alerting: configure (W + R > N) and avoid sloppy quorums to favor correctness.
    • For debug logs: allow (W = 1, R = 1) and sloppy quorums to maximize write availability.
This scenario applies:
  • Quorum mathematics ((W + R > N)), sloppy quorums, hinted handoff, and anti-entropy techniques from this module in a concrete operational design.

Key Interview Questions

Choose leaderless when:
  • High availability is critical (any node can accept writes)
  • Write latency matters (write to nearest nodes)
  • Can tolerate eventual consistency
  • Multi-datacenter with no clear primary
Choose leader-based when:
  • Need strong consistency
  • Transactions required
  • Simpler conflict resolution
  • Read-heavy workload (scale reads with followers)
Examples:
  • Leaderless: Session data, user activity, metrics
  • Leader: Financial transactions, inventory, user accounts
Requirements analysis:
  • Cart shared across devices
  • Offline support
  • Reasonable merge behavior
Solution:
Common scenario: User updates profile, immediately views it, sees old data.Solutions:
  1. Read-your-writes consistency
    • Track writes with client-side timestamp
    • Read from replica that’s caught up
    • Or read from leader for recently-written data
  2. Monotonic reads
    • Stick user to same replica (session affinity)
    • Or track last-seen replica position
  3. Synchronous replication for critical data
    • Higher latency but guaranteed consistency
  4. Application-level workaround
    • Optimistic UI (assume success)
    • Show cached data with “syncing” indicator
Answer:

Next Steps

Continue to Track 4: Distributed Transactions

Learn 2PC, Saga pattern, and distributed locking

Interview Deep-Dive

Strong Answer:
  • Single-leader replication (Raft-backed, primary-replica) gives you strong consistency guarantees with a simple mental model: all writes go to one node, followers replicate in order. The cost is that write latency equals the round-trip to the leader. If the leader is in US-East and a user in Tokyo writes, they pay 150ms+ cross-Pacific latency. Leader failure also causes a brief unavailability window during election (typically 1-5 seconds for Raft).
  • Leaderless replication (Dynamo-style: Cassandra, Riak) removes the single-leader bottleneck. Any node can accept writes, so users write to the nearest replica with low latency. Reads are consistent if R + W > N (quorum overlap guarantees at least one node in the read set has the latest value). The cost is operational complexity: you need conflict resolution strategies, you lose serializability across keys, and sloppy quorums can break consistency guarantees.
  • My recommendation depends on the workload. For a service requiring strong consistency (financial ledger, authentication tokens), I choose single-leader. For a service where availability and low latency matter more (user profiles, shopping carts, IoT telemetry), I choose leaderless. For the middle ground (social feeds, collaborative tools), I consider multi-leader with conflict resolution.
Follow-up: What is the problem with sloppy quorums and why do they break the consistency guarantee?A sloppy quorum allows writes to be acknowledged by nodes that are not the “home” nodes for the data — temporary stand-ins when the actual replicas are unreachable. The quorum overlap guarantee (R + W > N) assumes reads and writes hit the same set of N nodes. With sloppy quorums, a write might go to nodes A, B, D (where D is a stand-in for the unreachable C), but a subsequent read hits A, B, C. D has the latest value but is not in the read set, so the read returns stale data. The value on D will eventually reach C via hinted handoff, but until then, the system is inconsistent. Sloppy quorums prioritize write availability over consistency.
Strong Answer:
  • Replication lag is the delay between a write committed on the primary and that write being visible on a follower. In single-leader systems with async replication, lag ranges from milliseconds (same DC) to seconds (cross-region), and can spike to minutes under load.
  • The user experience impact is the “time travel” effect: a user writes data, gets success, then reads from a follower and does not see their own write. For example, a user posts a comment, the page refreshes hitting a follower, and the comment is missing.
  • Detection: instrument replication lag as a first-class metric. For MySQL, monitor Seconds_Behind_Master. For PostgreSQL, monitor pg_stat_replication.replay_lag. Set alerts when lag exceeds your SLA.
  • Mitigation: (1) Read-your-writes — after a write, route subsequent reads from the same session to the primary or a fresh replica. (2) Monotonic reads — pin sessions to a specific replica so users never go back in time. (3) Synchronous replication for critical paths — writes wait for at least one follower, reducing lag at the cost of latency. (4) If using Kafka, auto-scale consumers when lag grows.
Follow-up: What happens if replication lag grows so large that a follower falls permanently behind?If a follower falls behind to the point where the primary’s WAL has been rotated and the follower’s position is no longer available, incremental catch-up is impossible. The follower needs a full resynchronization: snapshot the primary, restore on the follower, then replay WAL from the snapshot position. During recovery, the follower is unavailable for reads. To prevent this: size WAL retention for worst-case lag, monitor the distance between follower and primary positions, and alert before WAL expires.
Strong Answer:
  • CRDTs are data structures where concurrent updates on different replicas can always be merged automatically. The merge operation is commutative, associative, and idempotent — updates arrive in any order, apply multiple times, and the result is always the same.
  • A G-Counter is the simplest example: each replica maintains its own counter, the global count is the sum. Incrementing is local. Merging is element-wise max. A PN-Counter extends this with a separate decrement counter. An OR-Set supports add and remove by tagging each add with a unique ID.
  • Limitations: (1) CRDTs can only express monotonically growing information, so operations like “set to exactly 5” require careful encoding with metadata overhead. (2) Metadata grows over time — tombstones, per-replica counters — and garbage collecting it requires the coordination CRDTs are designed to avoid. (3) CRDTs cannot express arbitrary invariants. A CRDT bank account cannot prevent negative balances because enforcing that constraint requires knowing global state.
Follow-up: How does Riak handle CRDT tombstone garbage collection in practice?Riak uses a tombstone timeout — after a configurable period, tombstones are eligible for garbage collection. The danger is if a replica is offline longer than the timeout, it might re-introduce a deleted item when it comes back online (tombstone resurrection). The mitigation is to set the timeout longer than maximum expected replica downtime and run anti-entropy (Merkle tree comparison) frequently enough to catch and repair inconsistencies before they reach users.
Strong Answer:
  • With strict quorum, clients can still read and write. One node is isolated, leaving 2 reachable. W=2 is satisfied by both available nodes. R=2 is satisfied by both available nodes. The system remains operational.
  • The isolated node may serve requests from clients on its side of the partition. With strict quorums, those clients cannot form a quorum (only 1 node available), so their operations fail — this is the safe behavior.
  • After the partition heals, the isolated node catches up via read repair (inconsistencies detected during reads) and anti-entropy repair (Merkle tree comparison). If neither runs promptly, the node may serve stale data.
Follow-up: How would you detect that a Cassandra node has stale data after a partition heals?Run a full anti-entropy repair immediately after partition healing (nodetool repair). Monitor ReadRepairAttempted counters — a spike after healing indicates widespread staleness. Deploy a synthetic monitoring job that writes a known value, then reads from each individual replica using CL=ONE with explicit routing and compares. If any replica returns stale data, trigger an alert. The goal is to detect staleness before real users encounter it.