Isolation Level
Isolation levels define visibility between concurrent transactions, from read uncommitted to serializable; higher levels give stronger consistency but lower concurrency.
Purpose
To balance concurrency performance against consistency and choose an appropriate isolation level.
Mechanism
Read uncommitted (dirty reads), read committed (non-repeatable reads), repeatable read (phantom reads), serializable (no anomalies). MVCC implements snapshot isolation (between repeatable read and serializable). PostgreSQL defaults to read committed; MySQL InnoDB to repeatable read.
Use cases
- Concurrent transaction consistency control
- Read committed to avoid dirty reads
- Repeatable read for report consistency
- Serializable strong consistency
Examples
- Input
SET TRANSACTION ISOLATION LEVEL READ COMMITTEDOutputAvoids dirty readsPostgreSQL default
Common errors
- Low isolation levels cause non-repeatable/phantom reads
- Choose the isolation level per business needs
Related terms
ACID
ACID is the four properties of relational transactions: atomicity (all or nothing), consistency (constraints preserved), isolation (concurrency without interference), and durability (committed data is never lost). GLOSSARY
Transaction
A transaction is a group of operations executed as a single logical unit satisfying ACID properties — all or nothing. GLOSSARY