Skip to content
We areTOP 1%

What is the CAP theorem?

EasyConceptCAP, Consistency & Availability
Track your progress
First attempt
Re-solve after a few days
Final pass before interviews

Answer

The CAP theorem states that when a network partition occurs, a distributed data store must choose between consistency (every read sees the latest write) and availability (every request to a non-failed node receives a non-error response). Partitions cannot be ruled out in real networks, so the practical choice is between CP and AP behaviour during a partition.

  • CP systems (for example, ZooKeeper or HBase) reject or delay some requests rather than return stale data.
  • AP systems (for example, Cassandra at consistency level ONE) keep answering and reconcile divergent replicas later.
  • PACELC extends CAP: even without a partition, a system trades latency against consistency.
  • The C in CAP means linearizability, which is different from the C in ACID.

More in CAP, Consistency & Availability

Sign in to track your progress

Your checkboxes, streak and activity heatmap are saved to your account and sync across devices. It is free.
Sign in with email

New here? Create an account