0
3.2kviews
List ACID properties. Explain usefulness of each.

Mumbai University > Information Technology > Sem 3 > Database Management System

Marks: 10M

Year: Dec 2014, Dec 2015

1 Answer
0
33views

Introduction:

  1. ACID(Atomicity, Consistency, Isolation, Durability) properties can be defined as a set of properties that guarantee that database transactions are processed reliably.
  2. Atomicity:The atomicity property identifies that the transaction is atomic. An atomic transaction is either fully completed, or is not begun at all.
  3. Consistency: A transaction enforces consistency in the system state by ensuring that at the end of any transaction the system is in a valid state.
  4. Isolation: When a transaction runs in isolation, it appears to be the only action that the system is carrying out at one time.
  5. Durability: A transaction is durable in that once it has been successfully completed; all of the changes it made to the system are permanent.

Explanation:

  1. Atomicity:
  2. The atomicity propertyrequires that we execute a transaction to completion. It is the responsibility of the transaction recovery subsystemof a DBMS to ensure atomicity.
  3. If a transaction fails to complete for some reason, such as a system crash in the midst of transaction execution, the recovery technique must undo any effects of the transaction on the database. On the other hand, write operations of a committed transaction must be eventually written to disk.
  4. Any updates that a transaction might affect on a system are completed in their entirety.
  5. Thus, atomicity ensures that if for any reason an error occurs and the transaction is unable to complete all of its steps, the then system is returned to the state it was in before the transaction was started.
  6. An example of an atomic transaction is an account transfer transaction. The money is removed from account A then placed into account B. If the system fails after removing the money from account A, then the transaction processing system will put the money back into account A, thus returning the system to its original state.

  7. Consistency:

  8. The consistency property ensures a completed execution of transaction from beginning to end without interference of other transactions.
  9. If the transaction completes successfully, then all changes to the system will have been properly made, and the system will be in a valid state.
  10. If any error occurs in a transaction, then any changes already made will be automatically rolled back. This will return the system to its state before the transaction was started.
  11. Since the system was in a consistent state when the transaction was started, it will once again be in a consistent state.
  12. The preservation of consistency is generally considered to be the responsibility of the programmers who write the database programs or of the DBMS module that enforces integrity constraints.
  13. Consider the account transfer system; the system is consistent if the total of all accounts is constant. If an error occurs and the money is removed from account A and not added to account B, then the total in all accounts would have changed. The system would no longer be consistent. By rolling back the removal from account A, the total will again be what it should be, and the system back in a consistent state.

  14. Isolation:

  15. Isolation property ensures that a transaction should appear as though it is being executed in isolation from other transactions, even though many transactions are executing concurrently.
  16. The isolation property is enforced by the concurrency control subsystem of the DBMS.
  17. This is important in that as the transaction is being executed, the state of the system may not be consistent. The transaction ensures that the system remains consistent after the transaction ends, but during an individual transaction, this may not be the case.
  18. If a transaction was not running in isolation, it could access data from the system that may not be consistent. By providing transaction isolation, this is prevented from happening.

  19. Durability:

  20. Durability ensures that The changes applied to the database by a committed Transaction must persist in the database.
  21. The durability property is the responsibility of the recovery subsystem of the DBMS.
  22. The database system has checked the integrity constraints and won't need to abort the transaction.
  23. Many databases implement durability by writing all transactions into a transaction log that can be played back to recreate the system state right before a failure. A transaction can only be deemed committed after it is safely in the log.
  24. Thus, features to consider for durability can be summarized as :
    • recovery to the most recent successful commit after a database software failure
    • recovery to the most recent successful commit after an application software failure
    • recovery to the most recent successful commit after a CPU failure
    • recovery to the most recent successful backup after a disk failure
    • recovery to the most recent successful commit after a data disk failure
Please log in to add an answer.