Diego Ongaro and John Ousterhout built Raft around an unusual primary constraint: make distributed consensus easy to understand, and make it obvious why every rule works. After spending nearly a year struggling through Leslie Lamport’s Paxos papers and finding at NSDI 2012 that few seasoned systems researchers felt comfortable with the protocol, they designed a new algorithm for replicated state machines from the ground up.

Today, Raft sits inside etcd (backing Kubernetes cluster state), Consul, CockroachDB, TiKV, and YugabyteDB. Just as importantly, its design methodology directly addressed a warning the Chubby implementers had published years earlier: production systems diverged so far from single-decree Paxos sketches that the formal proofs no longer covered the running code.

  • One-way log flow: A single elected leader accepts all client commands and pushes AppendEntries RPCs outward; core consensus and membership changes need only 4 message types (two RPC requests and replies), versus 10 in Viewstamped Replication and ZooKeeper.
  • Two understandability levers: Problem decomposition splits election, replication, safety, and reconfiguration into semi-independent pieces, while state-space reduction forbids log holes and limits how logs can diverge.
  • Randomized timers break split votes fast: With zero jitter on a 150ms timeout, split votes stalled leader election past 10 seconds; adding just 5ms of randomness cut median downtime to 287ms, and a 150 to 300ms window converged within 513ms across all 1,000 trials.
  • Measured comprehension advantage: In a 43-student crossover study at Stanford and UC Berkeley, 33 students scored higher on Raft than Paxos (mean 25.7 vs. 20.8 out of 60; linear regression estimates a 12.5-point edge controlling for prior Paxos exposure).
How Raft decomposes replicated-log consensus
1. Leader election
Consecutive terms act as logical clocks; followers become candidates after a randomized timeout.
RequestVote RPC
At most one vote per server per term, enforcing Election Safety (at most one leader per term).
2. Log replication
The leader never overwrites its own log (Leader Append-Only) and forces followers to match.
AppendEntries RPC
Checks prevLogIndex and prevLogTerm inductively to preserve the Log Matching Property and doubles as heartbeats.
3. Safety & lifecycle
Election restrictions plus current-term commitment establish Leader Completeness and State Machine Safety.
Joint consensus & InstallSnapshot
Overlapping Cold,new quorums reconfigure live clusters safely; chunked snapshots compact bounded logs.

Architecture from Ongaro and Ousterhout (2014), Figures 2, 3, and 4.

Why Paxos left a gap, and how strong leadership closes it

Ongaro and Ousterhout argue in Section 3 that Paxos suffers from two structural flaws, both traceable to starting from single-decree agreement as described in The Part-Time Parliament. First, single-decree Paxos splits into two intertwined phases that lack independent intuition, and composing multiple decrees into a log adds extra rules for filling gaps and reordering proposals. Second, Lamport sketched multi-Paxos without pinning down a canonical log algorithm, leaving builders to invent their own leader election, log repair, and reconfiguration details.

Raft flips the starting point. Rather than letting any peer propose entries for any log slot and later stitching the slots together, Raft makes leader election the first step of consensus. Time is divided into monotonically increasing terms that act as logical clocks. Every server starts as a passive follower; if an election timeout passes without an AppendEntries heartbeat, it increments currentTerm, becomes a candidate, votes for itself, and broadcasts RequestVote. Whenever any server sees a higher term in an RPC request or response, it immediately updates currentTerm and reverts to follower.

Strong leadership shrinks the state space dramatically. Logs grow sequentially with no holes, leaders only append (Leader Append-Only), and entries flow strictly from leader to followers. Where Viewstamped Replication and ZooKeeper allow entries to move back into a newly elected leader during recovery, Raft guarantees every committed entry is already on the new leader at election time.

Even so, the authors hit dead ends when choosing mechanisms inside that framework. Several intuitive designs failed under edge-case analysis and had to be replaced.

Three naive consensus choices that break in Raft
Ranked elections

Deferring to higher-ranked candidates created timing races where lower-ranked servers timed out too early and reset progress; randomized timeouts replaced ranking.

Fixed 150ms timers

With zero randomness, synchronized servers repeated split votes for over 10s; a 150 to 300ms range elected a leader in at most 513ms across 1,000 trials.

Direct config swap

Switching directly from 3 to 5 servers allows two disjoint majorities (one old, one new) to elect two leaders in the same term.

Design alternatives and measurements from Ongaro and Ousterhout (2014), Sections 5.2, 6, and 9.3.

Log matching, the election restriction, and the Figure 8 trap

During normal operation, the leader appends a client command to its log, sends parallel AppendEntries RPCs, and marks the entry committed once a majority of servers store it. In the common case, committing takes one round-trip to half the cluster, and a single slow follower does not stall the majority.

Crashes leave follower logs messy: missing committed entries, holding extra uncommitted entries from crashed leaders, or both across multiple terms (Figure 7). Raft repairs every divergence with one rule. Each AppendEntries call carries prevLogIndex and prevLogTerm for the entry right before the new batch. If a follower lacks an entry matching both index and term, it rejects the RPC; the leader decrements that follower’s nextIndex and retries until they find a matching prefix, then overwrites any conflicting follower tail. By induction from empty logs, this enforces the Log Matching Property: if two logs share an index and term, their entire prefixes up through that index are identical.

Because logs never flow from followers back to a new leader, Raft must prevent any server missing a committed entry from winning an election. That is the job of the election restriction in Section 5.4.1. A voter denies RequestVote if its own log is more up-to-date than the candidate’s, comparing the last log entry’s term first and breaking ties by log length. Since both a committing majority and a voting majority must intersect in at least one server, any winning candidate is guaranteed to hold every entry committed in prior terms (Leader Completeness).

Yet that rule creates a famous subtlety shown in Figure 8 of the paper. Suppose leader S1 writes a term-2 entry at index 2 on two of five servers and crashes. S5 wins term 3 with votes from S3, S4, and itself, then writes a term-3 entry at index 2 and crashes. Now S1 restarts, wins term 4, and replicates its old term-2 entry to S3. That term-2 entry now sits on a majority (S1, S2, S3). Can S1 mark it committed by counting replicas? No. If S1 crashes before writing a term-4 entry, S5 still has last log term 3 (higher than S2 and S3’s last log term 2), so S5 can win term 5 from S2, S3, and S4 and overwrite the term-2 entry across the whole cluster. Raft therefore forbids committing previous-term entries by counting replicas: a leader may only commit entries from its current term by majority count, which then commits all earlier log entries indirectly via Log Matching.

Like Paxos, Raft guarantees safety under arbitrary packet loss, reordering, and delays, while liveness depends on the timing inequality broadcastTime << electionTimeout << MTBF (Section 5.6). With persistent disk writes making broadcastTime 0.5 to 20ms, an election timeout of 150 to 300ms leaves ample margin for heartbeats while keeping crash recovery brief, respecting FLP impossibility by isolating timing assumptions strictly to progress rather than correctness.

Trace five corner cases that break naive consensus

A consensus design looks clean on the happy path and fails in the transitions: tied elections, dirty follower tails, partial commits across crashes, live cluster resizing, and linearizable client reads. Step through the five scenarios below to compare what breaks in a naive design, how Raft handles it, and what the paper’s evidence shows.

Five failure modes Raft's rules are built to prevent

Select a corner case (or use Left and Right arrow keys) to inspect the failure scenario, Raft's exact rule, and the paper's evidence.

Tied elections stall deterministic timers

Leader election

If followers time out in lockstep after a leader crash, each votes for itself and no candidate reaches a majority.

Why naive fix breaks
Deterministic timeouts (150-150ms) keep servers colliding term after term; ranked-candidate tie-breakers triggered live-lock races when higher-ranked nodes crashed.
Raft's mechanism
Each server draws an independent random election timeout (150 to 300ms) both before starting an election and after a split vote.
Measured evidence
On a 5-server cluster with 15ms broadcast time (Figure 16), 150-150ms took over 10s; 150-155ms cut median downtime to 287ms; 150-300ms capped worst-case across 1,000 trials at 513ms.
Practical tuning
12-24ms timers averaged 35ms recovery (152ms max) but risked violating broadcastTime << electionTimeout; 150-300ms avoided spurious elections.

Source: Ongaro and Ousterhout (2014), Sections 5 through 9.

If you prefer the short version without clicking through the tabs, here are the five mechanisms that keep Raft safe across edge cases:

  • Split votes: randomized election timeouts (150–300ms) break symmetry in a single round, cutting recovery from over 10 seconds to under 513ms in 1,000-trial runs.
  • Divergent logs: AppendEntries enforces an inductive prevLogIndex/prevLogTerm prefix check so leaders overwrite conflicting follower tails without ever editing their own log.
  • Old-term commits: leaders commit only current-term entries by majority count (Figure 8), avoiding a subtle race where a higher-term rival overwrites an earlier-term majority.
  • Cluster resizing: two-phase joint consensus (Cold,new then Cnew) overlaps old and new quorums, paired with non-voting catch-up and minimum-timeout vote filtering for removed nodes.
  • Linearizable clients: a term-start no-op, majority heartbeat read check, and per-client serial numbers guarantee exact-once linearizable semantics without logging reads.

Caveats, formal proofs, and where Raft stops

Three caveats keep Raft’s claims in sharp engineering perspective.

First, the understandability user study is encouraging but not definitive. Across 43 upper-level and graduate students at Stanford and UC Berkeley, Raft beat Paxos by 4.9 raw points (25.7 vs. 20.8 out of 60, 95% confidence interval at least +2.5 points) and 33 of 41 respondents rated Raft easier to implement and explain. Yet 15 students already knew Paxos, the Paxos lecture was 14% longer, self-reported difficulty ratings could reflect awareness of the authors’ hypothesis, and the authors noticed an unexplained 6.3-point drop on Raft for students who took the Paxos quiz first.

Second, simplicity lives in the core protocol, not in every production extension. The core 400-line TLA+ specification was mechanically checked for Log Completeness in TLAPS (relying on unverified type-safety invariants) while State Machine Safety received a 3,500-word informal proof. Once a real system adds InstallSnapshot chunking, Linux fork() copy-on-write snapshots, client serial-number deduplication, non-voting learners, and minimum-timeout vote guards against deposed nodes, the implementation grows substantially beyond the crisp summary in Figure 2. Their own RAMCloud C++ implementation totaled roughly 2,000 lines before full ecosystem tooling.

Third, strong leadership trades away leaderless WAN performance. As Ongaro and Ousterhout explicitly note in Section 10, protocols like EPaxos allow any replica to commit commuting operations in a single wide-area round-trip, avoiding the bottleneck of funneling every write and linearizable read check through one leader. Likewise, in production clusters, Ongaro’s later work supplemented joint consensus with single-server membership changes to simplify operational tooling, and real deployments routinely add a pre-vote phase to keep partitioned nodes from bumping cluster terms on reconnect.

For infrastructure engineers, the lesson from Raft is less about winning a philosophical war against Paxos and more about choosing invariants you can verify under pressure. Every replicated log eventually needs leader leases or read heartbeats, membership transitions, snapshotting, and client deduplication; Raft’s lasting contribution is assembling those pieces around one-way log flow so an engineer on call at 3 a.m. can still trace which node is allowed to lead and why.