</> MAANG.io
system design · 201

Intermediate

Master system design interviews with scalable architecture patterns, distributed systems, and real-world design challenges.

0/124 solved 0% complete

Paxos

maang.io System Design Series


Paxos solves the hardest problem in distributed systems: getting unreliable machines to agree on one value, provably, even as messages are lost, delayed, or reordered. Its safety rests on one fact — any two majorities overlap — which forces every later proposer to honor an already-chosen value. Multi-Paxos extends it into the replicated log behind systems like Spanner and Chubby.

This deep dive comes in three parts:

  • Foundations & Core Concepts — the roles, the two-phase protocol, and why consensus is hard.
  • Internals — acceptor state, the safety proof, dueling proposers, and Multi-Paxos, with worked numbers.
  • Interview — Staff/Principal Q&A: safety vs liveness, quorum math, and Paxos vs Raft.

Paxos — Part 2: Internals & The Protocol

maang.io System Design Series


What is this?

Back to our six friends and the laggy group chat. In Part 1 we watched a value get chosen and saw that a later proposer was forced to re-affirm an already-accepted venue. Now we open the hood and answer the questions a Staff engineer must be able to answer cold: What state does each acceptor actually keep? What exactly do the messages say? And why — precisely — is it impossible for two different venues to both win?

The beautiful thing about Paxos is that the entire protocol lives in the acceptor's tiny memory and two simple rules. Get those rules exactly right and the safety proof falls out of one fact you already know: any two majorities of a group must share at least one member. That shared member is the group's conscience — it remembers what happened and refuses to let history be rewritten.

The one-line idea: each acceptor persists just two things — the highest proposal number it has promised and the last value it accepted (with its number) — and follows two rules (never promise backwards, always report what you accepted). From those, majority overlap guarantees at most one value is ever chosen. Everything else — Multi-Paxos, leaders, the log — is engineering built on top of that core.

Let's follow the state, then the protocol, then the proof, then a worked run with real numbers.


Sign in to continue reading

The rest of this lesson is available with a free account. Signing in with Google or Microsoft is free.

Sign in to read the full lesson

Sign in to MAANG.io

Use your Google or Microsoft account — no password to remember.

Continue with Google Continue with Microsoft

Please accept the terms above to continue.