Interactive course · 5 lessons · ~90 min

Database replication,
one COMMIT, many copies

Every replication system on Earth is one of four architectures — single-leader, multi-leader, leaderless, or consensus-based — plus a set of mechanics for what actually travels between nodes. One lesson per architecture, each with live clusters you can operate: commit writes, crash leaders, partition networks, manufacture conflicts, and count exactly what survives.

01

Single-leader: the replication workhorse

One primary, N followers, and the sync/async decision that defines everything. Crash a primary mid-commit in three modes, run a full failover drill, and create a split-brain with your own hands.

sync / semi-sync / asyncreplication lagfailoversplit-brain
02

Multi-leader: writes everywhere, conflicts included

Leaders in every region — great latency, guaranteed conflicts. Break replication topologies by killing hubs, then resolve the same concurrent write three different ways: LWW, siblings, and a CRDT that makes conflict impossible.

topologiesconflict detectionLWW vs siblingsCRDTs
03

Leaderless: no boss, just arithmetic

Dynamo-style quorums where W + R > N is the whole law. Tune the sliders until stale reads become impossible, survive a node failure with sloppy quorums and hinted handoff, and watch read repair heal the cluster.

W/R quorumssloppy quorumhinted handoffread repair
04

Consensus: replication that elects its own leader

Raft, playable. Run leader elections with randomized timeouts, replicate log entries to a majority, then partition the network and watch the minority-side leader discover it can no longer commit — the proof that split-brain is impossible.

leader electionterms & votesmajority commitpartitions
05

Mechanics: what actually travels the wire

Statement vs WAL vs logical replication — replay NOW() on a replica and watch the data diverge. Then operate an Aurora-style 6-copy storage quorum through AZ failures, and map every managed service to its architecture.

statement / WAL / logicalCDCshared storagecloud cheat sheet
write / replication traffic committed / healthy lost / failed / conflicted

Examples lean on PostgreSQL, MySQL, Cassandra, DynamoDB, and etcd — but the four architectures are universal. Two framing facts to carry throughout: replication is not backup (replicas faithfully copy your mistakes within milliseconds), and replication is not sharding (sharding splits data, replication copies it; real systems compose both).