← System Design
Consensus & Replication Protocols
ReliabilityAlgorithms (Paxos, Raft) that let a cluster of nodes agree on a single value/state despite failures.
Consensus protocols let a group of machines agree on one value (e.g. 'who is the current leader', 'what is the next entry in the replicated log') even when some nodes crash or messages are delayed, as long as a majority (quorum) of nodes are healthy and can communicate. Raft (designed for understandability) and Paxos (the original, notoriously subtle) are the two classic algorithms; both rely on majority voting so that any two quorums always overlap, guaranteeing at most one leader/decision at a time.
How it connects
Consensus & Replication Protocols as the source, with the components it typically interacts with.
- → Database Types (SQL, NoSQL & Beyond): Distributed databases rely on a consensus algorithm to agree on transaction order and elect a leader for each partition/shard.
- → Message Queues & Event Streaming: Queue brokers use consensus (e.g. Kafka's controller quorum, Raft in Kafka's KRaft mode) to keep partition metadata consistent across brokers.