MySQL transaction isolation levels¶
In MySQL, transaction isolation levels determine how transactions are isolated from one another to prevent concurrency issues such as dirty reads, non-repeatable reads, and phantom reads^[600-developer__mysql.md].
The standard transaction properties, often referred to as ACID, include Atomicity, Consistency, Isolation, and Durability^[600-developer__mysql.md].
Isolation Levels¶
MySQL implements the standard SQL isolation levels to balance data consistency and concurrency performance^[600-developer__mysql.md].
-
Read Uncommitted The lowest isolation level where transactions can read uncommitted data from other transactions. This level allows "dirty reads"^[600-developer__mysql.md].
-
Read Committed A transaction can only read data that has been committed by other transactions. This prevents dirty reads but allows "non-repeatable reads"^[600-developer__mysql.md].
-
Repeatable Read The default isolation level for InnoDB^[600-developer__mysql.md]. It ensures that if a row is read twice within the same transaction, the result is consistent, preventing non-repeatable reads^[600-developer__mysql.md].
-
Serializable The highest isolation level. It fully isolates transactions by typically ranging locks on the rows read, preventing phantoms and ensuring complete isolation^[600-developer__mysql.md].
Sources¶
- 600-developer__mysql.md