Transaction Durability in detail

After a transaction completes successfully, the changes it has made to the database persist, even if there are system failures.

which means in case if the transaction gets committed, then all the modifications done by transaction must and should exist in database irrespective of any possible failure.

Example:

Let Ti be a transaction that transfers $50 from account A to account B. This transaction
can be defined as:

read(A);
A := A − 50;
write(A);
read(B);
B := B + 50;
write(B).

Lets assume that, just before the execution of transaction Ti, the values of accounts A and B are $1000 and $2000, respectively.

Once the execution of the transaction completes successfully, and the user who initiated the transaction has been notified that the transfer of funds has taken place, it must be the case that no system failure will result in a loss of data corresponding to this transfer of funds.

The durability property guarantees that, once a transaction completes successfully, all the updates that it carried out on the database persist, even if there is a system failure after the transaction completes execution.

We assume for now that a failure of the computer system may result in loss of data in main memory, but data written to disk are never lost. We can guarantee durability by ensuring that either:

  • The updates carried out by the transaction have been written to disk before
    the transaction completes.
  • Information about the updates carried out by the transaction and written
    to disk is sufficient to enable the database to reconstruct the updates when
    the database system is restarted after the failure.

Ensuring durability is the responsibility of a component of the database system called the recovery-management component. The transaction-management component and the recovery-management component are closely related.

One comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.