What is a transaction and four features of a transaction?

Source: Internet
Author: User

What is a transaction and four features of a transaction?

1. What is a transaction?
A transaction is a series of strict operations in an application. All operations must be completed successfully. Otherwise, all changes made in each operation will be revoked. That is to say, a transaction is atomic, and a series of operations in a transaction either succeed or do not.
There are two types of transactions to end. When all the steps in the transaction are successfully executed, the transaction is committed. If one of the steps fails, the rollback operation will occur, undo the operation that was performed before the start of the transaction.
Ii. ACID of transactions
Transactions have four features: Atomicity, Consistency, Isolation, and Durability ). These four features are short for ACID.
1. atomicity
A transaction is the logical unit of work of a database. All operations contained in a transaction are either done or not done.
2. Consistency
The result of event execution must be that the database changes from one consistent state to another consistent state. Therefore, when the database only contains the results of successful transaction commit, the database is in a consistent state. If a fault occurs in the database system, some transactions are forced to be interrupted before they are completed. Some of the changes made to the database by these unfinished transactions have been written to the physical database, the database is in an incorrect or inconsistent state.
3. Isolation
The execution of a transaction cannot be disturbed by other transactions. That is to say, the operations and data used within a transaction are isolated from other concurrent transactions, and each transaction that is executed concurrently cannot interfere with each other.
4. Continuity
It is also called permanent, which means that once a transaction is committed, its changes to the data in the database should be permanent. Other subsequent operations or faults should not affect the execution results.

The database system must maintain the following ACID features of transactions ):

Atomicity)

Consistency)

Isolation)

Durability)

Atomicity)

All operations in the transaction are either performed in full or not executed;

If the transaction has no guarantee of atomicity

When a fault occurs, the database may be inconsistent.

Status.

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.