Vibe Engines is free, interactive AI engineering & system design — runs in your browser. Pick a learning path →
Raft vs Paxos: same power, different bet
Raft doesn't do less than Paxos — it's provably equivalent in power. What it does is make one design commitment Paxos avoids, and that single commitment is the entire reason engineers can actually reason about it under pressure.
The one distinction that decides everything
Paxos (Leslie Lamport, 1989, published readably in 1998) is a value-at-a-time consensus protocol with Proposer/Acceptor/Learner roles, described in a notoriously abstract way with no inherent persistent leader. Raft (Ongaro & Ousterhout, 2014) was explicitly designed for understandability: a strong, first-class leader handles all client requests and log replication, decomposing consensus into leader election, log replication, and safety as separate, more approachable sub-problems.
Building something new? Raft — it's the well-understood, battle-tested default. Working with or on a system that already uses Paxos, or needing a specific Paxos-variant performance property? That's when Paxos still matters directly.
Head to head
| Dimension | Raft | Paxos |
|---|---|---|
| Origin | Ongaro/Ousterhout, 2014, Stanford — explicit understandability goal | Leslie Lamport, 1989 (readable 1998 paper) |
| Structure | Strong-leader model, decomposed into 3 clear sub-problems | Proposer/Acceptor/Learner, described abstractly |
| Leader model | Leader election is a first-class part of the protocol | No inherent persistent leader; Multi-Paxos adds one informally |
| Log handling | Entries strictly commit in order | Multi-Paxos allows some out-of-order entry commits |
| Real-world adoption | etcd, Consul, CockroachDB, TiKV — default for new systems since 2014 | Chubby (Google), Spanner-family variants |
| Ease of correct implementation | Shown in user studies to be easier to implement correctly | Famously difficult; many systems had subtle bugs |
| Guarantees | Same safety/liveness as Paxos, under the same failure model | Same safety/liveness as Raft, under the same failure model |
When each matters
Reach for Raft
- Building something new
- Want a well-understood, battle-tested implementation
- Your team needs to reason about and debug it with confidence
- General-purpose replicated log / coordination store
Paxos still matters
- Working with/on systems already built on it (Chubby, Spanner-family)
- Understanding the theoretical foundation Raft builds on
- Need a variant’s specific property (Fast Paxos, EPaxos — lower latency, no fixed leader bottleneck)
Not a combine — a lineage
Unlike RAG-and-fine-tuning, this isn't a "use both" situation — a system picks one consensus algorithm. But the two didn't develop independently: Raft is essentially Paxos's ideas, restructured specifically for engineers to implement correctly, and understanding Paxos's proposer/acceptor formulation deepens why Raft's leader-election/log-replication split works as cleanly as it does.
Raft's inventors didn't discover new consensus math — they found a more teachable decomposition of the same problem Paxos already solved, and proved it equivalent.
Why a strong leader makes the hard part go away
The actual technical reason Raft feels easier isn't that it does less — it's that Raft makes a design commitment Paxos deliberately avoids: a STRONG LEADER. In Raft, only the current leader can append to the log, and it does so strictly in order, which means most of the hard reasoning collapses into two well-scoped questions: "how do we safely elect and maintain a leader," and "how does a new leader safely reconcile its log with the cluster after a crash" — each with its own formal proof in the Raft paper. Paxos's more general formulation, where any proposer can propose without a mandated order, is strictly MORE flexible — and that flexibility is exactly what later higher-performance variants (Multi-Paxos, Fast Paxos, EPaxos) exploited to reduce latency by avoiding always routing through a single leader.
But that same flexibility is what made the base protocol notoriously hard to get right in a real, partially-failing, network-partitioned production system — more edge cases, more ways for an implementation to be subtly wrong under an interleaving nobody tested. Raft trades away some of that theoretical flexibility for a protocol where the hard cases are fewer, named, and each has a proof — which is a real capability trade, not a free simplification.
Paxos's leaderless flexibility enables lower-latency variants that don't bottleneck on one node. Raft trades that flexibility for a protocol shape engineers can actually hold in their head under pressure — and, per Raft's own user study, implement correctly more often.
A worked scenario: why etcd chose Raft
etcd — the coordination store behind Kubernetes — needed a strongly-consistent, replicated store where the implementing engineers could reason with confidence about real edge cases: a leader crashing mid-write, a network partition happening during log replication, a new leader needing to safely reconcile a divergent log. These are exactly the scenarios Raft's decomposition names explicitly and proves safe for.
Raft's paper backs its understandability claim with more than intuition — a user study showed engineers implemented it correctly more often than Paxos given comparable material — and that evidence, not just theoretical elegance, was the deciding factor over adapting an existing Paxos implementation for a system as foundational to Kubernetes' reliability as etcd needed to be.
When correctness under real operational failure matters more than squeezing out the last bit of latency, Raft's provable, teachable decomposition tends to win — which is most new systems, most of the time.
The picture: one election, one commit
Worked example: a 5-node cluster through a partition
Five nodes, S1 to S5. A majority is 3. Follow one cluster through a partition, a new election, two crashes and a heal. The “Need” column is always 3: that number never changes, whoever is up.
| Step | Event | Leader can reach | Votes or acks | Need | Result |
|---|---|---|---|---|---|
| 1 | S1 leads term 1 and appends index 1 | S1–S5 | 5 | 3 | Index 1 committed |
| 2 | S1 is cut off alone. It still thinks it leads term 1 and appends x at index 2 | S1 | 1 (itself) | 3 | x never commits; the client times out |
| 3 | On the other side, S3’s randomised timeout fires first. Term 2 | S2–S5 | S3 + S2, S4, S5 = 4 | 3 | S3 leads term 2 |
| 4 | S3 appends y at index 2 | S2–S5 | 4 | 3 | Index 2 = y, committed |
| 5 | S4 and S5 crash. S3 appends index 3 | S2, S3 | 2 | 3 | Not committed. No progress, and no wrong answer |
| 6 | The partition heals. S1 sees term 2 and steps down. Its index 2 says term 1, the leader’s says term 2, so S1 deletes x, takes y, then index 3 | S1, S2, S3 | 3 | 3 | Index 3 committed |
Deleting x at step 6 breaks no promise. x never reached a majority, so its client never got a success. That is the whole safety argument in miniature. Any two majorities of 5 nodes share at least one node, because 3 + 3 = 6 is more than 5. So every committed entry sits on at least one voter in every later election. A node also refuses to vote for a candidate whose log is less up to date than its own, so the winner always has the entry. Step 5 shows the other side of the deal. With S1 cut off and S4 and S5 down, only 2 nodes can talk to each other. The cluster stops accepting writes rather than accept one it might later lose. Raft keeps safety and gives up availability, exactly as Paxos would under the same failures.
Cost and trade-offs: messages, round trips, quorums
Here Time means the network delay a client waits through, and Space means the messages or extra state each operation costs. n is the cluster size.
| Case | Time | Space | Why |
|---|---|---|---|
| Raft write, stable leader | 1 round trip, leader to a majority, plus the client hop | 2(n−1) messages per entry: 8 at n = 5, fewer with batching | AppendEntries out, replies back. Commit once a majority has stored it. |
| Raft leader election | Election timeout + 1 RequestVote round trip | 2(n−1) messages; a split vote retries | The Raft paper suggests timeouts of roughly 150–300 ms. Randomising them makes split votes rare. |
| Basic Paxos, one value | 2 round trips: Prepare/Promise, then Accept/Accepted | About 4 messages per acceptor | There is no standing leader, so every value pays for phase 1. |
| Multi-Paxos, stable leader | 1 round trip per value | About 2 messages per acceptor | Phase 1 runs once and covers many slots. In steady state it is shaped like Raft. |
| EPaxos, no conflicts | 1 round trip from the nearest replica | Per-command dependency lists | Any replica can lead a command. Commands that conflict pay a second round. |
| Linearizable read | 1 heartbeat round to a majority, or a time-based lease | No log entry written | A leader must confirm it is still the leader before answering. Otherwise it may serve stale data. |
The quorum is ⌊n/2⌋ + 1. That works out to 2 of 3, 3 of 4, 3 of 5 and 4 of 7, tolerating 1, 1, 2 and 3 failures. Going from 3 nodes to 4 buys no extra failure tolerance. You just wait for one more ack. Going from 5 to 7 tolerates one more failure, but every write now waits for the 4th-fastest node instead of the 3rd. In both protocols, every node you add makes the cluster safer to run, never faster.
Common mistakes
- Running an even number of nodes
A 4-node cluster needs 3 acks and survives 1 failure, which is exactly what 3 nodes give you, with more hardware and one more ack to wait for. A 2-node cluster survives no failures at all, because either node going down leaves 1 of 2, which is not a majority. Use 3 or 5, sometimes 7.
- Adding nodes to get throughput
Every write goes through one leader and waits on a majority, so more nodes means more replication traffic and a bigger quorum. To scale writes you shard the data into many independent consensus groups. You do not grow one group.
- Not persisting term and vote before replying
Raft requires
currentTerm,votedForand the log to be on stable storage before a node answers an RPC. Skip the fsync and a node can restart and vote twice in the same term. That gives you two leaders in one term, which is the one thing the protocol exists to prevent. - Serving reads from a leader that might be deposed
A leader cut off in a minority partition still believes it leads, as S1 did in step 2 above. Reads it answers from memory can be stale. Confirm leadership with a heartbeat round first (ReadIndex), or use a lease. A lease is only as safe as your bound on clock drift.
- Committing an old-term entry by counting copies
A new leader may not mark an entry from an earlier term committed just because a majority holds it. The Raft paper’s Figure 8 shows how such an entry can still be overwritten. The leader commits an entry from its own term by counting, and the older entries before it commit along with it.
Where this shows up in production and interviews
- Kubernetes, through etcd
Every object write in a Kubernetes cluster is a Raft log entry in etcd. That is why control planes run 3 or 5 etcd members, and why a slow disk on one member shows up as slow API calls. The leader waits for a majority to fsync.
- Multi-Raft databases
CockroachDB splits data into ranges and TiKV splits it into regions, each its own Raft group. Leaders are spread across machines, so no single node handles every write. This is the standard answer to “one leader is a bottleneck”.
- Kafka without ZooKeeper
Kafka’s KRaft mode keeps cluster metadata in a Raft-based quorum of controllers, replacing the separate ZooKeeper ensemble. Brokers fetch that metadata log, which is replication with one leader, the Raft shape. Spanner sits on the Paxos side: it runs a Paxos group per split of its data.
- The interview version
In “design a lock service” or “design a config store”, say why you chose 3 or 5 nodes and what the minority side of a partition does: it cannot elect or commit. Then use the term number as a fencing token, so a deposed leader’s late writes are rejected downstream.
Which would you pick?
Three situations. Pick the side you'd actually build — the explanation follows.
You are building a new distributed system that needs consensus, and the team has not implemented one before.
For new systems the page's default is Raft precisely because understandability is an operational property: a protocol the team can reason about is one they can debug at 3am. Raft is not a subset — its inventors found a more teachable decomposition of the same problem and proved it equivalent.
Someone claims Raft is "less correct" than Paxos because it is simpler.
Raft's authors did not discover new consensus math; they reorganised the same problem into leader election, log replication and safety, and proved the result equivalent. Simplicity here is in the presentation, not in the guarantees — and conflating the two is exactly the misconception the page exists to correct.
When does Paxos genuinely earn its complexity?
Paxos's leaderless flexibility enables variants that avoid bottlenecking on a single node, which is a real advantage for specific latency-sensitive deployments — and an existing Paxos system is its own reason. But "performance matters" is true of every system and does not by itself justify the complexity, and "never" ignores the deployments where it wins.
Quick answers
Raft or Paxos — which should I use?
For a new system, Raft — it provides the same guarantees as Paxos but is designed and shown to be easier for engineers to implement correctly and reason about. Paxos remains relevant mainly for systems already built on it, or when a specific variant’s latency properties are needed.
Is Raft less powerful than Paxos?
No — Raft provides the same safety and liveness guarantees as Paxos under the same failure model. It’s not more powerful or less powerful, it’s a different, more teachable decomposition of the same consensus problem.
Why is Paxos considered hard to implement?
Its general, leaderless formulation allows more flexibility (any proposer can propose, not necessarily in strict order), which also means more edge cases and interleavings an implementation must handle correctly — historically a common source of subtle bugs in real systems.
What does Raft’s "strong leader" actually simplify?
By making only the current leader able to append to the log, in strict order, Raft reduces most of consensus’s hard reasoning to two well-scoped, separately-proven problems: safely electing/maintaining a leader, and safely reconciling logs after a leader change.
Raft: how a cluster agrees by electing a leader
Explore the topic
See this alongside everything else on the same subject — handbooks, system designs, challenges and tools, in one place.
More Handbooks
- The System Design Fundamentals HandbookThe load-bearing ideas behind every distributed system — the CAP theorem and consistency models, concurrency and locking, partitioning and replication, and consensus and coordination — each tied to a real worked design you can study interactively.Read →
- CAP Theorem & Consistency ModelsWhat a distributed system can promise when the network splits — CP vs AP, why "CA" is a myth, PACELC, and the full spectrum from linearizable to eventual consistency. Part of System Design Fundamentals.Read →
- Partitioning, Sharding & ReplicationHow one dataset becomes many — range vs hash partitioning, consistent hashing and virtual nodes, hot partitions, replication topologies, replication lag, and quorums. Part of System Design Fundamentals.Read →
- Consensus, Transactions & CoordinationHow nodes that can crash still agree on one truth — majority quorums, Raft and Paxos, leader election, two-phase commit vs the saga pattern, and idempotency for exactly-once effects. Part of System Design Fundamentals.Read →
- The Kubernetes HandbookThe one idea under all the YAML — declare desired state, and a control loop makes reality match. Covers the orchestration problem, pods, deployments and replicasets, services and networking, the reconciliation loop and self-healing, the scheduler, config/secrets and health probes, autoscaling, and when you actually need Kubernetes.Read →
- The Observability HandbookSeeing inside production — monitoring vs observability, the three pillars (metrics, logs, traces) and what each answers, structured logging, metric types and the cardinality trap, distributed tracing, the golden signals and SLIs/SLOs/error budgets, alerting on symptoms not causes, and correlating all three during an incident.Read →