CAP Theorem
Consistency (C)
Every read receives the most recent write or an error. All nodes see the same data at the same time.
Availability (A)
Every request receives a non-error response, without guarantee it contains the most recent write.
Partition Tolerance (P)
System continues to operate despite network partitions between nodes.
CP Systems
Choose consistency over availability during partitions. Examples: HBase, MongoDB (default), Redis Cluster, Zookeeper.
AP Systems
Choose availability over consistency during partitions. Examples: Cassandra, DynamoDB, CouchDB, Riak.
CA Systems
Only possible without partitions (single-node). Examples: Traditional RDBMS (PostgreSQL, MySQL single-node).
PACELC Extension
If Partition → choose A or C; Else (normal) → choose Latency or Consistency. More practical than CAP alone.
Real-World Tradeoff
Most systems are tunable — e.g., Cassandra lets you choose consistency level per query (ONE, QUORUM, ALL).