Skip to main content
Fundamentalschapter 6 of 6 · 4 lessons

Database Isolation Levels

Control how much concurrent transactions can see each other's intermediate state.

Two people click buy on the last ticket at the same instant. Your database runs both transactions at once, because running them one after another would be far too slow, and now the two are looking at each other's half-finished work.

Isolation levels are the fine print on how much they are allowed to see. Every level answers one question differently: which strange results will you tolerate in exchange for running more transactions at a time? Get the answer wrong and you sell the same seat twice.

Lessons

4 in this chapter
  1. The Anomalies and the LadderFour named ways concurrent transactions corrupt each other, and the four levels that close them.2 min
  2. Read Committed, the WorkhorseYou only see committed data, and that is the entire promise.2 min
  3. Repeatable Read and SnapshotsOne snapshot for the whole transaction: your reads stay frozen in time.2 min
  4. Serializable, and When to Pay for ItFull correctness, purchased with retries. Spend it on the transactions that deserve it.2 min