0
2.2kviews
Describe ACID Properties or List ACID properties. Explain usefulness of each
1 Answer
0
14views

A database guarantees the following four properties to ensure database reliability, as follows:

• Atomicity:

A database follows the all or nothing rule, i.e., the database considers all transaction operations as one whole unit or atom. Thus, when a database processes a transaction, it is either fully completed or not executed at all. Suppose A is transferring Rs 100 to B's account. Computers are electronic device and are prone to failure. Assume A has initially Rs 300 and B has Rs 500. Now it may happen that when A has initiated the transfer, in the midst of transferring from A to B, system fail. Now balance is deducted from A's account but has not been added to B's account. Hence we need either the transaction executes fully or just revert back to initial state.

• Consistency:

Ensures that only valid data following all rules and constraints is written in the database. When a transaction results in invalid data, the database reverts to its previous state, which abides by all customary rules and constraints. This must be totally ensured by the programmer. Referring to above example, this basically means sum of balances of both A's and B's account are same before and after transaction.

• Isolation:

Ensures that transactions are securely and independently processed at the same time without interference, but it does not ensure the order of transactions. For example, user A withdraws Rs 100 and user B withdraws Rs 250 from user Z’s account, which has a balance of Rs 1000. Since both A and B draw from Z’s account, one of the users is required to wait until the other user transaction is completed, avoiding inconsistent data. If B is required to wait, then B must wait until A’s transaction is completed, and Z’s account balance changes to Rs 900. Now, B can withdraw Rs 250 from this Rs 900 balance.

• Durability:

It may happen that even the transaction is successful, system fails. In the above example, user B may withdraw Rs 100 only after user A’s transaction is completed and is updated in the database. If the system fails before A’s transaction is logged in the database, A cannot withdraw any money, and Z’s account returns to its previous consistent state.

Please log in to add an answer.