当前位置:网站首页>Acid transaction theory

Acid transaction theory

2022-07-05 11:32:00 InfoQ

What is? ACID

A transaction has four basic characteristics , That's what we often say (ACID):
  • Atomicity( Atomicity )
    : A business is an indivisible whole , All operations within the transaction are either successful , Or it's a total failure .
  • Consistency( Uniformity )
    : Before and after implementation , Data from one state to another must be consistent (A towards B Transfer accounts , Cannot appear A Buckle the money ,B Has received ).
  • Isolation( Isolation, )
    :  Multiple concurrent transactions are isolated from each other , Don't interfere with each other .
  • Durability( persistence )
    : After the transaction completes , Changes to the database are permanent , Cannot be rolled back .

ACID By what guarantee ?

With MySQL For example :
A Atomicity
from undo log Log guarantees , It records the log information that needs to be rolled back , When the transaction is rolled back, undo the successfully executed sql
C Uniformity
It is generally guaranteed by the code level
I Isolation,
from MVCC To guarantee
D persistence
By memory +redo log To guarantee ,mysql Modify data both in memory and redo log Record this operation , The transaction is committed through redo log Brush set , When it goes down, you can start from redo log recovery

If you reprint , Please indicate the source : Open source byte    https://sourcebyte.cn/article/178.html
原网站

版权声明
本文为[InfoQ]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/186/202207051129469461.html