ACID
Last updated
Last updated
ACID stands for Atomicity, Consistency, Isolation and Durability , which are four important properties to ensure when performing any transactional operations with the database . Specifically, these are the requirements for safety, sustainability and data integrity . If a process does not ensure the above properties, it will not be able to perform operations with data and will be canceled immediately.
Each process requires all 4 ACID properties to participate in transactions, specifically the properties: Atomicity , Consistency , Isolation , and Durability . ), As follows.
Atomicity can be understood as atomicity. This means that any changes to the data must be complete if the processes execute successfully or there will not be any changes to the data if a process failure occurs.
When a chain of processes manipulates the database, if an error occurs, all of these processes must be canceled, the data in the database remains unchanged. In case there are no unusual errors during the processing process, the data will be updated according to the user's wishes.
It is called atomic property because each individual operation is considered like electrons moving around the nucleus and when the nucleus moves, these electrons also move. There will not be any electrons that deviate from their original orbit.
The Consistency attribute requires data consistency for the database. When a Transaction is completed, all data must be preserved regardless of whether the operation succeeds or fails.
Data in the database must always be in a valid state at any time, before and after performing each Transaction action. This means that if the first action of the process fails, it will either rollback, or the next process will not be performed.
Isolation is a property that refers to the independence of Transactions when executing concurrently on the system. If there are multiple processes occurring at the same time, a mechanism is needed to ensure that these processes can operate in parallel without affecting each other.
For example, in the case of a customer transferring money to a bank and an accountant withdrawing money from the bank at the same time. At this time, the database will simultaneously perform two actions: adding to the customer's balance and subtracting the amount withdrawn by the accountant. There will be a mechanism for both of these actions to take place successfully in parallel without affecting database processing.
This property is provided to ensure that when Transactions take place successfully, the effect it creates on the database must be sustainable. No matter what error occurs in the system, the data is always restored to its original state.
For example, for money transaction processes through banks. When Transactions are completed, data will be recorded on hard disk, transactions will also be recorded. If any problem occurs, you can easily back up the data.