Four basic features of database transactions

Source: Internet
Author: User

What is a database transaction?

A transaction is a program execution unit consisting of a series of operation sequences. These operations are either done or not done, and are an inseparable unit of work.

Four basic properties of database transactions (ACID)
1. Atomicity)

The atomicity of a transaction indicates that all operations contained in a transaction are either performed in full or not (all or none ).

2. Consistency)

Before a transaction starts, the database is in the consistent state. After the transaction ends, the database must also be in the consistent state.

For bank transfers, consistency requires that the execution of transactions should not change the sum of the two accounts A and B. Without such consistency requirements, money may be lost or missing during the transfer process. Transactions should switch the database from one consistent state to another consistent state.

3. Isolation)

Transaction isolation requires the system to ensure that the transaction is not affected by other concurrent transactions, that is, to achieve the effect: For any pair of transactions T1 and T2, in transaction T1, t2 is executed either before T1 or after T1 is completed. In this way, every transaction does not feel that other transactions are being executed concurrently in the system.

4. Durability)

Once a transaction is successfully completed, its changes to the database must be permanent and will not be lost even if the system encounters a fault. The importance of data determines the importance of transaction persistence.

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.