The CAP theorem, also known as Brewer's theorem, states that a distributed data system can provide at most two out of three guarantees: Consistency (every read receives the most recent write), Availability (every request receives a non-error response), and Partition tolerance (the system continues operating despite network failures that split nodes). This trilemma forces architects to choose which guarantee to sacrifice based on their application's requirements, making it a critical design consideration for databases and distributed services.
Glossary
CAP Theorem

What is CAP Theorem?
The CAP theorem is a foundational principle in distributed computing that defines the inherent trade-offs in designing networked data stores.
In practice, partition tolerance is non-negotiable for systems operating across networks, reducing the choice to favoring either Consistency or Availability during a partition. CP systems (like ZooKeeper, etcd) prioritize consistency, potentially returning errors or timing out during partitions. AP systems (like DynamoDB, Cassandra) prioritize availability, serving potentially stale data to remain responsive. Modern databases often offer tunable consistency levels, allowing developers to adjust this trade-off dynamically based on the operation.
The Three Guarantees of CAP
The CAP theorem (Consistency, Availability, Partition tolerance) is a fundamental trade-off in distributed systems design. A system can guarantee only two of these three properties simultaneously when a network partition occurs.
Consistency (C)
Consistency guarantees that every read operation receives the most recent write or an error. It provides a linearizable view of the data across all nodes in the system. After a successful write, all subsequent reads—regardless of which node they hit—will reflect that update.
- Mechanism: Often enforced via atomic broadcast protocols or quorum-based read/write operations (e.g., R + W > N).
- Trade-off: Choosing Consistency alongside Partition tolerance (CP) means the system may become unavailable during a network partition to prevent returning stale data.
- Example: A financial ledger system where reading an account balance must always show the result of the last transaction.
Availability (A)
Availability guarantees that every request to a non-failing node receives a (non-error) response, without the guarantee that it contains the most recent write. The system remains operational for both reads and writes even during a network partition.
- Mechanism: Achieved by allowing nodes to operate independently, often using techniques like hinted handoff and sloppy quorums.
- Trade-off: Choosing Availability alongside Partition tolerance (AP) means the system may return stale data during a partition to ensure it continues serving requests.
- Example: A social media timeline or a product catalog where high uptime is prioritized over immediate global consistency.
Partition Tolerance (P)
Partition tolerance is the system's ability to continue operating despite an arbitrary number of messages being dropped or delayed between network nodes. A network partition is a break in communication, splitting the system into isolated subgroups.
- Fundamental Constraint: In a distributed system, network partitions are a fact of life, not a choice. The theorem therefore states you must design for Partition tolerance and choose between Consistency and Availability when a partition occurs.
- Mechanism: Systems achieve this through replication and decentralized coordination, often using consensus algorithms or conflict-free data types (CRDTs) for state reconciliation after the partition heals.
The Impossibility Triangle
The core assertion of the CAP theorem is the impossibility of simultaneously achieving all three guarantees in the presence of a network partition.
- CP Systems: Sacrifice Availability for Consistency. During a partition, nodes on the minority side will stop responding to requests to avoid serving stale data. Examples include ZooKeeper, etcd, and traditional databases using Paxos or Raft for consensus.
- AP Systems: Sacrifice Consistency for Availability. All nodes remain responsive, but may return divergent, stale, or conflicting data. Examples include DynamoDB, Cassandra (with tunable consistency), and Riak.
- CA Systems: Sacrifice Partition tolerance. These are single-node or tightly-coupled clusters that assume a reliable network. They are not truly distributed in the CAP sense. Most single-master relational databases (e.g., a standalone PostgreSQL instance) are CA systems.
PACELC Extension
The PACELC theorem extends CAP by addressing system behavior both during and in the absence of partitions.
- If a Partition (P) occurs, trade off between Availability and Consistency (as in CAP).
- Else (E), when the system is running normally, trade off between Latency and Consistency.
- This framework more accurately describes real-world system design. For example:
- Dynamo-style systems are PA/EL: Prioritize Availability if a Partition occurs, and low Latency otherwise, sacrificing some Consistency.
- BigTable/HBase are PC/EC: Prioritize Consistency if a Partition occurs (become unavailable), and Consistency otherwise, accepting higher Latency for strong guarantees.
Modern Interpretations & Nuances
Modern distributed databases often provide tunable consistency models, allowing developers to choose the appropriate trade-off per operation.
- Eventual Consistency: A weak consistency model where, if no new updates are made, all replicas will eventually converge to the same state. This is common in AP systems.
- Strong vs. Eventual: The choice is not binary. Systems offer a spectrum (e.g., causal consistency, session consistency).
- Critical Insight: The '2 of 3' formulation is a simplification. In reality, the trade-off is between consistency and availability during a partition. Engineers design for graceful degradation and configurable behavior rather than a fixed, global choice.
CAP Trade-offs in Practice
A comparison of common distributed system architectures and their practical trade-offs regarding the CAP theorem's guarantees of Consistency, Availability, and Partition tolerance.
| System Property / Pattern | CP (Consistency & Partition Tolerance) | AP (Availability & Partition Tolerance) | CA (Consistency & Availability) |
|---|---|---|---|
Primary Design Goal | Strong data correctness during network splits | Maximize system uptime and responsiveness | Data correctness with full network connectivity |
Read Behavior During Partition | Returns error or times out | Returns potentially stale data | Not applicable (assumes no partition) |
Write Behavior During Partition | Rejects writes to minority partition | Accepts writes on all partitions, risking conflicts | Not applicable (assumes no partition) |
Conflict Resolution | Avoids conflicts via write coordination | Requires application-level merge logic (e.g., CRDTs, Last-Write-Wins) | Centralized; no conflict by design |
Example Technologies | Google Spanner, Apache HBase, ZooKeeper | Amazon DynamoDB, Apache Cassandra, Riak | Single-node databases (PostgreSQL, MySQL), traditional monolithic apps |
Latency Profile | Higher latency due to coordination | Lower latency for reads and writes | Lowest latency (single data source) |
Scalability Model | Vertically scalable or limited horizontal scale | Highly horizontally scalable | Limited to vertical scaling |
Fault Tolerance to Node Loss | Tolerates f failures out of 2f+1 nodes | Tolerates node loss without blocking reads/writes | Single point of failure; node loss causes downtime |
Frequently Asked Questions
The CAP theorem is a foundational principle in distributed systems theory that defines the inherent trade-offs in designing data stores. It is critical for architects of agentic systems, which are inherently distributed, to understand these constraints when designing for consistency, availability, and fault tolerance.
The CAP theorem is a fundamental principle stating that a distributed data store can provide, at most, only two of the following three guarantees simultaneously: Consistency, Availability, and Partition tolerance. It is a trade-off theorem, not a choice of three, as partition tolerance is a network reality that must be designed for, forcing a choice between Consistency and Availability during a network partition.
In practice, this means system architects must decide on their system's primary behavior when communication between nodes fails: either maintain strong consistency by making some data unavailable (CP) or maintain availability for all requests at the cost of serving potentially stale or inconsistent data (AP).
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
The CAP Theorem is a cornerstone of distributed systems theory, but its implications are deeply connected to other critical concepts in consensus, consistency, and fault tolerance.
Eventual Consistency
A consistency model for distributed systems where, in the absence of new updates, all replicas will eventually converge to the same state. This is the typical choice for AP (Availability & Partition Tolerance) systems under the CAP Theorem, allowing high availability during network partitions at the cost of temporary read inconsistencies. Examples include DNS and many NoSQL databases like Amazon DynamoDB and Apache Cassandra.
Strong Consistency
A guarantee that any read operation will return the most recent write for a given data item, providing a linearizable view of the data. This is the model chosen for CP (Consistency & Partition Tolerance) systems under the CAP Theorem, ensuring data correctness at the potential cost of availability during a network partition. It is enforced by protocols like Paxos and Raft, and is critical for systems like financial ledgers.
Byzantine Fault Tolerance (BFT)
A property of a distributed system enabling it to reach consensus and function correctly even when some components fail or act maliciously (arbitrary or Byzantine faults). While CAP deals with network partitions and non-malicious crashes, BFT addresses a harsher fault model. Practical implementations like PBFT are foundational for blockchain and critical financial systems, extending reliability guarantees beyond CAP's scope.
Conflict-Free Replicated Data Types (CRDTs)
Data structures designed for distributed systems that guarantee eventual consistency and can be updated concurrently without coordination, automatically resolving conflicts. CRDTs are a practical engineering solution that operates under the AP side of the CAP Theorem, enabling collaborative applications (like Google Docs or distributed counters) where availability is paramount and merges must be deterministic.
PACELC Theorem
An extension of the CAP Theorem that adds the trade-off between Latency and Consistency when the system is Partition-free (Else). It formalizes the idea that even without partitions, distributed systems must choose between low-latency operations and strong consistency. The full formulation is: if Partition (P), choose between Availability (A) and Consistency (C); Else (E), choose between Latency (L) and Consistency (C).
Vector Clocks
A mechanism for tracking causality and partial ordering of events in a distributed system. They enable the detection of concurrent updates and are crucial for implementing systems that favor availability (AP). When a partition heals, vector clocks help reconcile what happened, identifying whether updates were concurrent (requiring conflict resolution) or causally related, providing a logical foundation for eventual consistency.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us