Consensus Algorithm
ELI5 — The Vibe Check
A consensus algorithm is how a group of servers democratically agree on something even when some of them are flaky or unreachable. It's like getting a group of friends to agree on a restaurant, except some friends keep leaving the group chat. As long as a majority agree, the decision stands.
Real Talk
Consensus algorithms enable distributed systems to agree on a single value or sequence of values despite node failures and network partitions. They require a majority (quorum) of nodes to agree for progress. Key algorithms include Paxos (theoretical foundation), Raft (practical implementation), and Zab (ZooKeeper). They're fundamental to distributed databases and coordination services.
When You'll Hear This
"Every distributed database relies on some form of consensus algorithm." / "Raft replaced Paxos as the go-to consensus algorithm because humans can actually understand it."
Related Terms
CAP Theorem
The CAP theorem says a distributed database can only guarantee two out of three things: Consistency (everyone sees the same data), Availability (every requ...
Distributed Database
A distributed database spreads your data across multiple computers that work together like a hive mind. If one server dies, the others pick up the slack.
Raft
Raft is a consensus algorithm designed to be understandable, unlike its predecessor Paxos which requires a PhD to read.
Two-Phase Commit
Two-phase commit (2PC) is like a wedding ceremony for distributed transactions. Phase 1: 'Do you all agree to commit?' Every node says yes or no.