# CAP Theorem

> When a network splits, a system must give up one of two things.

**Field:** Software Development  
**Category:** Architecture  
**Also known as:** CAP, Brewer's Theorem, Consistency Availability Partition Tolerance

## Think of it like

Think of it like two shop tills that lose their link. Either they stop selling, or they risk selling the last item twice.

## Definition

The CAP theorem is about what a system on many machines can promise when its network splits. C is consistency: each read sees the latest write. A is availability: each request gets an answer. P is partition tolerance: the system keeps going through a split. No system can promise all three at once. Since splits do happen, the real choice in one is C or A.

## Example

Lucy's bank app loses the link between its two data centers. It picks C over A. Some customers see an error for a minute, but no balance is ever wrong.

## Why it matters

It explains why some databases refuse writes in a crisis. Others take them and fix things up later.

## Common mistake

Reading it as pick any two of three. Splits are not optional, so when one happens the choice is C or A.

## Three principles

- **Consistency.** Every read is up to date.
- **Availability.** Every request is answered.
- **Choose during a split.** You cannot have both.

## Related terms

- [Distributed System](https://learn.benibix.com/term/development/distributed-system)
- [Eventual Consistency](https://learn.benibix.com/term/development/eventual-consistency)
- [Database](https://learn.benibix.com/term/development/database)
- [Atomicity, Consistency, Isolation, Durability (ACID)](https://learn.benibix.com/term/development/acid)
- [Strong Consistency](https://learn.benibix.com/term/development/strong-consistency)

---

Source: https://learn.benibix.com/term/development/cap-theorem
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
