System Design Space
Knowledge graphSettings

Updated: March 2, 2026 at 3:33 PM

Consensus: Paxos and Raft

expert

How systems negotiate a single meaning: quorums, two-phase Paxos, and leader-centric Raft.

Related book

Designing Data‑Intensive Applications

The chapter on consensus and replication is a must-read for understanding Paxos/Raft.

Read review

Consensus is a way to agree on a single meaning in a distributed system despite failures, delays and network divisions. Without consensus, you cannot reliably elect a leader, synchronize metadata, or provide linear writes to a quorum cluster.

Foundation

TCP protocol

Consensus relies on network rounds and stable transport.

Читать обзор

Where is consensus needed?

Leader selection

Cluster coordination and coordinator/primary assignment.

Metadata

Configurations, membership, data schema and routing.

Consistent entry

Linearizable operations during replication.

Paxos

Paxos is a classic Lamport algorithm. It guarantees the selection of a single value through a two-phase protocol and quorum acceptors. In real systems, Multi-Paxos with a dedicated leader is often used.

Interactive Paxos diagram

Select a step to highlight active participants and messages.

Proposer
Acceptors
Learners
Prepare(n)to an acceptor quorum
Promise(n, v?)reply to proposer
Accept(n, v)value proposal
Accepted(n, v)notify learners

Multi‑Paxos

Paxos optimization for command flow: the leader takes on the Prepare phase once, and then only performs the Accept round for each entry.

What does it give

  • Fewer network rounds per entry
  • Higher throughput
  • The Leader Makes Progress Easy in Conflicts

Multi‑Paxos operation modes

Select a phase to see how the message flow changes.

Steady state

Each new log entry uses only the Accept round, reducing RTT.

Accept(n, v) to quorum
Accepted responses
Higher throughput

Raft

Raft was designed to be a "understandable consensus". It divides the task into leader election, log replication, and membership management. This makes the protocol easier to explain and implement.

Raft node states

Switch state to see how node role and message flow change.

Leader

Accepts client commands and replicates them to followers.

Client command
AppendEntries
Commit index

Paxos vs Raft

Paxos

  • More difficult to understand and implement
  • More formal and "academic"
  • Often hidden behind Multi‑Paxos

Raft

  • Easier to explain to the team and support
  • Explicit leader-centered model
  • Used in etcd, Consul, CockroachDB

Key Findings

  • Consensus is needed for consistent value selection in the face of disruption.
  • Paxos is fundamental but complex; Raft is engineering friendly.
  • Both protocols require a majority quorum and are tolerant of partial failures.

Related book

Distributed Systems: Principles and Paradigms

A classic work on consensus and distributed algorithms.

Читать обзор

Further on topic

Jepsen and consistency models

How consistency guarantees are tested and where consensus fits into them.

Examples in systems

etcd/Consul (Raft), ZooKeeper (Zab), Cassandra (Paxos for LWT).

Consensus makes the system more reliable, but increases latency and complexity. Use it only where strict consistency is truly needed.

Related materials

Related chapters

Enable tracking in Settings

System Design Space

© 2026 Alexander Polomodov