IN THIS BREAKDOWN · 10 SECTIONS
You can read 26% of this breakdown.
The paper in one minute
Replicated databases and coordination services keep several servers in agreement by replicating a log of operations: every server applies the same operations in the same order. Distributed consensus decides that order even when servers crash and messages are delayed. Two algorithms dominate production. Paxos, from Lamport, is famously subtle and is really a family described differently from paper to paper. Raft, from Ongaro and Ousterhout in 2014, was designed to be easier to understand and claimed to be as efficient.
Howard and Mortier rewrite Paxos, in the multi-decree form used in practice, using Raft's structure. Both algorithms then look the same in most respects. Servers are followers, candidates or leaders. Each server tracks a term number that only increases. A leader appends client operations to its log and sends them to followers with AppendEntries; once a majority acknowledges an entry, it is committed. When followers stop hearing from the leader, one becomes a candidate and asks for votes with RequestVote.
The differences are all in leader election. In Paxos, terms are divided among servers (server s may only run in terms where term mod n equals s), and any candidate can win; the votes it receives include the voters' log entries after its commit index, and the new leader adopts the entry with the highest term at each index, re-stamped with its own term. In Raft, any follower can run in any term, each server votes once per term, and a vote is granted only if the candidate's log is at least as up to date; no entries move during election, but a new leader cannot treat old-term entries as committed until it commits one from its own term.
The authors judge Raft slightly, not significantly, more understandable, and Raft's election surprisingly efficient because it sends no log entries. They expect Raft elections to be slower and more variable, because simultaneous candidates in the same term can split the vote, which Raft handles with randomized timeouts. Their conclusion: much of Raft's understandability comes from its clear presentation rather than from the algorithm.
Research notes: the problem, approach and results
differences, all in leader election: who may run in a term, who may win, and which term re-replicated entries carry (Section 6)
log entries carried in vote replies under Raft vs Paxos when replaying the paper's Figure 2 (our run)
average split-vote rounds per Raft election in our simulation when election timeouts vary by only 5 ms
Production systems that need strongly consistent replication rely on Paxos or Raft. Raft was introduced as more understandable and as efficient as Paxos, but Paxos is described in many inconsistent ways, so the two are hard to compare fairly.
Write a simplified Paxos (multi-decree, as used in practice) in Raft's terminology and structure: the same server states, terms, RequestVote and AppendEntries RPCs, then compare the two line by line, including safety proofs.
The algorithms differ only in leader election. Paxos assigns terms to servers and lets any candidate win, then copies missing entries into the new leader; Raft lets anyone run but only an up-to-date log can win, so no entries move during election. Understandability differs little; Raft's election is surprisingly lightweight.
Why it matters to an FDE
Your customers' infrastructure runs on these. etcd (and so Kubernetes), Consul and CockroachDB use Raft; Chubby, Megastore, Borg, Azure Data Lake Store and WeChat's PaxosStore use Paxos, per the paper's citations. When a cluster misbehaves after a node failure, you are watching leader election.
A leader failure is a pause. Writes stop until a new leader is elected and has caught up. Our simulation puts that at roughly 160 to 190 ms with sensible timeouts and seconds when timeouts are configured too tightly. Know the election timeouts in the systems you deploy and how clients retry during elections.
Timeout tuning is a real lever. Raft relies on randomized timeouts to avoid split votes. In our model, a 5 ms spread caused 34 split rounds per election on average; a 50 to 150 ms spread fixed it. If a customer sees repeated elections under load, check timeouts, clock pauses (such as garbage collection) and network latency against them.
Use a proven implementation. The paper's point that the algorithms are subtle in small details, such as Raft's rule about committing old-term entries, is the reason not to build your own. Use etcd, ZooKeeper or a database's built-in replication.
Majorities set the failure budget. Both need a majority: three servers tolerate one failure, five tolerate two. Placing all of a majority in one zone defeats the point.
Understand the mechanism. Try it on a real problem.
Unlock this breakdown and 290 more papers.
Premium opens every paper in full, plus every answer, concept, course and guide on the site. One payment for six months of access.
6 months · One payment · No auto-renewal
- ◇1 architecture diagram
- </>1 runnable code experiment
- ▦2 results tables
- ?5 interview questions with answers
- 03Key takeaways
The shared structure, the three election differences, safety, understandability and efficiency
Free account - 04How it works
Normal replication, Paxos election step by step, Raft election, the safety argument and terminology
Premium - 05The numbers that matter
Figure 2 replayed, the summary table, and our election simulation
Premium - 06Try it yourself
Replay Figure 2 under both rules, then simulate elections with different timeout ranges
Premium - 07Where it breaks
Simplified algorithms, no measurements, judgment-based understandability, and omitted features
Premium - 08Using it on a deployment
Size clusters, place replicas, set timeouts, and design clients for elections
Premium - 09Interview angles
Five questions this paper prepares you for, with answer hints
Premium - 10Read next
Where to go from here on this site
Premium
