Short answer
ACID describes guarantees for transactions. Atomicity: all changes commit or none do. Consistency: a transaction moves the database from one valid state to another, respecting constraints. Isolation: concurrent transactions do not see each other’s partial work, according to the isolation level. Durability: committed changes survive crashes.
Isolation levels
- Read uncommitted — may see uncommitted data (dirty reads).
- Read committed — sees only committed data; values can change between reads.
- Repeatable read — rows read stay stable within the transaction.
- Serializable — behaves as if transactions ran one at a time.
Trade-offs
Stronger isolation prevents anomalies but increases locking or retries. Many systems default to read committed and use explicit locking or serializable transactions for critical paths such as payments.
How to answer it in an interview
- Use a bank transfer to explain atomicity.
- Name one anomaly per isolation level, such as lost updates or phantom reads.