# CAP Theorem — System Design: Architecture, Scale and Trade-offs

Source: https://www.skillbyai.com/en/system-design/sd-cap

> Understand the CAP theorem and why distributed systems must choose between consistency and availability during a partition.

## The three letters

**C**onsistency: every read sees the latest write. **A**vailability: every request gets a response. **P**artition tolerance: the system works despite dropped messages between nodes.

## You must tolerate P

Networks fail, so partition tolerance isn't optional in a distributed system. The real choice during a partition is **CP** (reject requests to stay correct) or **AP** (answer with possibly stale data).

## It's per-operation

Real systems mix both: a bank balance is CP, a 'likes' count is AP. Decide per feature, not per company.
