The CAP Trade-off in Consensus
What you'll learn: How consensus algorithms must sacrifice availability to maintain consistency during network partitions.
The Fundamental Choice
When building a consensus system, the CAP theorem forces a critical decision. Remember that CAP states you can only guarantee two of three properties: Consistency, Availability, and Partition tolerance. Since network partitions are inevitable in distributed systems (you must tolerate them), consensus algorithms face a binary choice: consistency or availability.
Why Consensus Chooses CP
Consensus algorithms like Raft and Paxos are explicitly CP systems — they choose consistency and partition tolerance over continuous availability. Here's why:
The core promise of consensus is that all nodes agree on the same value. If a network partition splits your cluster and both sides continued accepting writes independently (prioritizing availability), they would diverge. When the partition heals, you'd have conflicting data with no clear resolution.
Instead, consensus algorithms require a majority quorum to make progress. During a partition, only the side with the majority can continue operating. The minority side becomes unavailable for writes — it rejects requests rather than risk inconsistency.
The Trade-off in Practice
Think of it like a board meeting: if your company's 5-person board splits into a room with 3 people and a room with 2 people, only the room with 3 (the majority) can make binding decisions. The 2-person room must wait, even if they have urgent matters. This temporary unavailability prevents the company from making contradictory decisions.
This is why consensus-based systems may reject writes during network issues — they're protecting the safety guarantee (consistency) at the cost of liveness (availability).
Key Takeaway: Consensus algorithms are CP systems that sacrifice availability during partitions to maintain strong consistency guarantees through majority quorums.