One of Transaction Processing (Transaction Overview)

       The transaction discussed here is a term in programming, especially in the database, which refers to a series of operations performed by a single logical unit of work to prevent data inconsistency when data is updated synchronously.

       Transactions have four characteristics that are often tested in exams: ACID. In order to express that I want to be a programmer with knowledge, culture and theory, I am going to copy these explanations.

      

Atomicity _
A transaction must be an atomic unit of work; either all or none of its data modifications are performed. Often, operations associated with a transaction have a common goal and are interdependent. If the system performs only a subset of these operations, the overall goal of the transaction may be violated. Atomicity eliminates the possibility of the system processing subsets of operations.
Consistency _
When a transaction completes, all data must be in a consistent state. In a relational database, all rules must be applied to the modification of a transaction to maintain the integrity of all data. At the end of the transaction, all internal data structures (such as B-tree indexes or doubly linked lists) must be correct. Some of the responsibility for maintaining consistency rests with the application developer, who must ensure that the application has enforced all known integrity constraints. For example, when developing an application for transferring money, you should avoid moving the decimal point arbitrarily during the transfer process.
Isolation _
Modifications made by concurrent transactions must be isolated from modifications made by any other concurrent transaction. The state of the data when the transaction views the data is either the state before another concurrent transaction modifies it, or the state after another transaction modifies it. The transaction does not view the data in the intermediate state. This is called serializability because it enables the starting data to be reloaded and a series of transactions to be replayed so that the data ends up in the same state as the original transaction executed. The highest isolation level is obtained when the transaction is serializable. At this level, the results obtained from a set of concurrently executable transactions are the same as those obtained by running each transaction sequentially. Because high isolation limits the number of transactions that can be executed in parallel, some applications lower the isolation level in exchange for greater throughput.
Durability _
After a transaction completes, its impact on the system is permanent. This modification will persist even in the event of a fatal system failure.

 

 

After finishing the literary and artistic youth, let's talk about some practical things. These things will be divided into the following contents.

 

Transaction processing 2 (transactions in programming)

 

Transaction processing three (database transactions)

 

Transaction processing fourth (distributed transaction)

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326801610&siteId=291194637