These are private study notes on one question: how do several computers that can crash and lose messages agree on the same sequence of events? We start with broadcast and the orders in which messages can be delivered (FIFO, causal, total), see why replicating state needs total order, show that total order broadcast is exactly the consensus problem, and then study the two classic consensus algorithms, Raft and Paxos, with full safety proofs.
Each module follows the CS 395T lectures (the lecture numbers are given below) and Kleppmann’s Cambridge notes, and has interactive simulators: run the lecture scenarios step by step, or crash nodes and cut the network yourself and watch the safety invariants. Every module has a problem set with collapsible solutions; a printed edition of the same notes exists as a LaTeX book (simulators replaced by static figures).
Study material only
Written for private study. They are not a reference sheet and are not meant to be submitted.
Part I — Ordering messages
- 01 Broadcast and Delivery Order Receive vs deliver; reliable, FIFO, causal, total and FIFO-total order; the hierarchy (lecture 04.03)
- 02 Broadcast Algorithms Eager reliable broadcast, gossip, FIFO and causal delivery, total order by sequencer or Lamport clocks (04.04-04.05)
Part II — Replication and consensus
- 03 Replication, Idempotence and Quorums Retries, tombstones, last-writer-wins, r + w > n, read repair (05.01-05.03)
- 04 State Machine Replication and Consensus SMR, consensus = total order broadcast, FLP, partial synchrony, safety vs liveness (06.01-06.02)
- 05 Leader Election and Terms Terms, one vote per term, majorities, election safety, stale leaders (06.03)
Part III — Raft
- 06 Raft I: Elections and Log Replication Figure 2 state, RequestVote, AppendEntries, the consistency check, commit (07.01-08.02)
- 07 Raft II: Safety Proofs and the Figure 8 Trap Log Matching, Leader Completeness, State Machine Safety; Figures 7 and 8 (08.03-08.04)
Part IV — Paxos
- 08 Single-Decree Paxos Proposers, acceptors, learners; prepare/promise, accept; why a chosen value is stable (09.01-09.02)
- 09 Multi-Paxos: Paxos Made Moderately Complex Replicas, leaders, scouts, commanders, acceptors; slots and the invariants (09.03-10.03)
- 10 Raft and Paxos Side by Side Terms vs ballots, election vs phase 1, how each one builds total order broadcast
Appendix
- A Under the Hood: RPC, TCP and UDP Why RPC comes first; how broadcast, Raft and Paxos messages run over real transports (01.01-01.02)
- B The Production Toolchain gRPC, Raft libraries, etcd, ZooKeeper, Kafka, leases and fencing, Jepsen: which theory each tool implements
Problem sets
One problem set per module: all problem sets.