Acid refers to the abbreviation of four basic elements for correct execution of database transactions. Includes: atomicity, consistency, isolation, and durability ). A database system that supports transactions must have these four features. Otherwise, data correctness cannot be ensured in the transaction process (transaction processing, the transaction process cannot meet the requirements of the transaction party.
Atomicity
All the operations in the entire transaction are either completed or not completed, and it is impossible to stop at a stage in the middle. When a transaction encounters an error during execution, it will be rolled back to the state before the start of the transaction, just as this transaction has never been executed.
Consistency
The integrity constraints of the database are not damaged before and after the transaction starts.
Isolation
The execution of two transactions does not interfere with each other. One transaction cannot see the data at a certain time in the middle of another transaction.
Durability
After the transaction is completed, the changes made by the firm to the database are permanently stored in the database and will not be rolled back.
Because an operation usually contains many sub-operations, these sub-operations may cause problems due to hardware damage or other factors, it is not easy to implement acid correctly. Acid recommends that the database complete all the data to be updated and modified at one time, but it is not feasible.
At present, there are two main ways to implement acid: the first is write Ahead Logging, that is, the log method. The second type is shadow paging.