ACID Properties — Atomicity, Consistency, Isolation, Durability
Fast recall
Quick revision
Core answer
Whether you understand what each ACID property actually prevents and can connect them to real failure scenarios, not just recite definitions.
Treating the C in ACID as the same as the C in CAP theorem. ACID consistency means schema constraints are honored. CAP consistency means all nodes see the same data. They are completely different concepts.
Explain that isolation is the most expensive property and that databases offer multiple isolation levels as a performance trade-off — most applications run at Read Committed, not Serializable, accepting some anomalies for throughput.
Interview-ready guide
Interview answer
ACID is the set of four guarantees that make database transactions reliable. The bank transfer explains why all four matter — debit account A, credit account B — what happens if the system crashes between those two operations?
Atomicity — all or nothing
- Atomicity means the entire transaction commits or the entire transaction rolls back — so if the system crashes after debiting A but before crediting B, the debit is undone on recovery, which means no money disappears even during a crash
- The database achieves this through a write-ahead log: changes are recorded in the WAL before being applied; crash recovery replays committed transactions and rolls back incomplete ones
Consistency — constraints are always satisfied
- Consistency means a transaction can only bring the database from one valid state to another — schema constraints, foreign keys, and CHECK constraints must all hold after every commit
- This is not the same as the C in CAP theorem — CAP consistency means every read returns the latest write across distributed nodes; ACID consistency means schema rules are not violated within one database
Isolation — concurrent transactions don't interfere
- Isolation means transactions behave as if they ran sequentially, even when running concurrently — which makes it the most expensive property to enforce
- Full isolation (Serializable) prevents all anomalies but adds significant overhead; most databases default to Read Committed, which allows non-repeatable reads; isolation is a dial controlled by the isolation level setting, not a binary switch
Durability — committed data survives crashes
- Once a transaction commits, the data must survive even a power failure — the database flushes the WAL to disk before acknowledging the commit
fsync = offin PostgreSQL disables this guarantee for speed — a commit succeeds in memory but a crash loses it; never do this in production on data you cannot reload
If an interviewer asks which property is most expensive: it's Isolation. The others are mostly about logging; Isolation requires lock management or MVCC overhead that directly impacts throughput.
ACID Properties — Atomicity, Consistency, Isolation, Durability
Direct Answer
ACID is a set of four guarantees that database transactions must satisfy for reliable processing. Atomicity means a transaction fully completes or fully rolls back. Consistency ensures the database moves from one valid state to another, honoring all constraints. Isolation controls how concurrent transactions see each other's changes. Durability guarantees that committed data survives crashes.
Common Mistakes & Pitfalls
Treating the C in ACID as the same as the C in CAP theorem. ACID consistency means schema constraints are honored. CAP consistency means all nodes see the same data. They are completely different concepts.
Check your understanding
Answer these without looking back at the article.
- What is the difference between ACID consistency and CAP consistency?
- How does the write-ahead log enable both atomicity and durability?
- When would you use Serializable isolation instead of Read Committed?
Related interview prep categories
2Looking for a structured roadmap?
Every module on this page is also part of the full Java backend interview track.