The problem
Run transactions concurrently for speed and they corrupt each other in subtle ways.
The idea
Isolation levels define which anomalies (dirty reads, lost updates, write skew) are allowed. Serializable is the gold standard.
How it works
Read Committed → Repeatable Read → Snapshot Isolation → Serializable, each forbidding more anomalies. Snapshot Isolation prevents most but allows write skew (two txns read an overlapping set, write different rows, break an invariant). Serializable Snapshot Isolation closes that gap.
The tradeoff
Stronger isolation = more blocking/aborts = less concurrency. Most apps run at Read Committed and don't realize the risks.
In the wild
Postgres SERIALIZABLE uses SSI; "is Snapshot Isolation serializable?" is a classic interview trap (no — write skew).
Deep dive
Flow
- List the invariant each transaction must preserve.
- Pick the weakest level that still protects it.
- Use Snapshot Isolation so readers don't block writers.
- Escalate to Serializable (SSI) where write skew can break the invariant.
Watch for
- Snapshot Isolation allows write skew despite feeling "safe".
- Read Committed (most defaults) permits lost updates and non-repeatable reads.
- Stronger isolation = more aborts/retries — handle them.
Common trap
Answer the trap: Snapshot Isolation is NOT serializable — name write skew as the gap.
Common questions
What problem does Isolation levels & write skew solve?
Run transactions concurrently for speed and they corrupt each other in subtle ways.
How does Isolation levels & write skew work?
Read Committed → Repeatable Read → Snapshot Isolation → Serializable, each forbidding more anomalies. Snapshot Isolation prevents most but allows write skew (two txns read an overlapping set, write different rows, break an invariant). Serializable Snapshot Isolation closes that…
What are the tradeoffs of Isolation levels & write skew?
Stronger isolation = more blocking/aborts = less concurrency. Most apps run at Read Committed and don't realize the risks.
Where is Isolation levels & write skew used in production?
Postgres SERIALIZABLE uses SSI; "is Snapshot Isolation serializable?" is a classic interview trap (no — write skew).