Print · CAP theorem
Back to study12 cards · 2 sheets · 4 pages.
Print double-sided, flipping on the long edge, at 100% scale with no margins added by the browser. Answer columns are already mirrored, so each answer lands on the back of its own question. Cut along the dashed lines. The last sheet has 4 blank cells, since this deck is not a multiple of eight.
Preview
What do the three letters in CAP stand for?
CAP theorem in one sentence?
Define consistency (in CAP terms).
Define availability (in CAP terms).
Define partition tolerance.
Why is 'CA' not a real choice for distributed systems?
Name some CP systems.
Name some AP systems.
During a network partition, a distributed system must choose between consistency and availability — it can't have both.
Consistency, Availability, Partition tolerance. A distributed system can only guarantee two of the three at once.
Every request to a non-failing node gets a non-error response — though the data may be stale.
Every read receives the most recent write or an error. All nodes appear to hold one up-to-date value (linearizability).
Network partitions are unavoidable in any real network, so P is mandatory. The actual trade-off is only C vs A during a partition.
The system keeps operating even when network failures split nodes into groups that can't communicate.
Cassandra, DynamoDB (default reads), CouchDB, DNS. They stay responsive and reconcile conflicts later (eventual consistency).
ZooKeeper, etcd, HBase, MongoDB (default config), Google Spanner. They refuse or delay requests rather than serve stale data.
What is PACELC?
When should you choose CP in a system design interview?
When should you choose AP?
How does CAP consistency differ from ACID consistency?
When stale or conflicting data causes real harm: ticket booking, inventory, payments, auction bids, distributed locks, leader election.
If Partition: choose Availability or Consistency. Else (normal operation): choose Latency or Consistency. It covers the trade-off even when the network is healthy.
CAP consistency = linearizable reads across nodes. ACID consistency = database invariants and constraints hold after a transaction. Different concepts sharing a letter.
When stale reads are harmless: feeds, like counts, view counters, profiles, analytics. Most systems default to availability.