Things and isolation levels in MySQL

Source: Internet
Author: User

What do you mean business

A transaction is a set of operations units of SQL, either the operation succeeds or all fails.

Acid attribute atomicity (atomicity)

A thing must be considered as an inseparable minimum unit of work, the entire transaction either succeeds or all fails to roll back, and for one thing, it is impossible to perform only a subset of the operations.

Consistency (consistency)

The database is always transitioning from one consistent state to another consistent state. For example, for a total of two update, after the first update, the system crashes and does not affect the data because the transaction is not committed.

Isolation (Isolation)

Changes made by a firm are not visible to other transactions until they are finally committed.

Persistence (Durability)

Once the transaction commits, the modifications are persisted to the database.

Transaction ISOLATION LEVEL

Problems with concurrent transactions:

    • Dirty Read
      A transaction can read uncommitted data, called dirty reads.
    • Non-REPEATABLE READ
      At the beginning of a transaction, only the modifications that have been submitted to the firm are read. In other words, any changes you make to a transaction from the beginning until it is committed are not visible to other transactions. Performing the same query two times may result in a different outcome.
    • Phantom reading
      Refers to when a transaction reads a range of records, another transaction inserts a new record within that scope, and when the previous transaction reads the record for that range again, a magic line is generated.
Isolation Level Dirty Read Possibility non-repeatable reading possibilities Phantom Reading Possibilities
READ UNCOMMITTED Yes Yes No
Read Committed No Yes Yes
REPEATABLE READ No No Yes
Serializable No No No

Things and isolation levels in MySQL

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.