Skip to content

Transactions and isolation anomalies

Trace concurrent schedules, distinguish isolation anomalies, protect reservation invariants, and compare measured B-tree and LSM write costs.

28 min8 steps

By the end you can
  • Distinguish dirty reads, non-repeatable reads, phantoms, lost updates and write skew
  • Choose constraints, locking or serializable execution for a reservation race
  • Choose optimistic or pessimistic concurrency control and handle aborts
  • Calculate physical write volume from measured B-tree and LSM amplification

Atomic is not the same as isolated

Atomicity: commit or abort as a unit. Isolation: what concurrent transactions can see. Durability: survives failure after ack. None sends an email atomically. Write the invariant first.

Txn 1DatabaseTxn 2seat A12 free?seat A12 free?reserve A12reserve A12
Each commits atomically; the invariant still breaks.

Two atomic transactions each read that a seat is free, then both create a reservation. What is missing from the claim that atomicity alone makes this safe?

Answer this step to continue.