In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This article is about what the four levels of isolation are. Xiao Bian thinks it is quite practical, so share it for everyone to make a reference. Let's follow the editor and have a look.
MySQL has four isolation levels: read uncommitted content, read committed content, repeatable read, and serializable.
Mysql's four isolation levels
The SQL standard defines four levels of isolation, including specific rules that define which changes inside and outside a transaction are visible and which are invisible. Lower isolation levels generally support higher concurrency and have lower overhead. [Video Tutorial Recommended: Mysql Tutorial]
Read Uncommitted (read-uncommitted)
At this isolation level, all transactions can see the execution results of other uncommitted transactions. This isolation level is rarely used in practical applications because its performance is not much better than other levels.
The problem with this isolation level is Dirty Read, where uncommitted data is read.
Read-committed
This is the default isolation level for most database systems (but not MySQL). It satisfies the simple definition of isolation: a transaction can only see changes made by committed transactions.
The problem with this isolation level is that it is nonrepeatable read, meaning that we may see different results when executing exactly the same select statement in the same transaction.
This may be due to:
1)There is a new commit for a crossing transaction, resulting in a change in the data.
2)When a database is operated on by more than one instance, other instances of the same transaction may have new commits in between
Repeatable (read repeatedly)
This is MySQL's default transaction isolation level, which ensures that multiple instances of the same transaction see the same rows of data when reading data concurrently.
In theory, though, this leads to another tricky problem: Phantom Read.
In simple terms, phantom reading means that when a user reads a range of data rows, another transaction inserts new rows into the range, and when the user reads the range of data rows again, he will find new "phantom" rows.
InnoDB and Falcon storage engines solve this problem through the Multiversion Concurrency Control (MVCC) mechanism.
Serializable (serializable)
This is the highest level of isolation and solves the phantom read problem by forcing transactions to be ordered so that they are unlikely to conflict with each other. In short, it places a shared lock on each row of data read. At this level, a lot of timeouts and lock contention can result.
At this level, a lot of timeouts and lock contention can result.
Thank you for reading! About Mysql four isolation levels are what to share here, I hope the above content can be of some help to everyone, so that everyone can learn more knowledge. If you think the article is good, you can share it so that more people can see it!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.