1
18kviews
List ACID properties. Explain usefulness of each.

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

Marks: 10 M

Year: Dec 2014

1 Answer
0
853views

I. 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.

II. Explanation:

1. Atomicity:

a) The atomicity propertyrequires that we execute a transaction to completion. It is the responsibility of the transaction recovery subsystemof a DBMS to ensure atomicity.

b) 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.

c) Any updates that a transaction might affect on a system are completed in their entirety.

d) 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.

e) 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.

2. Consistency:

a) The consistency property ensures a completed execution of transaction from beginning to end without interference of other transactions.

b) 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.

c) 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.

d) Since the system was in a consistent state when the transaction was started, it will once again be in a consistent state.

e) 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.

f) 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.

3. Isolation:

a) 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.

b) The isolation property is enforced by the concurrency control subsystem of the DBMS.

c) 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.

d) 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.

4. Durability:

a) Durability ensures that The changes applied to the database by a committed Transaction must persist in the database.

b) The durability property is the responsibility of the recovery subsystem of the DBMS.

c) The database system has checked the integrity constraints and won't need to abort the transaction.

d) 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.

e) 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.