What are isolation levels in database transactions?
Answer
Transaction isolation levels define how concurrent transactions see each other's uncommitted changes. From weakest to strongest: Read Uncommitted — can read uncommitted changes (dirty reads possible). Read Committed — only reads committed data (default in PostgreSQL, Oracle) — prevents dirty reads but allows non-repeatable reads. Repeatable Read — same query returns the same rows within a transaction (default in MySQL InnoDB) — prevents dirty and non-repeatable reads but allows phantom reads. Serializable — transactions appear to execute serially — prevents all anomalies but has the most locking overhead. Higher isolation = more correctness but lower concurrency.
Previous
What is denormalization and when is it used?
Next
What are dirty reads, non-repeatable reads, and phantom reads?
More Database Design / Normalization Questions
View all →- Intermediate What are database anomalies and how does normalization prevent them?
- Intermediate What is denormalization and when is it used?
- Intermediate What are dirty reads, non-repeatable reads, and phantom reads?
- Intermediate What is query optimization and what is a query execution plan?
- Intermediate What is a covering index?