Skip to content
GK LibraryA home for curious minds
English

The Dilemma of Distributed Systems: The CAP Theorem

You press the checkout button at an online store, and an item that showed as “in stock” is suddenly sold out. That is because another server still held the old inventory. When many computers work together as a single service, it is hard to promise all three at once: that the data is always the same, that a response always comes back, and that the network never breaks. The theorem that sums up this dilemma in one line is the “CAP theorem.”

Put simply, the CAP theorem is the claim that “a distributed system cannot guarantee consistency, availability, and partition tolerance all at the same time.” Eric Brewer proposed it in a keynote at PODC in 2000, and Seth Gilbert and Nancy Lynch formally proved it in 2002.

This article lays out, in an easy-to-understand way, everything from the background and precise definition of the CAP theorem to the meaning of the three letters C, A, and P, why all three are impossible at once, and how the theorem should be read in practice.


The CAP Theorem: Three Promises a Distributed System Faces

What Is the CAP Theorem?

CAP theorem diagram showing consistency, availability and partition tolerance.

A distributed system is not a single computer but a structure in which multiple nodes are connected over a network. As services such as online stores, messengers, and cloud databases grow larger, it becomes natural to spread data across several places. The problem is that communication between nodes is not always perfect. When a cable is cut, latency spikes, or some servers stop responding, a “partition” occurs.

Brewer grouped the three properties that a system cannot keep at the same time in such an environment as C, A, and P. The core message is simple: when a network partition actually occurs, you must give priority to either consistency or availability. It is often summed up as “pick two out of three,” but modern interpretations treat partition tolerance as an essentially mandatory premise and read the theorem as a trade-off between C and A.

Related concepts worth keeping in mind when reading this theorem are as follows.

  • Distributed System: a structure in which several computers cooperate as if they were a single service.
  • Node: an individual server or process taking part in that cooperation.
  • Replication: a method of copying the same data onto several nodes.
  • Trade-off: a relationship in which strengthening one property means giving up another.

C, A, P: The Precise Meaning of the Three Letters

Translating the three letters into everyday language makes the concepts clearer.

(1) Consistency
It is the promise that all nodes see the same, latest value at the same time. If the stock is reduced to 1 in one place, a query made right afterward somewhere else must also return 1. The C in CAP is close to “strong consistency” in database theory and is distinct from looser forms of consistency that only become the same eventually.

(2) Availability
It is the promise that any node that is alive always responds to requests. It means that “the result of a read or write comes back” without failure or timeout, not that the result is always the latest. Getting an answer, however slowly, and being refused outright are different choices.

(3) Partition Tolerance
It is the promise that even when communication between nodes is cut, the system keeps working without stopping. In real-world internet and data center environments, partitions are not rare, so most large-scale services find it hard to give up P.

As a simple analogy, imagine two bank branches connected only by a telephone line. If, at the moment the line goes dead (a partition), both branches keep allowing withdrawals (availability), their balances can drift apart (consistency is lost); if they halt transactions to keep the balances matched (consistency is maintained), customers get turned away (availability is lost).


Why You Cannot Have All Three at Once

When the network is partitioned, groups of nodes cannot confirm each other’s latest state. At that point, there are roughly two paths to choose from.

(1) Choosing CP
To preserve consistency, you must not allow writes without knowing the state on the other side. So some requests are rejected or made to wait. The data stays correct, but at that moment the service may appear to be “not responding.” Traditional consensus-based databases and systems that emphasize strong consistency are closer to this side.

(2) Choosing AP
To preserve availability, each node responds using only the information it has. The service stays open, but different nodes may show different values until the partition is resolved. This is often paired with an “eventual consistency” strategy, in which the values are reconciled later through synchronization and conflict resolution.

The term “CA system” also appears in textbooks, but it is closer to an idealization that assumes an environment in which partitions never occur. It may be roughly achievable on a single machine or a very stable local cluster, but in wide-area distributed systems, P is hard to ignore. So the practical question is less “Which of C, A, and P should we drop?” and more “When a partition comes, how much of C or A should we give up?”


How to Read CAP in Practice

The CAP theorem is a powerful insight, but it is not a one-size-fits-all label. Brewer himself later reflected in writing that the “2 out of 3” slogan had caused misunderstanding. Modern systems also need the following complementary perspectives.

  • A matter of degree: consistency and availability are not switches you turn on and off but a spectrum. Mixes such as relaxing only reads while keeping writes strong are common.
  • Relationship with latency: PACELC, formulated by Daniel Abadi, holds that even when there is no partition (Else), there is a choice between latency and consistency.
  • Priorities by task: flows involving money, such as payments and inventory, tend to lean toward C, while flows that can tolerate slight delays, such as feeds and view counts, tend to lean toward A.

Rather than settling it in one word, such as “our system is CP” or “AP,” designers should spell out concretely which operations guarantee what under which conditions. CAP is not a law that takes choices away but a map that reveals the limits of distributed environments in advance.

The CAP theorem is not a warning that “there is no perfect distributed system.” It is an invitation to accept the limits, then design compromises that fit your business. Assuming the network will break and deciding in advance whether to protect consistency or availability is the first step toward stable distributed design.

Keep this article as a PDF

Buy the selected-language edition of the article you are reading.

US$1.00
Selected language: English

US$1.00 · one article · one language

Choose how to buy

Buy as a member
  • Log in on any device to download again
  • Kept in your purchase history
Buy without an account
  • Pay right away with no sign-up
  • Download again in this browser
  • On other devices, use the personal link shown after purchase
  • If you later log in as a member in this browser, your purchases move to your account
  • If you lose the link and clear this browser’s cookies, downloading again may not be possible

Checking your purchases…

Seller information

Business name
아카이지
Representative
안호원
Business registration No.
530-02-04118
Mail-order sales report No.
2026-경기군포-0626
Reporting authority
경기도 군포시
Business address
경기도 군포시 산본천로 119-9, 1109동 405호 (산본동, 주공아파트)
Hosting provider
카페24(주)
Contact email
sgjjojo@gmail.com
Contact number
010-4194-0821

Verify seller information (Korea FTC)