Raft Consensus Visualized
Every animation shows the same scene: N servers, one append-only log, and a term counter ticking. We follow a leader election frame by frame — why the randomized timeout breaks ties, why a stale candidate loses, and what the winning server does with its log before it accepts new writes.
Topics covered:
- The three roles and the term clock
- How a heartbeat timeout triggers an election
- Frame-by-frame leader election: votes, quorums, and split votes
- The election restriction: why the new leader's log must be current
- Log replication: how entries become committed and what a majority means
- Partition behavior: why two leaders can't both commit
- How etcd and CockroachDB render this on a real cluster
Related articles
Consensus Algorithms Aren't About Agreement
Raft, leader election, and split-brain — what consensus actually solves and what it doesn't.
Raft Consensus and the Log
Raft leader election, log replication, safety guarantees — the consensus algorithm designed for understandability.
Leader Election and Heartbeats
How heartbeats, term numbers, leases, and fencing tokens stop a distributed cluster from running two leaders at once.
More in Distributed Systems
Raft Consensus Explained
Leader election, log replication, and safety — the consensus algorithm that powers etcd, CockroachDB, and TiKV, explained from first principles.
WatchData Partitioning Explained
Range, hash, and hybrid partitioning — where each key's row actually lives, how partitions are balanced, and what happens when one partition becomes a hotspot.
DetailsDistributed Locks and Leases
What a lock actually protects in a distributed system — lease-based locks with expiry, fencing tokens against stale holders, and why client crashes are the hard case.
DetailsGossip Protocols
Membership, failure detection, and state propagation — how nodes exchange information through random peer conversations so the whole cluster converges without a coordinator.
DetailsChaos Engineering Basics
Fault injection with a controlled blast radius — killing nodes, dropping packets, and inducing latency to verify that recovery paths actually work, not just that they exist.
DetailsDistributed Tracing Explained
Trace context propagation, span trees, and sampling — how one request's work is reconstructed across services using trace IDs, span IDs, and parent-child relationships.
DetailsLeader Election in Practice
How real systems elect leaders — ZooKeeper's Zab, etcd's Raft, and lease-based locks — plus fencing tokens and why a stale leader must be fenced before it writes.
DetailsConsistent Hashing Visualized
Watch keys land on a hash ring — what consistent hashing actually does when a cache node dies, and why ring position and virtual nodes determine how many keys move.
DetailsDistributed Transactions Explained
Two-phase commit, prepare and commit phases, and the coordinator failure window — how databases coordinate atomic writes across machines and what happens when a participant crashes.
DetailsDepth, delivered weekly
One technical dispatch a week — articles and episode notes before they go public.
One technical dispatch per week. No noise.