Databases · Cluster

Replication and Sharding

Topology, failover, and consistency.

  1. 01 The Replication Log as the Ordering Unit in Single-Leader Replication Why single-leader replication ships a serialised change log rather than rows, how log positions act as a logical clock, and where the ordering guarantee stops. foundational · Jun 23, 2023
  2. 02 Statement Versus Row-Based Logs: Determinism and the Cost of Replay How statement replication breaks on nondeterministic SQL, what row images cost in bytes, and which failures each format survives. foundational · Feb 22, 2026
  3. 03 Where the Commit Returns: Synchronous and Asynchronous Replication Boundaries What a commit acknowledgement actually guarantees at each replication mode, how quorum commits move the durability boundary, and why a synchronous replica becomes a latency dependency. foundational · Oct 9, 2025
  4. 04 Leader Failover: Detection Windows, Fencing, and Split-Brain Avoidance How a failed leader is detected, why a timeout cannot distinguish a dead leader from a slow one, and how fencing tokens stop two leaders from accepting writes. intermediate · Oct 21, 2025
  5. 05 Quorum Intersection: Why R + W > N Is Necessary but Not Sufficient What the quorum inequalities actually prove about read-write overlap, why they say nothing about the newest value, and where per-key quorums break down across a cluster. intermediate · Oct 23, 2026
  6. 06 Hash and Range Partitioning: Choosing What the Shard Key Preserves Why range partitioning keeps ordered scans and concentrates writes, why hashing spreads load and destroys locality, and how consistent hashing changes only the movement cost. intermediate · Jun 17, 2026
  7. 07 Online Resharding: Moving a Range Without Stopping Writes How a range is migrated while it is being written to, why the cutover is a metadata transaction, and what the dual-write window costs in correctness. intermediate · Jul 1, 2025
  8. 08 Two-Phase Commit Across Shards: The Coordinator, the Veto, and the In-Doubt Window How prepare and commit phases make a cross-shard transaction atomic, why a coordinator failure leaves participants unable to decide, and what presumed abort changes. advanced · May 26, 2026
  9. 09 Shard Routing and Ownership Metadata: The Directory That Must Not Disagree How clients find the shard for a key, what happens when the routing table is stale, and why ownership epochs turn a racy handoff into a detectable error. advanced · Jul 7, 2026
  10. 10 Anti-Entropy Repair: Merkle Trees, Read Repair, and the Cost of Finding Divergence How replicas that missed writes discover what they missed, why a Merkle tree narrows comparison to a logarithmic path, and what repair cannot fix. advanced · Jun 2, 2025