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:

    Respect is not fear and awe; it...[is]the ability to see a person as he is, to be aware of his unique individuality. Respect, thus, implies the absence of exploitation. I want the loved person to grow and unfold for his own sake, and in his own ways, and not for the purpose of serving me.
    Erich Fromm (20th century)

    I don’t like to be idle; in fact, I often feel somewhat guilty unless there is some purpose to what I am doing. But spending a few hours—or a few days—in the woods, swamps or alongside a stream has never seemed to me a waste of time.... I derive special benefit from a period of solitude.
    Jimmy Carter (James Earl Carter, Jr.)

    A major misunderstanding of child rearing has been the idea that meeting a child’s needs is an end in itself, for the purpose of the child’s mental health. Mothers have not understood that this is but one step in social development, the goal of which is to help a child begin to consider others. As a result, they often have not considered their children but have instead allowed their children’s reality to take precedence, out of a fear of damaging them emotionally.
    Elaine Heffner (20th century)