The gold standard
A schedule is serializable if its outcome equals some order of running the transactions one after another with no overlap. This is the strongest isolation level and eliminates every concurrency anomaly, including write skew.
Ways to achieve it
Databases reach serializability through different mechanisms.
- Two phase locking acquires locks in a growing phase and releases them only in a shrinking phase, never reacquiring. This forces a serial order through blocking.
- Serializable snapshot isolation runs optimistically like snapshot isolation but tracks read write dependencies and aborts transactions that form a dangerous cycle.
Both guarantee the same result as some serial schedule, but they pay for it differently. Locking blocks; the optimistic variant aborts and retries.
The cost
Serializability is not free. It either reduces concurrency through locks or raises abort rates under contention.
- Strong correctness lets application code ignore subtle anomalies.
- Throughput suffers when many transactions conflict.
Key idea
Serializable isolation guarantees the outcome matches some one at a time order, removing all anomalies at the cost of blocking or higher abort rates.