Skip to main content
ExplainerDistributed SystemsExplainer· 6 min read· in Opinion

Why the CAP Theorem Makes It Impossible for Any Distributed Database to Be Simultaneously Consistent, Available, and Partition Tolerant

A foundational principle of computer science dictates that when a network fails, a distributed database must choose between providing the correct data or providing any data at all. Despite modern engineering claims, the mathematical boundary remains absolute.

By Rohan Kapoor

Pragmatic Engineers 45%Theoretical Purists 35%Eventual Consistency Advocates 20%
Pragmatic Engineers
Argue that modern redundant networks and synchronized clocks make partitions so rare that systems can effectively operate as if they provide both.
Theoretical Purists
Argue that the CAP theorem is an absolute mathematical boundary and that redefining availability obscures the fundamental trade-off.
Eventual Consistency Advocates
Argue that strong consistency is often unnecessary, and systems should default to high availability and resolve data conflicts after the fact.

Perspectives this story doesn't cover

  • End-user application developers
  • Network hardware manufacturers

If you ask a database engineer at a major cloud provider, they will tell you that modern infrastructure has effectively solved the CAP theorem. They point to globally distributed systems like Google's Spanner, which claim to deliver perfect consistency and high availability across continents, arguing that redundant fiber-optic networks have made network partitions so rare that the mathematical trade-off no longer applies in practice. But if you ask a theoretical computer scientist, they will tell you that physics and mathematics do not care about fiber-optic redundancy. They argue that a network partition is not a probability to be minimized but a state that fundamentally exists, and when it occurs, a system must structurally abandon either the accuracy of its data or its ability to respond to users.

The CAP theorem, first conjectured by computer scientist Eric Brewer in 2000 and formally proven by Seth Gilbert and Nancy Lynch of MIT in 2002, establishes an absolute boundary for distributed data stores. The theorem states that a distributed system can provide at most two of three guarantees: consistency, availability, and partition tolerance. Consistency dictates that every read receives the most recent write, ensuring all clients see the identical data simultaneously. Availability requires that every request received by a non-failing node results in a response. Partition tolerance means the system continues to operate despite an arbitrary number of messages being dropped or delayed by the network connecting the nodes.[1][5]

Because distributed systems run on physical networks, and networks are inherently vulnerable to hardware failures, misconfigurations, and severed cables, partition tolerance is not an optional feature. A system must be designed to handle the reality that a connection between two data centers will eventually fail. Therefore, the theorem dictates that when a partition occurs, the system is forced into a binary choice: it can either cancel the operation to ensure consistency, or it can proceed with the operation to ensure availability, risking that the data returned is stale.[3][5]

The CAP theorem dictates that a distributed system can provide at most two of three guarantees.

Consider a simple distributed database with two nodes, Node A and Node B, separated by a network partition. If a user updates their account balance on Node A, that information cannot traverse the severed connection to reach Node B. If another user simultaneously attempts to read the balance from Node B, the system faces an unavoidable dilemma. It can refuse to answer, preserving consistency but sacrificing availability. Alternatively, it can return the old balance, preserving availability but sacrificing consistency. There is no third option where Node B magically divines the new balance without a network connection.[3][5]

In the decades since the theorem was proven, the software industry has largely accepted this limitation, leading to the rise of NoSQL databases that explicitly trade strong consistency for high availability. Systems designed for massive scale often default to "eventual consistency," guaranteeing only that if no new updates are made, all accesses will eventually return the last updated value. This trade-off is considered acceptable for applications like social media feeds or shopping carts, where a temporary discrepancy is preferable to a complete outage.[2][3][4]

This trade-off is considered acceptable for applications like social media feeds or shopping carts, where a temporary discrepancy is preferable to a complete outage.

However, the narrative shifted when Google introduced Spanner, a globally distributed SQL database that manages replicated data at an unprecedented scale. Google claimed that Spanner was both consistent and highly available, leading to widespread speculation that the company had somehow broken the CAP theorem. The secret to Spanner's architecture is TrueTime, a globally synchronized clock system relying on GPS and atomic clocks, combined with a massive, private fiber-optic network that minimizes the reliance on the public internet.[6]

Google engineers acknowledge that Spanner does not violate the laws of mathematics. "The purist answer is 'no' because partitions can happen and in fact have happened at Google, and during some partitions, Spanner chooses C and forfeits A," wrote Eric Brewer in 2017 regarding whether Spanner is truly a consistent and available system. It is technically a CP system—choosing consistency over availability during a partition. However, Google argues that because it controls its entire network infrastructure, the probability of a partition occurring is infinitesimally small, achieving more than five nines of availability, or less than one failure in 100,000.[6]

Cloud providers engineer their networks to achieve 'five nines' of availability, minimizing the practical impact of the CAP theorem.

This pragmatic redefinition of availability shifts the conversation from absolute mathematical guarantees to statistical probabilities. For all practical purposes, users can treat Spanner as if it were a CA system, because the outages are so rare that they become statistically insignificant compared to other sources of application downtime. Yet, critics of this framing argue that redefining availability to mean "highly available most of the time" dilutes the rigorous definition of the CAP theorem, which is concerned with the fundamental behavior of a system during a failure state, not its uptime percentage.[2][6]

As Brewer himself noted in a 2012 retrospective published in IEEE Computer, the original "two out of three" formulation is somewhat misleading because partitions are rare, and systems can optimize for both consistency and availability during normal operations. The theorem prohibits perfect availability and consistency only in the presence of partitions. The modern goal of distributed system design is to maximize combinations of consistency and availability that make sense for the specific application, incorporating plans for operation during a partition and for recovery afterward.[2][4]

The PACELC theorem, introduced in 2010 to build upon CAP, further clarifies this dynamic by stating that even in the absence of partitioning, there is another trade-off between latency and consistency. If a partition occurs, the trade-off is between availability and consistency; else, the trade-off is between latency and consistency. This expanded framework acknowledges that the cost of maintaining perfect consistency across a global network is often measured in milliseconds of delay, which can be just as detrimental to user experience as a brief outage.[4][5]

When a physical connection is severed, a distributed system is forced to choose between consistency and availability.

The debate over the CAP theorem highlights a broader tension in computer science between theoretical absolute limits and practical engineering solutions. While companies like Google and Amazon continue to push the boundaries of what is possible with redundant hardware, atomic clocks, and sophisticated consensus algorithms, the mathematical reality remains unchanged. The theorem stands as a permanent boundary condition for distributed architecture.[3][6]

When the fiber gets cut and the nodes cannot communicate, a choice must be made. The system can be right, or it can be available, but it cannot be both. The engineering triumphs of the modern cloud have not eliminated the CAP theorem; they have merely made the partitions so rare that we can afford the luxury of pretending the theorem does not exist.[1][6]

Key points

  1. The CAP theorem proves that a distributed database can provide at most two of three guarantees: consistency, availability, and partition tolerance.
  2. Because network partitions are inevitable in distributed systems, databases must structurally choose between consistency and availability when a failure occurs.
  3. Systems prioritizing consistency will return an error or timeout during a partition, ensuring no stale data is read.
  4. Systems prioritizing availability will return the most recent accessible data, risking that the information is outdated.
  5. Modern databases like Google Spanner minimize the probability of partitions using redundant networks, but they still technically forfeit availability if a total partition happens.

Key terms

Distributed System
A network of independent computers that work together to appear as a single coherent system to the end user.
Consistency
The guarantee that every read from a database receives the most recent write, ensuring all users see the same data simultaneously.
Availability
The guarantee that every request received by a non-failing node in the system results in a response, even if the data is not the most recent.
Partition Tolerance
The ability of a distributed system to continue operating despite an arbitrary number of messages being dropped or delayed between nodes.
PACELC Theorem
An extension of the CAP theorem stating that even when the network is functioning normally, a system must trade off between latency and consistency.

Frequently asked

What does the CAP theorem stand for?

The CAP theorem stands for Consistency, Availability, and Partition tolerance. It states that a distributed data store can provide at most two of these three guarantees simultaneously.

What is a network partition?

A network partition occurs when a communication failure, such as a severed cable or a misconfigured router, prevents two or more nodes in a distributed system from sending messages to each other.

How does Google Spanner handle the CAP theorem?

Google Spanner is technically a CP system, meaning it chooses consistency over availability during a network partition. However, Google uses highly redundant private networks to make partitions so rare that the system appears to offer both.

What is eventual consistency?

Eventual consistency is a design choice where a system guarantees that, if no new updates are made, all nodes will eventually reflect the same data. It prioritizes availability over immediate consistency.

Sources

Source coverage

7 outlets

3 viewpoints surfaced

Pragmatic Engineers 45%Theoretical Purists 35%Eventual Consistency Advocates 20%
  1. [1]ACM SIGACT NewsTheoretical Purists

    Brewer's conjecture and the feasibility of consistent, available, partition-tolerant web services

    Read on ACM SIGACT News
  2. [2]IEEE ComputerEventual Consistency Advocates

    CAP Twelve Years Later: How the "Rules" Have Changed

    Read on IEEE Computer
  3. [3]Amazon Web ServicesPragmatic Engineers

    CAP theorem - Availability and Beyond: Understanding and Improving the Resilience of Distributed Systems on AWS

    Read on Amazon Web Services
  4. [4]IEEE ComputerEventual Consistency Advocates

    Consistency Tradeoffs in Modern Distributed Database System Design: CAP is Only Part of the Story

    Read on IEEE Computer
  5. [5]IBMTheoretical Purists

    CAP Theorem

    Read on IBM
  6. [6]Google CloudPragmatic Engineers

    Inside Cloud Spanner and the CAP Theorem

    Read on Google Cloud
  7. [7]Factlen Editorial TeamEventual Consistency Advocates

    Synthesis by Factlen editorial team

    Read on Factlen Editorial Team

Comments

Stay informed

Every angle. Every day.

Get Opinion stories with full source coverage and perspective breakdowns delivered to your inbox.