Leader
The leader receives writes, appends log entries, and asks followers to replicate them.
Basics
Start here for roles, terms, majority math, log matching, and the practical reason Raft is easier to explain than Paxos.
Core Model
The leader receives writes, appends log entries, and asks followers to replicate them.
Followers accept valid leader messages and start elections only when heartbeats disappear.
Terms are logical epochs. Seeing a higher term forces stale leaders and candidates to step down.
Why Raft Matters
The original guide explained why Raft matters before diving into edge cases. That context belongs here: Raft is not just an academic algorithm, it is the mental model behind many reliable control planes, databases, schedulers, and replicated metadata systems.
Formulas
quorum = floor(N / 2) + 1
A majority must agree before the cluster can safely elect or commit.
f = floor((N - 1) / 2)
A 5-node cluster can tolerate 2 failed voting members and still keep quorum.
N = 2f + 1
To tolerate f failures, use at least 2f + 1 voting members.
Raft is designed to be equivalent to Paxos in fault tolerance and performance goals, but decomposes consensus into leader election, log replication, and safety so teams can understand and implement it more easily.
Membership changes are handled safely by temporarily requiring overlapping majorities from old and new configurations.
Real implementations compact old log prefixes into snapshots so followers can catch up without replaying history forever.
The key properties are election safety, leader append-only, log matching, leader completeness, and state machine safety.