Things about MySQL

Source: Internet
Author: User

The so-called thing is a set of atomic SQL statements, or a separate unit of work.

  1, things have four characteristics:

① atomicity (atomicity): A thing must be divided into an indivisible minimum unit, and all operations in the whole thing are either committed or rolled back, which is the atomic nature of things.

② Consistency (consistency): The database is always transitioning from one consistent state to another consistent state. That is, database things can not destroy the integrity and consistency of data.

③ Isolation (isolation): Refers to multiple things in a concurrent environment that process the same data, each with its own full data space.

④ Persistence (durability): Once a thing is committed, its modifications are persisted to the database.

The atomicity, consistency, and persistence of things are maintained by the thing log, the thing log records every update of things, and if something is wrong for some reason, it is the initial state that the thing rolls back to the database before the thing is rolled out, by undoing the change to the database.

The isolation of things is achieved through the locking mechanism, with their own independent space.

  2 , the isolation level of things :

The SQL standard defines four levels of isolation:

No commit read (readuncommitted): in the READ UNCOMMITTED level, the modification of things, even if not committed, is also visible to other things. Things can read uncommitted data, which is also known as dirty reads (Dirtyread).

ReadCommitted: when a thing starts to know that a thing is being submitted, any changes made are not visible to other things, which is also called non-repeatable reading ( Nonrepeatable), execute two times the same query and get different results.

REPEATABLE READ (repeatableread): This level guarantees that the same result is consistent for multiple reads in the same thing. May cause Phantom reads.

Serializable (Serializable): the highest isolation level. By forcing things to be executed serially, the above-mentioned phantom-reading problem is avoided.

Things about MySQL

Related Article

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.