consensus
Consensus Algorithms
Protocols for achieving agreement among distributed nodes, even in the presence of failures.
// concept
Consensus ensures all nodes agree on a single value or decision. The challenge: achieving agreement despite network partitions, crashes, and message delays.
Two Phase Commit
Coordinator asks all participants to prepare, then commit. Atomic but blocking if coordinator fails.
Three Phase Commit
Adds a pre-commit phase to reduce blocking. Participants can safely abort if coordinator is unreachable.
Simplified Raft
Leader-based consensus: elect a leader, replicate logs, commit when majority acknowledges.