The 1992 ANSI SQL standard defined transaction isolation in terms of three phenomena: Dirty Read ($P1$), Non-repeatable Read ($P2$), and Phantom Read ($P3$).
In their seminal 1995 paper, Berenson, Gray, and colleagues demonstrated that these definitions are fatally flawed: they are ambiguous, fail to prohibit critical race conditions, and leave multi-version concurrency control (MVCC) engines in an architectural gray area.
The Phenomenon Taxonomy Failure
ANSI SQL defined phenomena using strict equality checks:
- $A1$ (Dirty Read): $T1$ modifies a data item, $T2$ reads it, and $T1$ rolls back.
- $A2$ (Non-repeatable Read): $T1$ reads a data item, $T2$ modifies it and commits, and $T1$ re-reads a different value.
- $A3$ (Phantom): $T1$ reads a set of rows satisfying a search condition, $T2$ creates new rows satisfying that condition and commits, and $T1$ repeats the query with different results.
The authors showed that the broader phenomena ($P1, P2, P3$) can occur even when the specific anomalies ($A1, A2, A3$) are avoided!
The Discovery of Write Skew
The most famous contribution of this paper is the formalization of Write Skew:
What is Write Skew?
Write skew occurs when two concurrent transactions read overlapping datasets, make disjoint local updates, and commit — resulting in an invalid global state that violates a database invariant.
Classic Example: On-Call Doctors
Imagine a hospital rule requiring at least one doctor on call:
- Doctors Alice and Bob are currently on call.
- Alice requests leave: $T1$ queries
SELECT COUNT(*) FROM doctors WHERE on_call = true. The count is $2$. - Concurrently, Bob requests leave: $T2$ queries
SELECT COUNT(*) FROM doctors WHERE on_call = true. The count is $2$. - $T1$ updates Alice to
on_call = falseand commits. - $T2$ updates Bob to
on_call = falseand commits. - Result: Zero doctors are on call!
Under Snapshot Isolation, neither transaction experienced dirty reads, non-repeatable reads, or phantoms, yet the interleaved execution is not serializable.
Architectural Implications for Modern Systems
- PostgreSQL & MySQL: Snapshot Isolation is marketed as
REPEATABLE READ. It prevents phantoms in point queries, but does not protect against Write Skew. - True Serializability: Requires two-phase locking (2PL) with predicate locks, or Serializable Snapshot Isolation (SSI) which tracks read-write dependency cycles (rw-antidependencies) in a graph and aborts transactions that form cycles.