Get the App
SLTechnology News&Howtos  ›  Database  › 

An overview of four isolation levels of mysql database transactions

Shulou Source: shulou.com Published: 2022-06-01 20:40:50 11月13日 Update

The following content mainly gives you an overview of the four isolation levels of mysql database things. the knowledge mentioned here, which is slightly different from books, is summed up by professional and technical personnel in the process of contact with users, and has a certain value of experience sharing. I hope to bring help to the majority of readers.

There are four isolation levels for mysql database transactions, and the default transaction level is' REPEATABLE-READ', which is repeatable. The following article will take you to understand the isolation levels of these four transactions in mysql. I hope it will be helpful to you.

The SQL standard defines four types of isolation levels, including specific rules that define which changes inside and outside the transaction are visible and which are not. Low-level isolation levels generally support higher concurrent processing and have lower system overhead.

Four transaction isolation levels for mysql, as follows:

1. Uncommitted reads (Read Uncommitted): dirty reads are allowed, that is, data modified by uncommitted transactions in other sessions may be read

2. Read Committed: only the data that has been submitted can be read. Most databases, such as Oracle, default to this level (do not repeat)

3. Repeated Read: repeatable. All queries within the same transaction are consistent at the beginning of the transaction, the default level of InnoDB. In the SQL standard, this isolation level eliminates unrepeatable reads, but there are phantom reads, but innoDB solves phantom reads

4. Serial read (Serializable): fully serialized read, each read needs to acquire a table-level shared lock, and reads and writes will block each other.

These are the details of the 4 isolation levels of mysql database transactions. For more information, please follow other related articles!

Tags: Levels isolation transactions data databases things profiles that is content that is articles standards processing help different low-level consistent below professional books Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Shulou Information NVidia Microsoft MariaDB