Database Management Systems (2130703)

BE | Semester-3   Summer-2018 | 05/23/2018

Q5) (b)

List and discuss ACID properties of transaction.

ACID property

Atomicity

  • Either all operations of the transaction are properly reflected in the database or none are.
  • Means either all the operations of a transaction are executed or not a single operation is executed.
  • For example consider below transaction to transfer Rs. 50 from account A to account B:
    1. read(A)
    2. A := A – 50
    3. write(A)
    4. read(B)
    5. B := B + 50
    6. write(B)
  • In above transaction if Rs. 50 is deducted from account A then it must be added to account B.

Consistency

  • Execution of a transaction in isolation preserves the consistency of the database.
  • Means our database must remain in consistent state after execution of any transaction.
  • In above example total of A and B must remain same before and after the execution of transaction.

Isolation

  • Although multiple transactions may execute concurrently, each transaction must be unaware of other concurrently executing transactions.
  • Intermediate transaction results must be hidden from other concurrently executed transactions.
  • In above example once your transaction start from step one its result should not be access by any other transaction until last step (step 6) is completed.

Durability

  • After a transaction completes successfully, the changes it has made to the database persist, even if there are system failures.
  • Once your transaction completed up to step 6 its result must be stored permanently. It should not be removed if system fails.