System Design
6. Distributed Systems FundamentalsAnimated
Consensus Algorithms
Getting nodes to agree on one value despite failures.
The idea
Paxos and Raft let a majority agree and remember decisions even when some nodes crash.
Watch it work
Press play, pause, or step through. Some animations have settings you can change.
- leader
- candidate
- follower
- crashed
Five servers start as followers. Each waits for a heartbeat from a leader; if none arrives before a random timeout, it will stand for election.
1/10
Raft guarantees at most one leader per term and never loses committed entries.
Step by step
- 1Propose a value
- 2Gather a majority
- 3Commit
- 4Apply in order
Where it is used
Replicated logs and configuration.
Watch out for
Needs a majority alive, and adds latency.