Consensus & Distributed Transactions
Explain how replicated logs, leader election and atomic commit keep distributed state in agreement, use a coordination service safely, and decide when a design should avoid cross-partition transactions.
4 objectives 6 steps about 140 min
Check what you know
The lessons are coming later. The knowledge check is ready now.
This skill page is a public outline. Its lessons and knowledge check appear here as subject-matter experts approve them.
Learning objectives
- Trace Raft leader election and log replication through a leader crash and a network partition, and explain which entries are committed and why majority quorums prevent two leaders from committing conflicting entries.
- Use a coordination service (for example etcd or ZooKeeper) for leader election, membership and configuration, with session leases and fencing tokens so that a paused former leader cannot corrupt shared state.
- Explain two-phase commit across partitions, including the in-doubt window when the coordinator fails, and compare it with consensus-replicated participants and with designs that keep each transaction within one partition.
- Size and place a consensus group (three versus five members, across zones or regions) for a stated failure budget, and estimate the commit latency and write throughput limits it imposes.
Lesson plan
6 steps, about 140 min · 0 of 5 lessons available so far
- Raft step by step: terms, elections and the replicated log Concept · 25 min · coming later
- Breaking a three-node etcd cluster on purpose Lab · 30 min · coming later
- A leader-elected job scheduler with leases and fencing tokens Worked example · 25 min · coming later
- Atomic commit across partitions: two-phase commit and its alternatives Concept · 25 min · coming later
- Sizing and placing a consensus group Concept · 15 min · coming later
- Consensus and transactions check Knowledge check · 8 questions
Practise it
Run a three-node etcd cluster in containers, kill the leader and then partition one member while a client writes, and record election time, commit latency and which writes were acknowledged; then build a leader-elected job runner that writes through a store checking fencing tokens, and show that a write from a paused former leader is rejected.
References
Hard prerequisites
Unlocks
On these roadmaps
Progress and evidence for this skill are shared across all of them.