Fundamentals CAP Theorem

CAP Theorem

The fundamental trade-off in distributed systems: you can only guarantee two of three properties.

CA(Not viable)CPAPCAPClick an edge to learn more

The Three Properties

The Key Insight

In practice, Partition Tolerance (P) is mandatory for any distributed system - network failures are a reality. This means your real choice is between CP (consistency over availability) and AP (availability over consistency).

Choosing Between CP and AP

CP
Choose CP when...
  • Wrong data causes real harm (financial transactions)
  • Users expect immediate consistency (booking systems)
  • You need strong guarantees (inventory counts)
  • Data conflicts are hard to resolve
AP
Choose AP when...
  • Availability is critical (always-on services)
  • Eventual consistency is acceptable (social feeds)
  • You can merge conflicts automatically
  • Stale data is better than no data