[Paper Review] Paxos vs Raft
This paper compares Paxos and Raft, two dominant consensus algorithms in distributed systems, by re-expressing a simplified Paxos using Raft's terminology and abstractions. It finds that the two algorithms differ only in leader election: Raft's log-based voting is more efficient than Paxos' log-replication during elections, and Raft's superior understandability stems more from its presentation than algorithmic design.
Distributed consensus is a fundamental primitive for constructing fault-tolerant, strongly-consistent distributed systems. Though many distributed consensus algorithms have been proposed, just two dominate production systems: Paxos, the traditional, famously subtle, algorithm; and Raft, a more recent algorithm positioned as a more understandable alternative to Paxos. In this paper, we consider the question of which algorithm, Paxos or Raft, is the better solution to distributed consensus? We analyse both to determine exactly how they differ by describing a simplified Paxos algorithm using Raft's terminology and pragmatic abstractions. We find that both Paxos and Raft take a very similar approach to distributed consensus, differing only in their approach to leader election. Most notably, Raft only allows servers with up-to-date logs to become leaders, whereas Paxos allows any server to be leader provided it then updates its log to ensure it is up-to-date. Raft's approach is surprisingly efficient given its simplicity as, unlike Paxos, it does not require log entries to be exchanged during leader election. We surmise that much of the understandability of Raft comes from the paper's clear presentation rather than being fundamental to the underlying algorithm being presented.
Motivation & Objective
- To resolve the long-standing debate on whether Raft is fundamentally superior to Paxos for distributed consensus.
- To identify the precise technical differences between Paxos and Raft, particularly in leader election mechanisms.
- To evaluate whether Raft's claimed advantages in understandability and efficiency are algorithmically grounded or presentation-driven.
- To enable cross-pollination of optimizations between Paxos and Raft by clarifying their algorithmic similarities and differences.
Proposed method
- Reformulate a simplified, modern variant of Paxos (MultiPaxos) using Raft's terminology and abstractions for direct comparison.
- Analyze leader election in both algorithms: Paxos uses term partitioning across servers, while Raft uses log-uptodate checks.
- Compare the communication overhead during leader election: Paxos requires log entry exchange in RequestVote responses, whereas Raft avoids this via log-based voting.
- Examine log replication semantics: Paxos re-terms previous log entries under the new leader’s term, while Raft preserves original terms.
- Evaluate safety and liveness properties under the same assumptions (asynchronous, reliable messaging, no clock sync).
- Use formal comparison tables (e.g., Table 1) to contrast how each algorithm ensures leader uniqueness, log completeness, and safe commitment.
Experimental results
Research questions
- RQ1What are the fundamental algorithmic differences between Paxos and Raft, beyond their presentation?
- RQ2How does leader election differ in Paxos versus Raft, and what is the performance impact of these differences?
- RQ3To what extent is Raft’s claimed understandability due to its algorithmic design versus its pedagogical presentation?
- RQ4Can Raft’s leader election efficiency be attributed to its log-based voting mechanism, and how does it compare to Paxos’ approach?
- RQ5Does the use of term reassignment in Paxos for previous log entries lead to measurable inefficiencies compared to Raft’s approach?
Key findings
- Paxos and Raft differ only in their leader election mechanisms: Paxos divides terms among servers, while Raft allows any follower to become a candidate but restricts voting to one per term.
- Raft’s leader election is more efficient than Paxos’ because it avoids sending log entries during the RequestVote phase, unlike Paxos where followers must include log entries in responses.
- Raft’s requirement that candidates have up-to-date logs ensures safety without requiring log replication during election, reducing communication overhead.
- Paxos re-terms log entries from previous terms under the new leader’s term, potentially causing redundant replication, while Raft preserves original terms, avoiding such duplication.
- The superior understandability of Raft is largely due to its clear presentation and pragmatic abstractions rather than inherent algorithmic simplicity.
- Both algorithms are fundamentally similar in approach to consensus, with the core difference lying solely in how they ensure leader safety during election.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.