Skip to content
StackDecode
System Design
6. Distributed Systems FundamentalsAnimated

Paxos Algorithm

The classic consensus protocol.

The idea

Proposers prepare and accept with numbered proposals; acceptors promise and accept; a majority chooses a value.

Watch it work

Press play, pause, or step through. Some animations have settings you can change.

ProposerAcceptor 1Acceptor 2Acceptor 3Prepare(n=7)
  • current message
  • earlier
  • failure or attack

Phase 1a: a proposer picks a ballot number and asks acceptors to promise not to accept lower ones.

step:
1/7
from:
Proposer
to:
Acceptor 1
1/7

Time runs downward. Solid arrows are requests, dashed arrows are replies.

Step by step

  1. 1Prepare with proposal n
  2. 2Acceptors promise
  3. 3Send accept
  4. 4Majority accepts, value chosen

Where it is used

Foundational and used in Chubby and Spanner.

Watch out for

Hard to understand and implement correctly.

Related