Transaction processing

If your credit is good, a series of related operations ensures that you get the book and the bookstore gets your money.

The technology responsible for making the exchange balanced and predictable is called transaction processing.

Examples include systems that manage sales order entry, airline reservations, payroll, employee records, manufacturing, and shipping.

Transaction processing is designed to maintain a system's Integrity (typically a database or some modern filesystems) in a known, consistent state, by ensuring that interdependent operations on the system are either all completed successfully or all canceled successfully.

In our example, this means that no matter which transaction was issued first, either the transfer to a different person or the move to the checking account succeeds, while the other one fails.

If the database management system fails entirely, it must be restored from the most recent back-up.

In some cases, two transactions may, in the course of their processing, attempt to access the same portion of a database at the same time, in a way that prevents them from proceeding.

Typically both transactions will be cancelled and rolled back, and then they will be started again in a different order, automatically, so that the deadlock does not occur again.

Or sometimes, just one of the deadlocked transactions will be cancelled, rolled back, and automatically restarted after a short delay.

Jim Gray defined properties of a reliable transaction system in the late 1970s under the acronym ACID—atomicity, consistency, isolation, and durability.

Once a transaction completes successfully (commits), its changes to the database survive failures and retain its changes.

As the number of transactions grew in response to various online services (especially the Web), a single distributed database was not a practical solution.

In addition, most online systems consist of a whole suite of programs operating together, as opposed to a strict client–server model where the single server could handle the transaction processing.