What is ACID Transactions?
What is a transaction
First of all, I explain about a transaction.
In the transaction of database, there is property either completely completed or not anything.
For example, the transaction is used in remittance of the bank.
If function of the remittance end abnormally in the middle, Your account balance may decrease despite you couldn’t transfer money.
So the transaction is used when need to keep consistent state.
What is ACID
ACID points 4 characteristics of “Atomicity”, “Consistency”, “Isolation”, “Durability”.
In the following, I teach each characteristic.
Atomicity
Atomicity is a state that either execute all or don’t execute any.
For example, in remittance function, Remittance amount and Deposit amount always become same amount.
It means either account balance of remittance source decrease and account balance of remittance destination increase or do neither.
Consistency
Consistency is a state that keep consistency of data.
For example, in bank account, bank deposit always don’t became minus.
Isolation
Isolation is a state that hide process of transaction in progress from outside and don’t affect other processes.
For example, in remittance function, prevent reading a state like that completed withdrawal but not completed deposit from outside.
Durability
Durability is a state that don’t lose records when happen system failure etc.
In case of system failure of the bank, it reflect update based on the system log of data operation recorded in advance.
