Last Minute Notes
  • Github
  • Docs
  • Learn
    @sayanstwt
Lessons
0/37 done
  • CAP & PACELC
  • Consistency Models
  • Time & Ordering
  • Consensus with Raft
  • Locks, Leases & Fencing
  • Isolation Levels & Anomalies
  • 2PC & Sagas
  • Idempotency & Exactly-Once
Learn/System Design/Distributed Systems

Isolation Levels & Anomalies

8 min Advanced 8 steps

Dirty reads, lost updates and write skew, and the level that stops each.

Level
read uncomm.
x committed
10
T1write x = 20T2committedx = 10
normal slow / failed marker
In this lessonStep 1 of 8
  1. The problem
  2. Read committed
  3. Non-repeatable
  4. Phantom
  5. Lost update
  6. Write skew
  7. Levels
  8. Recap
Step 1 / 8problem

Read data that never existed

Isolation defines what concurrent transactions can see of each other.

Here T1 writes x = 20 but has not committed. T2 reads 20 and acts on it. Then T1 rolls back. This is a dirty read.

Key idea

Every isolation level is a promise about which of these anomalies cannot happen.

←→ step·R replay·Space pause

You'll learn

  • Recognise dirty reads and non-repeatable reads
  • See how lost updates happen and three ways to fix them
  • Explain write skew and why snapshot isolation allows it
  • Map each isolation level to the anomalies it prevents
Read the full notesDistributed Systems, 6