← Lessons

quiz vs the machine

Silver1100

Databases

The Isolation Levels Explained

Isolation levels trade correctness against concurrency by defining which interference between transactions is allowed.

4 min read · intro · beat Silver to climb

Why Levels Exist

Perfect isolation is expensive because it forces transactions to wait. The SQL standard defines a ladder of isolation levels so applications can pick how much interference they tolerate in exchange for more concurrency.

The Four Standard Levels

  • Read Uncommitted: a transaction may read data another transaction has written but not committed.
  • Read Committed: a transaction only reads committed data, but values can change between two reads.
  • Repeatable Read: rows you read once keep the same value if you read them again in the same transaction.
  • Serializable: the strongest level, where the result equals some order of running transactions one at a time.

Reading the Ladder

Each step up forbids more anomalies but allows less concurrency. Higher levels need more locking or versioning work, so throughput often drops.

Picking a Level

Many systems default to Read Committed because it blocks the worst surprises cheaply. Reporting or financial logic that must not shift mid transaction reaches for Repeatable Read or Serializable.

Key idea

Isolation levels form a ladder from Read Uncommitted to Serializable, each forbidding more anomalies at the cost of concurrency.

Check yourself

Answer to earn rating on the learn ladder.

1. Which level is the strongest and behaves as if transactions ran one at a time?

2. What is the general tradeoff of moving up the isolation ladder?