CAP Theorem Deep-Dive and BASE vs ACID
Fast recall
Quick revision
Core answer
TransactWriteItems up to 100 items, and across services the saga pattern with outbox + compensating actions replaces distributed two-phase commit.Whether you can precisely state CAP and ACID guarantees, and explain BASE as a deliberate trade-off rather than a weakness
Confusing CAP's 'Consistency' (linearizability) with ACID's 'Consistency' (constraint preservation), or treating BASE as 'no guarantees at all'
Show saga-vs-2PC pattern, discuss MongoDB multi-doc transactions since 4.0, and explain why CAP's C ≠ ACID's C
Interview-ready guide
Interview answer
Define each precisely
- CAP: during a partition, pick C or A; P is mandatory
- ACID: single-node transaction contract — atomicity, consistency, isolation, durability
- BASE: distributed philosophy — basically available, soft state, eventually consistent
Clarify the C confusion
- CAP's C is linearizability across replicas
- ACID's C is constraint preservation within a transaction
- Different concepts, same letter
Give concrete stores
- ACID strong: Postgres, MySQL, Spanner, MongoDB with majority concerns
- BASE default: Cassandra, DynamoDB, Riak
- Tunable: most modern NoSQL
Mention sagas
- Distributed transactions across services use sagas, not 2PC
- Compensating actions + outbox pattern + idempotence
- Accepts eventual consistency for operational simplicity
CAP Theorem Deep-Dive and BASE vs ACID
Direct Answer
CAP states that during a network partition, a distributed system can guarantee at most two of Consistency, Availability, and Partition tolerance — and since partitions are unavoidable, the real choice is CP or AP during partition. ACID (Atomicity, Consistency, Isolation, Durability) gives transactional guarantees ideal for money movement; BASE (Basically Available, Soft state, Eventually consistent) trades those guarantees for scale and availability. Modern systems mix both — ACID for orders/payments, BASE for counters/caches. MongoDB 4.0+ adds multi-document transactions, DynamoDB supports TransactWriteItems up to 100 items, and across services the saga pattern with outbox + compensating actions replaces distributed two-phase commit.
Common Mistakes & Pitfalls
Confusing CAP's 'Consistency' (linearizability) with ACID's 'Consistency' (constraint preservation), or treating BASE as 'no guarantees at all'
Check your understanding
Answer these without looking back at the article.
- How does the outbox pattern make saga events reliably published?
- What's the cost of MongoDB multi-document transactions versus single-doc writes?
- When would you use Serializable isolation over Repeatable Read in Postgres?
- How do hinted handoff and read repair make Cassandra eventually consistent?
Related interview prep categories
1Looking for a structured roadmap?
Every module on this page is also part of the full Java backend interview track.