Four isolation levels for databases

Source: Internet
Author: User
Tags rollback

First, the concept of business

A sequence of operations in a transaction either succeeds or does not.

There are two ways to end a transaction, and when all the steps in the transaction are successfully executed, the transaction commits. If one of the steps fails, a rollback operation occurs, undoing the operation that the transaction has performed.

Second, the characteristics of the business ACID

A transaction has four characteristics: atomicity (atomicity), consistency (consistency), isolation (isolation), and persistence (durability), referred to as ACID properties.

Three, multi-transaction concurrent execution problem

Dirty Reads (drity read): A transaction has updated one copy of the data, another transaction reads the same data at this time, for some reason, the previous rollback operation, the latter will read the data is not correct.

Non-repeatable read (non-repeatable Read): Data inconsistency in two queries for a transaction, which may be the original data that was inserted in the middle of a transaction update during the two query process.

Phantom Read (Phantom Read): In a transaction two times the number of data pens inconsistent, for example, one transaction queried several columns (row) of data, while another transaction at this time inserted a new column of data, the previous transaction in the next query, you will find that there are a few columns of data that it did not previously.

III. four isolation levels for transactions

The SQL standard defines a Class 4 isolation level, which includes specific rules to define which changes within and outside the transaction are visible and which are not. Low-level isolation levels generally support higher concurrency processing and have lower system overhead.

Other related concepts to be supplemented: MySQL, Oracle Transaction Implementation principles, SQL standard

Reference articles

Https://www.2cto.com/database/201707/657145.html

Https://www.cnblogs.com/andydao/p/6043963.html

Four isolation levels for databases

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.