Unit V-DBMS-NOTE
Unit V-DBMS-NOTE
ACID Properties
Atomicity
This property ensures that either all the operations of a transaction reflect in
database or none. The logic here is simple, transaction is a single unit, it can’t
execute partially. Either it executes completely or it doesn’t, there shouldn’t be a partial
execution.
Let’s say first operation passed successfully while second failed, in this case A’s
balance would be 300$ while B would be having 700$ instead of 800$. This is
unacceptable in a banking system. Either the transaction should fail without executing
any of the operation or it should process both the operations. The Atomicity property
ensures that.
There are two key operations are involved in a transaction to maintain the atomicity
of the transaction.
Abort: If there is a failure in the transaction, abort the execution and rollback the
changes made by the transaction.
Consistency
Database must be in consistent state before and after the execution of the
transaction. This ensures that there are no errors in the database at any point of time.
Application programmer is responsible for maintaining the consistency of the
database.
Example:
A transferring 1000 dollars to B. A’s initial balance is 2000 and B’s initial balance is
5000.
The data is consitendct before and after the execution of the transaction so this
example maintains the consistency property of the database.
Isolation
A transaction shouldn’t interfere with the execution of another transaction. To
preserve the consistency of database, the execution of transaction should take place
in isolation (that means no other transaction should run concurrently when there is a
transaction already running).
B19CST402–DATABASE MANAGEMENT SYSTEM
If the transaction were to run in isolation then the second transaction would have read
the correct balance 300$ (before debiting 100$) once the first transaction went
successful.
Durability
Once a transaction completes successfully, the changes it has made into the
database should be permanent even if there is a system failure. The recovery-
management component of database systems ensures the durability of transaction.