Database Management System: Unit III: Transactions

ACID Properties

Transactions - Database Management System

This property states that each transaction must be considered as a single unit and must be completed fully or not completed at all.

ACID Properties

AU: May 14,18,19, Dec- 19,Mark 15

1) Atomicity:

This property states that each transaction must be considered as a single unit and must be completed fully or not completed at all.

No transaction in the database is left half completed.

Database should be in a state either before the transaction execution or after the transaction execution. It should not be in a state 'executing'.

For example In above mentioned withdrawal of money transaction all the five steps must be completed fully or none of the step is completed. Suppose if transaction gets failed after step 3, then the customer will get the money but the balance will not be updated accordingly. The state of database should be either at before ATM withdrawal (i.e customer without withdrawn money) or after ATM withdrawal (i.e. customer with money and account updated). This will make the system in consistent state.

2) Consistency:

The database must remain in consistent state after performing any transaction.

For example: In ATM withdrawal operation, the balance must be updated appropriately after performing transaction. Thus the database can be in consistent state.

3) Isolation:

In a database system where more than one transaction are being executed simultaneously and in parallel, the property of isolation states that all the transactions will be carried out and executed as if it is the only transaction in the system.

No transaction will affect the existence of any other transaction.

For example: If a bank manager is checking the account balance of particular customer, then manager should see the balance either before withdrawing the money or after withdrawing the money. This will make sure that each individual transaction is completed and any other dependent transaction will get the consistent data out of it. Any failure to any transaction will not affect other transaction in this case. Hence it makes all the transactions consistent.

4) Durability:

The database should be strong enough to handle any system failure.

If there is any set of insert /update, then it should be able to handle and commit to the database.

If there is any failure, the database should be able to recover it to the consistent state.

For example: In ATM withdrawal example, if the system failure happens after Customer getting the money then the system should be strong enough to update Database with his new balance, after system recovers. For that purpose the system has to keep the log of each transaction and its failure. So when the system recovers, it should be able to know when a system has failed and if there is any pending transaction, then it should be updated to Database.


Review Questions

1. Explain with an example the properties that must be satisfied by transaction.  AU: May-18, Marks 7

2. Explain the ACID properties of transaction AU: May-14, Marks 8

3. Discuss in detail about the ACID properties of transaction. AU: May-19, Marks 15

4. Discuss the properties of a transaction that ensure integrity of data in the database system.AU: Dec 19, Marks 4

Database Management System: Unit III: Transactions : Tag: : Transactions - Database Management System - ACID Properties