CP Systems: Consistency and Partition Tolerance
What you'll learn: How CP systems prioritize data consistency over availability when network partitions occur in distributed systems.
The Core Trade-off
In a CP system, when a network partition splits your distributed system into isolated groups, the system chooses to maintain consistency across all nodes rather than remain available for writes. This means some nodes will refuse requests or become unavailable until the partition heals and they can safely synchronize.
Think of it like a bank's branch network during a communication outage. Rather than risk processing transactions that might create inconsistent account balances across branches, the system refuses new transactions until connectivity is restored. Better to be temporarily unavailable than to promise accurate data you can't deliver.
How CP Systems Behave
When a partition occurs:
- Nodes that can't reach a majority (quorum) refuse write operations
- Read operations may also be blocked to prevent stale data access
- The system maintains strong consistency guarantees like linearizability
- Once the partition heals, nodes synchronize and resume normal operation
Real-World Examples
Traditional relational databases with distributed configurations often operate as CP systems. Systems like ZooKeeper, etcd, and Consul explicitly choose CP behavior because they coordinate critical cluster state—consistency matters more than temporary unavailability.
The minority partition essentially "fails closed" to prevent split-brain scenarios where conflicting updates create irreconcilable data states.
The Cost
Users in the minority partition experience service disruption. If you need 24/7 writes everywhere, CP systems won't satisfy that requirement during partitions.
Key Takeaway: CP systems sacrifice availability during network partitions to guarantee that all accessible data remains consistent, making them ideal for scenarios where correctness is non-negotiable, like financial transactions or cluster coordination.