Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

The CAP theorem says that when a network partition prevents parts of a distributed service from communicating, the service cannot guarantee both a response to every request and the strongest form of consistency for every operation. It must either refuse or delay requests it cannot complete safely, or respond with data that may be stale or conflict with other replicas. The choice is about behavior during a partition—not a permanent decision to “pick two” in every operating condition.

What CAP means—and what it does not

CAP describes a distributed service that implements a read/write object and must operate despite communication failures. Gilbert and Lynch’s formal treatment says it is impossible to guarantee both atomic consistency and a response to every request in all such executions. The result is scoped to the service’s semantics; it is not a blanket rule that every distributed system or operation must make the same tradeoff. Gilbert and Lynch’s formal treatment explains the theorem in this context.

  • Consistency (C): responses satisfy the service’s correctness and ordering requirement. In the classic read/write case, a read should reflect the required latest operation order. The meaning depends on the service.
  • Availability (A): every request to a non-failing node eventually receives a response. This formal liveness property does not promise a response within a particular timeout or an uptime percentage.
  • Partition tolerance (P): the system is considered in the presence of communication failures, such as server groups being unable to communicate, or messages being delayed or lost.

In normal operation, consistency and availability can coexist. The impossibility appears when a partition occurs and the separated parts cannot coordinate. The Cambridge critique of common CAP explanations cautions that “pick any two” can mislead, in part because the definitions of consistency and availability have been debated. The Cambridge critique discusses those limits.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

CAP consistency is not ACID consistency

These are different uses of the word consistency. In CAP, consistency concerns the correctness and ordering of operations across a distributed service, often described using atomic consistency or linearizability. In ACID, consistency means that a transaction preserves application-defined rules and constraints. When discussing CAP, specify which distributed-operation guarantee the service offers; do not assume the term means the ACID property.

CAP availability is not an uptime target

A request that eventually receives a response can still be too slow to be useful. CAP’s formal definition sets no response-time bound. Operational service objectives usually measure successful responses over time and often require a response before a timeout. A design can therefore meet the formal eventual-response condition yet fail a user-facing latency or uptime objective.

What happens to replicas during a partition?

Imagine two replicas holding a bank-account balance. A partition isolates them, so neither can learn what the other is doing. If both accept writes and answer independently, their values can diverge; the service may later need to reconcile the changes or expose a conflict. If the service must prevent incompatible updates, it can reject or delay writes on the isolated side until it can safely coordinate.

That is the practical tradeoff: preserving the consistency guarantee can mean withholding a response, while answering despite lost coordination can mean returning stale or conflicting data. AWS describes the same consequence: a workload prioritizing availability may answer with potentially inconsistent data, while one prioritizing consistency may return an error when it cannot guarantee consistent data. AWS’s CAP explanation outlines this behavior.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How to interpret CP and AP

CP and AP are shorthand for a system’s behavior under partition, not complete or permanent labels for a database. A CP-style behavior preserves the consistency guarantee by rejecting, blocking, or delaying operations that cannot safely complete. An AP-style behavior prioritizes responses from reachable parts of the system, accepting weaker consistency and potentially requiring later reconciliation.

Actual behavior can vary by operation, configuration, and the system’s baseline consistency guarantee. A label alone does not tell you which reads or writes remain available, how stale a response may be, or how conflicts are resolved. Ask about the specific operation and failure mode rather than treating a vendor’s broad classification as a specification.

Use requirements to make the design choice

CAP is most useful when translated into the application’s correctness and user-experience requirements. Work through these questions for the operations that matter:

  1. Which values must be current and globally ordered? Identify reads and writes that cannot tolerate stale data or concurrent conflicting updates.
  2. What should callers see during a partition? Decide whether the service should return an error, wait for coordination, or provide a best-effort response.
  3. Can the application merge or reconcile changes? If it can, specify how conflicts are surfaced and resolved; if it cannot, avoid accepting independent updates that could violate an invariant.
  4. What latency is acceptable in normal operation? Set a response-time objective separately from the partition-time policy, and make clear whether success is measured against a timeout.
  5. Does the policy vary by operation or failure mode? Document the guarantees and response behavior for each relevant read and write, including configuration assumptions.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

PACELC adds the normal-operation latency tradeoff

PACELC extends the CAP lens. Its shorthand is: if there is a Partition, choose between Availability and Consistency; Else, under normal operation, consider Latency versus Consistency. Stronger coordination can require extra network round trips and increase response time. Relaxing coordination can reduce latency while providing weaker guarantees. Daniel J. Abadi introduced the framing in his PACELC paper.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

PACELC complements CAP; it does not replace defining what correct behavior means for the workload. When comparing designs, evaluate the partition-time response policy, the consistency model and its scope, normal-operation latency, and the conflict-handling work left to the application. Tie any classification to the particular operation, configuration, and system version being evaluated.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.