About this course
A build-it-yourself course: no paper-memorizing, no passive animations. In every
session an AI mentor walks you through writing a deterministic simulated network in
pure Python — injecting delay, loss and partitions with your own hands — then watching
the nodes YOU wrote elect a leader, replicate logs, and hold consensus through disasters.
It follows the topic skeleton of the Raft paper and MIT 6.824 — leader election, log
replication, safety, a replicated KV state machine, crash recovery & snapshots,
membership changes — with every session rewritten as original hands-on teaching for the
online sandbox: formulas typeset, timelines drawn, partition boundaries draggable.
And everything replays deterministically: same seed, same split-brain, frame by frame —
better than a real network for truly seeing consensus. By the end you'll know it in
your bones: your multi-agent system IS a distributed system.
What you'll learn
- Hand-write a deterministic discrete-event simulated network with injectable delay, loss and partitions
- Implement the follower/candidate/leader state machine, randomized timeouts and majority elections
- Implement log replication, conflict backtracking and the current-term-only commit rule
- Replay the paper's Figure 8 scenario and storm-test four safety invariants across hundreds of seeds
- Build a Raft-backed replicated KV state machine handling client retries, idempotency and consistent reads
- Implement crash recovery and log snapshots, and explain why membership changes go one server at a time
Syllabus
1The First Step of Consensus: Leader Election3 sessions
2Log Replication: Making the Cluster Remember as One3 sessions
3Safety: Committed Entries Are Never Lost3 sessions
4From Log to App: a Replicated KV Store0 sessions
Sessions are on the way.
5Crashes, Recovery & Snapshots0 sessions
Sessions are on the way.
6To Production: Membership Changes & Engineering0 sessions
Sessions are on the way.
Same series · 人工智能全透析
AI, End to End
Synthesized from the best material across the web — rebuild the core of AI from scratch, the efficient way.