← Lessons

quiz vs the machine

Gold1500

Databases

ACID & isolation levels

What 'isolation' actually buys you, and what it costs.

6 min read · core · beat Gold to climb

ACID in one breath

Atomicity (all-or-nothing), Consistency (constraints hold), Isolation (concurrent txns don't corrupt each other), Durability (committed = survives a crash).

Isolation is the one with knobs. Higher isolation = fewer anomalies but more locking/contention.

The anomalies each level removes

  • Read Committed stops dirty reads.
  • Repeatable Read stops non-repeatable reads.
  • Serializable stops phantoms — behaves as if txns ran one at a time.

Key idea

You pick the lowest isolation level that still prevents the anomalies your workload cares about. Defaulting to Serializable everywhere is correct but often needlessly slow.

Check yourself

Answer to earn rating on the learn ladder.

1. Which isolation level prevents phantom reads?

2. The 'D' in ACID guarantees…