Updated November 8, 2026: corrected the treatment of CA systems, replaced the banking example (Brewer's own ATM discussion points the other way) and tightened the definition of consistency.

Short answer: The CAP theorem says a distributed data system cannot be both fully consistent and fully available while the network is partitioned. Because partitions can't be ruled out, the real choice is between consistency (CP) and availability (AP) during a failure. Decide by comparing what a wrong answer costs with what downtime costs.

In the world of distributed systems, architects face a fundamental decision about how their application behaves under failure. It's a choice that determines how your system behaves when networks fail, servers crash, or data centers go offline. This decision revolves around three seemingly essential properties that every business wants but can't simultaneously achieve: perfect consistency, complete availability, and network fault tolerance.

The CAP theorem is one of the most important principles in distributed computing. It forces hard choices about what matters most when everything goes wrong.

What Is the CAP Theorem?

The CAP theorem, first presented by computer scientist Eric Brewer in 1998–99, in his keynote at the 2000 Symposium on Principles of Distributed Computing, and formally proven by Seth Gilbert and Nancy Lynch in 2002, presents a stark reality: a distributed system cannot provide all three of the following properties at the same time when the network partitions. Because partitions can't be ruled out in practice, partition tolerance isn't really optional. The real decision is what to give up, consistency or availability, when one happens:

Consistency (C): Every read returns the most recent acknowledged write, or an error. Clients never see stale data, and the system behaves as if there were a single copy of it.

Availability (A): The system remains operational and responsive to requests, even when some components fail. Every request receives a response, though it might not contain the most recent data.

Partition Tolerance (P): The system continues to operate despite network failures that prevent some nodes from communicating with others. The system can survive network splits and communication breakdowns.

The theorem's power lies not in its mathematical proof but in its practical implications. It forces system designers to confront an uncomfortable truth: when network partitions occur—and they will occur—you must choose between consistency and availability. There's no middle ground during the partition itself. Outside of partitions you can have both, and Brewer later argued that the "pick two" framing is misleading (see CAP Twelve Years Later).

The CAP triangle A triangle with Consistency at the top, Availability at the bottom left and Partition tolerance at the bottom right. The side between consistency and partition tolerance is CP, the bottom side is AP, and the side between consistency and availability, CA, is not achievable in a distributed system. C A P Consistency Availability Partition tolerance CP consistent, may refuse requests AP: always responds, may be stale CA only without a network to partition
The CAP triangle: a distributed system gives up either consistency (AP) or availability (CP) during a partition.

What Are Your CAP Options?

What Is a CP System? (Consistency and Partition Tolerance)

CP systems prioritize data accuracy above all else. When a network partition occurs, these systems will sacrifice availability to maintain consistency. If the system can't guarantee that all nodes have the latest data, it simply refuses to serve requests until the partition heals.

This approach makes sense when incorrect data is more damaging than temporary unavailability. Consider a financial trading platform during a flash crash. It's better for the system to go offline temporarily than to execute trades based on stale price data that could cost millions.

CP systems follow a simple principle: "When in doubt, stop." If the system cannot guarantee data consistency across all nodes, it refuses to serve requests until certainty is restored.

Business Examples:

  • Coordination and consensus services: Systems such as etcd, which uses the Raft consensus algorithm, keep a single consistent view of their data. A node that cannot reach a majority of the cluster stops accepting writes instead of risking conflicting state.
  • Healthcare Records: Electronic health record systems prioritize consistency. Patient medication records must be accurate across all systems—a temporary outage is preferable to administering incorrect dosages based on outdated information.

What Is an AP System? (Availability and Partition Tolerance)

AP systems keep the lights on no matter what. Even during network partitions, they continue serving requests using whatever data is locally available. Users always get responses, though the information might be slightly outdated or inconsistent across different parts of the system.

This approach works when user engagement and system responsiveness matter more than perfect data consistency. Social media platforms exemplify this philosophy—it's better to show users a timeline that's a few seconds old than to show them nothing at all.

AP systems follow the opposite philosophy: "When in doubt, proceed." They continue serving requests using whatever data is available locally, accepting that some information might be temporarily inconsistent.

Business Examples:

  • Cash machines (ATMs): Strong consistency looks like the obvious choice for banking, but Brewer notes that in practice availability wins: during a partition, ATMs keep dispensing cash up to a limit (he gives $200 as an example), which bounds the risk, and the bank reconciles afterwards (see CAP Twelve Years Later).
  • Social Media: Social networking platforms prioritize availability in their news feeds. During network issues, users might see slightly different content than their friends, but the platform remains responsive and engaging. The inconsistency is temporary and rarely impacts user experience significantly.
  • Content Delivery: CDN providers prioritize availability. Edge servers continue serving cached content even when disconnected from origin servers, ensuring websites remain accessible despite network failures.

Is a CA System Possible? (Consistency and Availability)

Choosing CA means giving up partition tolerance: the system aims for strong consistency and high availability and assumes the network won't split. Brewer puts it probabilistically: choosing CA should mean the probability of a partition is far less than that of other systemic failures, such as disasters or multiple simultaneous faults. If a partition does happen, the choice reverts to C or A. In practice, most designs assume that a single datacenter has no partitions within it.

That is why a truly distributed system can't count on CA: partitions across sites or regions can't be ruled out. A system that gives up partition tolerance simply misbehaves when the network splits, so it is effectively CP or AP when tested. Single-node databases look "CA" only because there is no network between nodes to partition.

Where it appears to work:

  • Single-node relational databases: A database on one machine looks CA because there is no network between nodes to partition. Once you replicate it across a network, partitions become possible and you are back to choosing between CP and AP.

How Do You Choose Between CP and AP?

The choice between CP and AP isn't just technical—it's really about business priorities and user expectations. The decision reflects what your organization values most when systems are stressed.

Choose CP when:

  • Data accuracy is mission-critical
  • Temporary outages are acceptable
  • Compliance requires audit trails
  • Financial transactions are involved and errors can't be compensated for afterwards
  • Safety depends on correct information

Choose AP when:

  • User experience is paramount
  • Engagement metrics drive revenue
  • Content is time-sensitive but not critical
  • System responsiveness affects business outcomes
  • Eventual consistency is acceptable

How Do Modern Systems Handle CAP?

Today's systems rarely make pure CAP choices. Instead, they implement nuanced strategies that adjust behavior based on partition severity and business context. Modern document databases, for example, allow administrators to configure read and write concerns, effectively letting applications choose their CAP trade-offs on a per-operation basis.

Many successful companies employ different CAP strategies for different parts of their systems. A common pattern is a strongly consistent store for data where errors are costly, such as balances or inventory, and a highly available store for data where staleness is tolerable, such as caches or feeds.

The emergence of "BASE" (Basically Available, Soft state, Eventual consistency) systems represents a pragmatic middle ground, accepting that perfect consistency isn't always necessary if systems eventually converge to a consistent state.

How Should You Decide?

The CAP theorem doesn't provide easy answers, but it offers crucial clarity about the trade-offs inherent in distributed systems. By understanding your business requirements, user expectations, and tolerance for different types of failures, you can make informed decisions about which properties to prioritize.

Remember that the CAP theorem describes behavior during partition scenarios—periods when your system is already stressed. Your choice reflects not just technical preferences but fundamental business values about what matters most when everything else is falling apart.

In distributed systems, as in business, you can't have everything. The CAP theorem simply makes this reality explicit, forcing us to choose wisely and design accordingly.

Frequently Asked Questions

Does the CAP theorem mean you can only have two of the three properties?

Not exactly. The trade-off applies while the network is partitioned. When the network is healthy, a system can offer both consistency and availability. The PACELC theorem extends CAP to cover the latency and consistency trade-off during normal operation.

Is partition tolerance optional?

No. In a distributed system, network failures happen, so you can't opt out of partitions. The real decision is whether to favor consistency or availability when one occurs.

What is the difference between CAP and PACELC?

CAP describes the trade-off during a network partition. PACELC adds the trade-off between latency and consistency when there is no partition. Read more in the PACELC article.

Are SQL databases CP or AP?

It depends on the deployment. A single-node relational database has no partitions to tolerate. Replicated or clustered setups make the choice through their replication and failover settings.

Further Reading

Facing Distributed Systems Challenges?

If you're dealing with consistency issues, availability concerns, or trying to design resilient systems that handle network failures gracefully, you don't have to figure it out alone. I help teams make informed architectural decisions that align with their business goals.

Get in touch to discuss your specific challenges and explore solutions.