Vibe Engines
YouTube

Vibe Engines is free, interactive AI engineering & system design — runs in your browser. Pick a learning path

Handbooks  /  Raft vs Paxos
Engineering~9 min readComparison
Head to Head

Raft vs Paxos: same power, different bet

RaftvsPaxos

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.

01

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.

→ The rule

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.

02

Head to head

DimensionRaftPaxos
OriginOngaro/Ousterhout, 2014, Stanford — explicit understandability goalLeslie Lamport, 1989 (readable 1998 paper)
StructureStrong-leader model, decomposed into 3 clear sub-problemsProposer/Acceptor/Learner, described abstractly
Leader modelLeader election is a first-class part of the protocolNo inherent persistent leader; Multi-Paxos adds one informally
Log handlingEntries strictly commit in orderMulti-Paxos allows some out-of-order entry commits
Real-world adoptionetcd, Consul, CockroachDB, TiKV — default for new systems since 2014Chubby (Google), Spanner-family variants
Ease of correct implementationShown in user studies to be easier to implement correctlyFamously difficult; many systems had subtle bugs
GuaranteesSame safety/liveness as Paxos, under the same failure modelSame safety/liveness as Raft, under the same failure model
03

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)
04

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.

→ The lineage

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.

05

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.

→ The trade you’re actually making

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.

06

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.

→ The pattern generalizes

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

The picture: one election, one commit

1 Election, term 3 S1candidate S2 votes yes S3 votes yes S4 down S5 down self + 2 = 3 of 5majority: S1 leads term 3 2 Replicate index 7 idx567 S1233 S2233 S3233 S42 S52 3 of 5 index 7 on 3 of 5: committedS4, S5 catch up when back
Left: S1’s election timeout fired, so it became a candidate for term 3, voted for itself and sent RequestVote to the other four. Two replies plus its own vote make 3 of 5, which is a majority, so S1 leads. Right: each cell is a log entry, and the number in it is the term it was written in. S1 appended index 7 and sent AppendEntries. Once three nodes have stored it, it is committed. That counting rule applies here because index 7 was written in S1’s own term. S4 and S5 are filled in from S1’s log when they return.
By the numbers

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.

StepEventLeader can reachVotes or acksNeedResult
1S1 leads term 1 and appends index 1S1–S553Index 1 committed
2S1 is cut off alone. It still thinks it leads term 1 and appends x at index 2S11 (itself)3x never commits; the client times out
3On the other side, S3’s randomised timeout fires first. Term 2S2–S5S3 + S2, S4, S5 = 43S3 leads term 2
4S3 appends y at index 2S2–S543Index 2 = y, committed
5S4 and S5 crash. S3 appends index 3S2, S323Not committed. No progress, and no wrong answer
6The 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 3S1, S2, S333Index 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.

Trade-offs

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.

CaseTimeSpaceWhy
Raft write, stable leader1 round trip, leader to a majority, plus the client hop2(n−1) messages per entry: 8 at n = 5, fewer with batchingAppendEntries out, replies back. Commit once a majority has stored it.
Raft leader electionElection timeout + 1 RequestVote round trip2(n−1) messages; a split vote retriesThe Raft paper suggests timeouts of roughly 150–300 ms. Randomising them makes split votes rare.
Basic Paxos, one value2 round trips: Prepare/Promise, then Accept/AcceptedAbout 4 messages per acceptorThere is no standing leader, so every value pays for phase 1.
Multi-Paxos, stable leader1 round trip per valueAbout 2 messages per acceptorPhase 1 runs once and covers many slots. In steady state it is shaped like Raft.
EPaxos, no conflicts1 round trip from the nearest replicaPer-command dependency listsAny replica can lead a command. Commands that conflict pay a second round.
Linearizable read1 heartbeat round to a majority, or a time-based leaseNo log entry writtenA 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.

Watch for

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, votedFor and 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.

In the wild

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.

Your call

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.

Someone claims Raft is "less correct" than Paxos because it is simpler.

When does Paxos genuinely earn its complexity?

Frequently asked

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.

▶  Watch it explained

Raft: how a cluster agrees by electing a leader

Raft vs Paxos · Vibe Engines · 2026
Finished this one? 0 / 209 Handbooks done
NextCP vs AP Databases Next on the “Distributed systems, from first principles” ladder · rung 7 of 7

Explore the topic

See this alongside everything else on the same subject — handbooks, system designs, challenges and tools, in one place.

More Handbooks