Transactions & Concurrency
Serializable Transactions
Serializable isolation permits only outcomes equivalent to a serial execution. Engines achieve it through serial execution, strict two-phase locking, SSI or other validation, trading blocking or aborts for a tractable correctness model.
- Serializable is an outcome guarantee.
- Strict 2PL prevents cycles by blocking.
- SSI detects dangerous dependencies.
- Aborts are part of the API.
- Serializable does not cover the outside world.
| Family | Primary response to conflict | Operational consequence |
|---|---|---|
| Serial execution | Queue work | No concurrency inside partition; transactions must be short |
| Strict 2PL | Wait on incompatible locks | Deadlocks and lock footprint |
| SSI / optimistic validation | Run then abort dangerous structure | More concurrency; retry pressure |
| Deterministic ordering | Preorder operations | Needs known read/write set or coordination |
Start: A=true, B=true; invariant at least one on call.
T1 and T2 read both rows; T1 proposes A=false; T2 proposes B=false.
Serializable outcome: one order may commit; the other must wait and see the new state or abort.
Both may not commit with final A=false, B=false.PostgreSQL Serializable uses SSI over snapshots and reports serialization failures. Oracle Serializable uses transaction-level read consistency and rejects certain conflicting updates. SQL Server Serializable primarily uses key-range locking. Equal labels, different mechanisms and failure surfaces.