Database Transaction - Purpose

Purpose

Databases and other data stores which treat the integrity of data as paramount often include the ability to handle transactions to maintain the integrity of data. A single transaction consists of one or more independent units of work, each reading and/or writing information to a database or other data store. When this happens it is often important to ensure that all such processing leaves the database or data store in a consistent state.

Examples from double-entry accounting systems often illustrate the concept of transactions. In double-entry accounting every debit requires the recording of an associated credit. If one writes a check for €100 to buy groceries, a transactional double-entry accounting system must record the following two entries to cover the single transaction:

  1. Debit €100 to Groceries Expense Account
  2. Credit €100 to Checking Account

A transactional system would make both entries pass or both entries would fail. By treating the recording of multiple entries as an atomic transactional unit of work the system maintains the integrity of the data recorded. In other words, nobody ends up with a situation in which a debit is recorded but no associated credit is recorded, or vice versa.

Read more about this topic:  Database Transaction

Famous quotes containing the word purpose:

    Science and art, or by the same token, poetry and prose differ from one another like a journey and an excursion. The purpose of the journey is its goal, the purpose of an excursion is the process.
    Franz Grillparzer (1791–1872)

    No further evidence is needed to show that “mental illness” is not the name of a biological condition whose nature awaits to be elucidated, but is the name of a concept whose purpose is to obscure the obvious.
    Thomas Szasz (b. 1920)

    I have no purpose to introduce political and social equality between the white and black races. There is a physical difference between the two, which, in my judgement, will probably for ever forbid their living together upon the footing of perfect equality; and inasmuch as it becomes a necessity that there must be a difference, I ... am in favour of the race to which I belong having the superior position.
    Abraham Lincoln (1809–1865)