Raft
ELI5 — The Vibe Check
Raft is a consensus algorithm designed to be understandable, unlike its predecessor Paxos which requires a PhD to read. It elects a leader, and the leader tells everyone else what to do. If the leader disappears, a new election happens. It's democracy for servers, and it actually works reliably.
Real Talk
Raft is a consensus algorithm that decomposes consensus into leader election, log replication, and safety. A cluster of nodes elects a leader that manages a replicated log. The leader appends entries and replicates them to followers; once a majority acknowledge, the entry is committed. CockroachDB, etcd, and Consul use Raft for distributed coordination.
When You'll Hear This
"Raft is easier to implement than Paxos with equivalent safety guarantees." / "CockroachDB uses Raft for consensus across its distributed ranges."
Related Terms
CockroachDB
CockroachDB is the database that just won't die, like the bug it's named after.
Consensus Algorithm
A consensus algorithm is how a group of servers democratically agree on something even when some of them are flaky or unreachable.
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.
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.