System Design
4. Database FundamentalsAnimated
Isolation Levels
How much concurrent transactions can see each other's changes.
The idea
From read uncommitted to serialisable, stricter levels prevent more anomalies such as dirty and phantom reads but allow less concurrency.
Watch it work
Press play, pause, or step through. Some animations have settings you can change.
- current message
- earlier
- failure or attack
Txn 1 changes a value but has not committed.
- step:
- 1/5
- from:
- Txn 1
- to:
- Database
1/5
Time runs downward. Solid arrows are requests, dashed arrows are replies.
Step by step
- 1Choose a level
- 2Transactions read according to it
- 3Anomalies are blocked or allowed
- 4Higher isolation lowers throughput
Where it is used
Tuning correctness against speed.
Watch out for
The default level may not be what you assume.