← Lessons

quiz vs the machine

Gold1500

Concurrency

Serializable Transactions

The strongest isolation, where concurrent transactions behave as if run one at a time.

5 min read · core · beat Gold to climb

The gold standard

A schedule is serializable if its outcome equals some order of running the transactions one after another with no overlap. This is the strongest isolation level and eliminates every concurrency anomaly, including write skew.

Ways to achieve it

Databases reach serializability through different mechanisms.

  • Two phase locking acquires locks in a growing phase and releases them only in a shrinking phase, never reacquiring. This forces a serial order through blocking.
  • Serializable snapshot isolation runs optimistically like snapshot isolation but tracks read write dependencies and aborts transactions that form a dangerous cycle.

Both guarantee the same result as some serial schedule, but they pay for it differently. Locking blocks; the optimistic variant aborts and retries.

The cost

Serializability is not free. It either reduces concurrency through locks or raises abort rates under contention.

  • Strong correctness lets application code ignore subtle anomalies.
  • Throughput suffers when many transactions conflict.

Key idea

Serializable isolation guarantees the outcome matches some one at a time order, removing all anomalies at the cost of blocking or higher abort rates.

Check yourself

Answer to earn rating on the learn ladder.

1. What does serializability guarantee?

2. How does two phase locking enforce serializability?

3. What does serializable snapshot isolation do on a dangerous dependency cycle?