Isolation is the transaction property that keeps one transaction from being affected by another transaction still in progress. An isolation level determines how strictly a database enforces that promise. Isolation is distinct from atomicity: a transaction can apply all its changes or none of them while still encountering interference from concurrent transactions. section 6.5 section 6.8
Two inventory updates
Suppose one employee starts a transaction to add 100 units of a product while another starts a transaction to deduct 50. Under a weak isolation level, the second transaction might see the first employee’s uncommitted update—even if that update is later rolled back. A stronger level prevents that particular interference, but may make concurrent work slower. section 6.8
Isolation levels are distinguished by the anomalies they prevent. Read uncommitted prevents dirty writes; read committed also prevents dirty reads. Stronger levels rule out more anomalies. At the highest level, serializability makes concurrent transactions produce the same result as some sequential execution. section 6.9 section 6.9.9
Anomalies give the choice of level a concrete meaning:
- A dirty read observes another transaction’s uncommitted write; a dirty write overwrites a value written by another transaction still in progress. section 6.9.9
- A lost update leaves only one of two competing updates in place. Read skew and write skew describe other ways concurrent work can produce an inconsistent overall result. section 6.9.9 section 6.15
- A phantom read changes the set of rows matching a query between reads in one transaction because another transaction changes the matching rows. section 6.9.9
A changing query result
A transaction queries students in a course, then queries that group again after another transaction changes its membership. The changed result set is a phantom read. Serializability prevents concurrent changes from altering that transaction’s query result in this way. section 6.9.9
Choose an isolation level according to the anomalies an application can tolerate, not simply by picking the strongest available. Stronger guarantees can reduce throughput or introduce delays; weaker guarantees improve performance at the risk of anomalies. Isolation levels concern transactions within a database. Consistency models address the related but different question of what clients observe across replicas. section 6.8 section 6.7














