Comparison
Phantom readvsWrite skew
Phantom read
you run the same range query twice in one transaction and the second time there is a new row matching it.
New rows appearing in a range that a repeated query covers, because another transaction inserted them. It is distinct from a non-repeatable read: nothing you already saw changed, the set grew. It is exactly the anomaly that breaks "check nothing exists, then insert", which is why unique constraints are a better answer than a SELECT.
Full entry →Write skew
two transactions each check the same rule, each sees it satisfied, each writes a different row, and together they break the rule.
An anomaly where concurrent transactions read an overlapping set, write disjoint rows, and jointly violate an invariant neither violated alone. The canonical case is two doctors both going off call because each saw the other on call. Snapshot isolation permits it; only serialisable or explicit locking of the read set prevents it.
Full entry →