What are ACID properties of transactions? Tell about each property.
sobes.tech AI
Answer from AI
ACID is a set of properties of database transactions that ensure reliability and correctness of operations:
-
Atomicity — a transaction is completed in full or not at all. If an error occurs, all changes are rolled back to prevent partial results.
-
Consistency — after a transaction completes, the database remains in a correct state, satisfying all specified constraints and rules.
-
Isolation — parallel transactions do not affect each other, and the results of one transaction are not visible to others until it is completed.
-
Durability — once a transaction is committed, its changes are saved in the database even in case of failures or reboots.
Example: when transferring money between accounts, atomicity guarantees that the debit and credit happen together or not at all, and isolation prevents other operations from seeing intermediate states.