Database Transactions acid

Source: Internet
Author: User

ACID, refers to the database management system (DBMS) in the process of writing/updating data, in order to ensure that the transaction (transaction) is correct and reliable, must have four characteristics: atomicity (atomicity, or called indivisibility), consistency (consistency), Isolation (isolation, also known as independence), persistence (durability).

In a database system, a transaction refers to a complete logical process consisting of a series of database operations. For example, bank transfer, deduction of the amount from the original account, and the addition of the amount to the target account, the sum of the two database operations, constitutes a complete logical process that cannot be split. This process is called a transaction and has an acid characteristic. The concept of acid is described in the fourth paragraph of the ISO/IEC 10026-1:1992 document.


Four characteristics:

Atomicity: All operations in a transaction (transaction) are either complete or not complete and do not end up in the middle of a session. When an error occurs during execution, the transaction is rolled back (Rollback) to the state before the transaction begins, as if the transaction had never been executed.
Consistency: The integrity of the database is not compromised until the transaction begins and after the transaction has ended. This means that the data being written must fully conform to all of the preset rules, which include the accuracy of the data, the concatenation, and the subsequent database's ability to perform the scheduled work spontaneously.
Isolation: The correlation that occurs when two or more transactions concurrently access the same data in a database that refers to queries and modified operations. Transaction isolation is divided into different levels, including read UNCOMMITTED, Read Committed, REPEATABLE READ (repeatable Read), and serialization (Serializable).
Persistence: After the transaction completes, the transaction changes made to the database are persisted in the database and are complete.


The (ACID) nature of the

transaction is implemented by a relational database management system (RDBMS, database System). The database management system uses logs to ensure the atomicity, consistency and persistence of transactions. The log records the updates that the transaction makes to the database, and if a transaction has an error during execution, it can undo the updates that the transaction has made to the database based on the log, returning the database to the initial state before the transaction was executed. The

Database management system employs a lock mechanism to achieve transaction isolation. When multiple transactions update the same data in the database at the same time, only transactions that hold the lock are allowed to update the data, and other transactions must wait until the previous transaction releases the lock, and other transactions have the opportunity to update the data.


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.