CP vs AP: How Distributed Systems Handle Network Failures
The CAP theorem describes a fundamental trade-off in distributed systems: when a network partition occurs, a system must choose between Consistency (CP) and Availability (AP). A CP system halts or delays responses during a partition to prevent stale or incorrect data from being served, making it suitable for financial transactions and payment systems. An AP system keeps responding even when nodes are out of sync, accepting temporary inconsistencies — a reasonable approach for features like shopping carts or social media counters. In practice, since network partitions are unavoidable in real distributed environments, the CA combination is not a viable option, leaving CP and AP as the two practical design choices. Developers are advised to focus less on labeling databases and more on deciding upfront whether their system should prioritize correctness or continued availability during failures.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in