Characteristics of database transactions (ACID)

Source: Internet
Author: User

The transaction of the database is a collection of a series of operations (additions and deletions) in the database.

In general, the scope of the transaction depends on the business, such as transfer, modification of personal information

Transfer: Transfer $200 from account A to account B

  • Deduction of 200 yuan from a account
  • Add $200 to the B account

Modify personal Information: For example, personal information consists of 2 parts, which are stored in two tables "basic information Form" and "Payment information Form".

  • Update the basic Information table information
  • Update the "Payment Information form" information

In order to ensure that the transaction is correct, you need to have 4 characteristics, is the legendary acid:

  • atomicity-atomicity: This sequence of operations for a transaction either completes (commits) all, or an exception (rollback) occurs halfway. That is to say, this series of operations of the transaction, is the smallest granularity that can not be divided, presents the atomicity.
  • consistency-Consistency: The data for the database is consistent. The execution of a transaction must transform the database from one consistent state to another. For example, the above atomic operations must be committed or rolled back without allowing an intermediate state (so that the data is inconsistent). There is a close relationship between atomicity and consistency.
  • isolation-Isolation: When multiple transactions concurrently execute on the same set of data, the degree of isolation between transactions is isolated and can be categorized into different levels.
  • durability-Persistence: When the transaction is completed, the data is persisted to the database.

Characteristics of database transactions (ACID)

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.