In Search of an Understandable Consensus Algorithm
Raft separates consensus into leader election, log replication, and safety, with a strong leader, terms, and randomized election timeouts making each part separately explainable. The parts connect through an election restriction and a commit rule that keep committed log entries safe across leadership changes.
Reading guide
Raft's main design decision is to split consensus into subproblems that can be explained one at a time: leader election, log replication, and safety. Membership changes come after those core pieces; log compaction and client interaction are left to the extended version. The answer starts with terms.
Section 5.1 introduces server states and terms. Every server is a follower, candidate, or leader. Terms are consecutive integers, and each term has at most one leader. RPCs carry the sender's term; a server that sees a higher term adopts it and returns to follower.
Section 5.2 covers leader election. Followers wait for heartbeats; when a randomized election timeout expires, a follower becomes a candidate, increments the term, votes for itself, and sends RequestVote RPCs carrying its last log index and last log term. A majority wins. Randomized timeouts make split votes rare and quick to resolve. The winner sends empty AppendEntries RPCs as heartbeats.
on election timeout:
term += 1
state = candidate
vote for self
send RequestVote(last_log_index, last_log_term) to all
Section 5.3 covers log replication. A client command goes to the leader, which appends it to its log and sends AppendEntries to followers. Once a majority has stored the entry, it is committed; the leader applies it to its state machine and returns the result. The log matching property says that if two logs contain an entry with the same index and term, the logs are identical through that index.
Section 5.4 covers safety, where the pieces meet. The election restriction requires a candidate's log to be at least as up to date as the logs of a majority of servers, so a winner already holds every committed entry. The commit rule says a leader may advance the commit index only for entries from its current term, and only after a majority has stored them. Figure 2 condenses the rules into a checklist worth reading beside the prose.
| Subproblem | Question it answers | Main mechanism |
|---|---|---|
| Leader election | Who may append new entries now? | Terms, randomized timeouts, majority vote |
| Log replication | How do followers receive the leader's entries? | AppendEntries, consistency check, commit index |
| Safety | Which entries may be applied? | Election restriction, current-term commit rule |
A five-server example shows how they connect. Suppose the leader for term 3 has replicated an entry at index 7 to three servers and then crashes. A follower with a shorter log can still start an election for term 4, but servers with the longer log deny its vote because its last entry is older. A candidate holding index 7 wins and continues from the committed prefix. No committed entry is lost, and no conflicting entry at index 7 can later commit.
For a different coordination problem, see the MapReduce reading guide, where failures are hidden behind task retries.
Evidence and limits
The paper evaluates understandability, correctness, and performance. For understandability, it reports a study with 43 upper-level undergraduate and graduate students at Stanford University and U.C. Berkeley; participants learned both algorithms from video lectures and took both quizzes, scoring higher on average on the Raft quiz and usually rating Raft easier to explain and implement. For correctness, the authors give a TLA+ specification and formal proof of log completeness. For performance, they argue that normal operation uses the minimal one round trip to a majority, matching Paxos, and measure how quickly leader election converges under different timeouts.
The population is narrow. The understandability evidence comes from a short classroom exercise, not from experienced engineers maintaining a system for years. The performance evidence is a message-count argument plus election measurements, not a throughput comparison. Raft's equivalence to Paxos concerns log safety, not identical behavior or cost everywhere.
Two boundaries matter. Raft assumes fail-stop crashes and a majority of correct servers; it does not tolerate Byzantine faults. And the three-part picture in Sections 5.2 to 5.4 covers the core algorithm, while membership changes through joint consensus (Section 6) add rules of their own. Log compaction and client interaction are omitted from the proceedings version, so a production system must implement and test them.
Cite the paper
Diego Ongaro, John Ousterhout. "In Search of an Understandable Consensus Algorithm." USENIX ATC 2014.
BibTeX
@inproceedings{ongaro2014raft,
author = {Diego Ongaro and John Ousterhout},
title = {{In Search of an Understandable Consensus Algorithm}},
booktitle = {Proceedings of the 2014 USENIX Annual Technical Conference (USENIX ATC 14)},
year = {2014},
pages = {305--319},
publisher = {USENIX Association}
}
Link to this reading guide
https://www.fieldnotely.xyz/papers/distributed-systems/raft/
Sources
Revision history
- Published
- Updated
- — Initial publication.