Distributed Consensus
Distributed consensus is the problem of getting multiple nodes in a network to agree on a value despite failures and message delays. Algorithms like Paxos and Raft solve this to enable replicated state machines, leader election, and consistent configuration in distributed systems.
itDistributed systems, messaging, and integration | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Don't Panic
Don't Panic — Distributed Consensus
Distributed consensus is the arrangement used when several machines must keep one durable answer while the network behaves like a courier with a vague relationship to time. It is not a vote counter bolted to a database. It is a protocol for choosing one value, or one position in a shared history, despite late messages and failed participants.
The useful picture is a replicated state machine. A client command enters a replicated log, the log settles on one order, and deterministic replicas apply that order. Consensus decides where a command goes. The application decides what the command means. This division is less glamorous than saying the cluster is clever, but it prevents several expensive misunderstandings.
The hinge is a quorum, usually a majority of voters. Any two majorities overlap, so later decisions carry knowledge of earlier ones rather than launching a rival history from the other side of a partition. A three-voter cluster needs two voters. Five needs three. Four also needs three, which is the distributed-systems version of bringing an extra chair to a meeting and discovering it cannot vote.
The surprising part is that waiting is often correct. Agreement and validity protect the history from conflicting decisions. Termination describes when progress eventually returns. A timeout is not a tiny certificate announcing that another machine has died; it is a local reason to try the next protocol step. Practical systems use timing assumptions so a stable leader and quorum can eventually work together, while keeping the safety rules intact.
Raft makes this visible with leaders, followers, candidates, terms, and log indexes. Paxos reaches the same kind of safety through numbered proposals, promises, and accepted values. Neither one turns arbitrary faulty behavior into a crash fault, nor does either make an external payment happen exactly once because a log entry committed. Those are separate contracts, which is a very useful sentence to have nearby before a design meeting.
Start with the intro for the complete model: quorums, failure and timing assumptions, reads, reconfiguration, and the boundary around transactions. Use the slides when the relationships need a diagram-sized shape. Keep the cheatsheet beside a design review, then run the exercise to watch a majority preserve one committed prefix through a partition. The reference links carry the original papers and the Raft visualization when the cheerful overview has run out of useful rope.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://raft.github.io/index.html
Supports
- Consensus as agreement on values among servers
- Replicated state machine purpose and majority availability examples
- Official access to the Raft paper, dissertation, specification, and visualizations
- https://raft.github.io/raft.pdf
Supports
- Replicated state machines and ordered command logs
- Raft server states, terms, elections, randomized timeouts, and heartbeats
- Log replication, conflict repair, commitment, safety, and client interaction
- Majority failure tolerance, membership changes, and log compaction
- Comparison of Raft with Multi-Paxos and other consensus algorithms
- https://raft.github.io/raftscope/index.html
Supports
- Interactive observation of a five-server Raft cluster
- Elections, terms, replicated logs, partitions, and recovery behavior
- https://www.microsoft.com/en-us/research/publication/2016/12/paxos-simple-Copy.pdf
Supports
- Proposers, acceptors, learners, numbered proposals, promises, and accepted values
- Majority quorum intersection and the conditions that preserve one chosen value
- Extending single-value Paxos toward a sequence of state-machine commands
- https://www.microsoft.com/en-us/research/publication/paxos-made-simple/
Supports
- Authoritative publication metadata and access point for Paxos Made Simple
- Lamport's stated purpose and scope for the paper
- https://www.microsoft.com/en-us/research/publication/the-abcds-of-paxos/
Supports
- Consensus as a basis for replicated state machines
- Abstract Paxos roles and comparison of crash and Byzantine versions
- Safety, liveness, and performance as separate protocol concerns
- https://groups.csail.mit.edu/tds/papers/Lynch/pods83-flp-scanned.pdf
Supports
- Agreement, validity, and eventual decision requirements
- Impossibility of guaranteed deterministic consensus termination in complete asynchrony with one possible crash
- Indistinguishability of delayed communication and process failure
- Transaction commit as a motivating agreement problem
- https://groups.csail.mit.edu/tds/papers/Lynch/jacm88.pdf
Supports
- Synchronous, asynchronous, and partially synchronous timing models
- Unknown bounds and bounds that hold after an unknown stabilization time
- Fault-tolerant consensus progress under partial synchrony
- https://www.usenix.org/conference/osdi-99/presentation/practical-byzantine-fault-tolerance
Supports
- Byzantine faults as arbitrary behavior caused by attacks or software errors
- Practical Byzantine fault-tolerant state-machine replication
- Distinction between Byzantine and narrower crash-fault assumptions
- https://www.microsoft.com/en-us/research/publication/consensus-on-transaction-commit/
Supports
- Relationship between consensus and distributed transaction commit
- Two-phase commit as a zero-fault-tolerant form of Paxos Commit
- Paxos Commit's use of separate consensus decisions for participants
- Blocking and fault-tolerance differences between two-phase commit and Paxos Commit
- https://lamport.azurewebsites.net/pubs/lamport-paxos.pdf
Supports
- The Paxos protocol's historical development and published account
- Numbered proposals, quorum acceptance, and one chosen value
- https://aphyr.com/posts/330-jepsen-rethinkdb-reconfiguration
Supports
- Joint-consensus reconfiguration requires majorities of old and new configurations
- Delayed messages and membership transitions can violate consensus assumptions
- https://aphyr.com/posts/316-jepsen-etcd-and-consul
Supports
- A local leader view alone is insufficient for linearizable reads during partitions
- Failure testing exposes read-path behavior separately from ordered writes
- https://etcd.io/
Supports
- etcd as a strongly consistent distributed key-value store using Raft
- https://developer.hashicorp.com/consul/docs/architecture
Supports
- Consul server control-plane state persisted through Raft
- https://zookeeper.apache.org/
Supports
- Apache ZooKeeper as a distributed coordination service
- https://www.cockroachlabs.com/blog/the-new-stack-meet-cockroachdb-the-resilient-sql-database/
Supports
- CockroachDB Raft groups, majority commits, and range-level replication
- https://tikv.org/
Supports
- TiKV as a distributed key-value database using Raft replication
