Transaction processing
Encyclopedia
In computer science
Computer science
Computer science or computing science is the study of the theoretical foundations of information and computation and of practical techniques for their implementation and application in computer systems...

, transaction processing is information processing that is divided into individual, indivisible operations, called transactions. Each transaction must succeed or fail as a complete unit; it cannot remain in an intermediate state. Transaction mandatorily requires acknowledgment to get received as a necessary feedback for accomplishment.

Description

Transaction processing
Transaction processing
In computer science, transaction processing is information processing that is divided into individual, indivisible operations, called transactions. Each transaction must succeed or fail as a complete unit; it cannot remain in an intermediate state...

 is designed to maintain a computer system (typically a database
Database
A database is an organized collection of data for one or more purposes, usually in digital form. The data are typically organized to model relevant aspects of reality , in a way that supports processes requiring this information...

 or some modern filesystems) in a known, consistent state, by ensuring that any operations carried out on the system that are interdependent are either all completed successfully or all canceled successfully.

For example, consider a typical banking transaction that involves moving $700 from a customer's savings account to a customer's checking account. This transaction is a single operation in the eyes of the bank, but it involves at least two separate operations in computer terms: debiting the savings account by $700, and crediting the checking account by $700. If the debit operation succeeds but the credit does not (or vice versa), the books of the bank will not balance at the end of the day. There must therefore be a way to ensure that either both operations succeed or both fail, so that there is never any inconsistency in the bank's database as a whole. Transaction processing is designed to provide this.

Transaction processing allows multiple individual operations to be linked together automatically as a single, indivisible transaction. The transaction-processing system ensures that either all operations in a transaction are completed without error, or none of them are. If some of the operations are completed but errors occur when the others are attempted, the transaction-processing system “rolls back” all of the operations of the transaction (including the successful ones), thereby erasing all traces of the transaction and restoring the system to the consistent, known state that it was in before processing of the transaction began. If all operations of a transaction are completed successfully, the transaction is committed
Commit (data management)
In the context of computer science and data management, commit refers to the idea of making a set of tentative changes permanent. A popular usage is at the end of a transaction. A commit is an act of committing.-Data management:...

 by the system, and all changes to the database are made permanent; the transaction cannot be rolled back once this is done.

Transaction processing guards against hardware and software errors that might leave a transaction partially completed, with the system left in an unknown, inconsistent state. If the computer system crashes in the middle of a transaction, the transaction processing system guarantees that all operations in any uncommitted (i.e., not completely processed) transactions are cancelled.

Transactions are processed in a strict chronological order. If transaction n+1 intends to touch the same portion of the database as transaction n, transaction n+1 does not begin until transaction n is committed. Before any transaction is committed, all other transactions affecting the same part of the system must also be committed; there can be no “holes” in the sequence of preceding transactions.

Methodology

The basic principles of all transaction-processing systems are the same. However, the terminology may vary from one transaction-processing system to another, and the terms used below are not necessarily universal.

Rollback

Transaction-processing systems ensure database integrity by recording intermediate states of the database as it is modified, then using these records to restore the database to a known state if a transaction cannot be committed. For example, copies of information on the database prior to its modification by a transaction are set aside by the system before the transaction can make any modifications (this is sometimes called a before image). If any part of the transaction fails before it is committed, these copies are used to restore the database to the state it was in before the transaction began.

Rollforward

It is also possible to keep a separate journal of all modifications to a database (sometimes called after images); this is not required for rollback of failed transactions, but it is useful for updating the database in the event of a database failure, so some transaction-processing systems provide it. If the database fails entirely, it must be restored from the most recent back-up. The back-up will not reflect transactions committed since the back-up was made. However, once the database is restored, the journal of after images can be applied to the database (rollforward) to bring the database up to date. Any transactions in progress at the time of the failure can then be rolled back. The result is a database in a consistent, known state that includes the results of all transactions committed up to the moment of failure.

Deadlocks

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. For example, transaction A may access portion X of the database, and transaction B may access portion Y of the database. If, at that point, transaction A then tries to access portion Y of the database while transaction B tries to access portion X, a deadlock occurs, and neither transaction can move forward. Transaction-processing systems are designed to detect these deadlocks when they occur. 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 doesn't occur again. Or sometimes, just one of the deadlocked transactions will be cancelled, rolled back, and automatically re-started after a short delay.

Deadlocks can also occur between three or more transactions. The more transactions involved, the more difficult they are to detect, to the point that transaction processing systems find there is a practical limit to the deadlocks they can detect.

Compensating transaction

In systems where commit and rollback mechanisms are not available or undesirable, a Compensating transaction
Compensating transaction
The execution of a business process consists of one or more transactions. Each transaction may consist of several individual operations yet, as a whole, it moves the system between consistent states....

 is often used to undo failed transactions and restore the system to a previous state.

ACID criteria (Atomicity, Consistency, Isolation, Durability)

Transaction processing has these benefits:
  • It allows sharing of computer resources among many users
  • It shifts the time of job processing to when the computing resources are less busy
  • It avoids idling the computing resources without minute-by-minute human interaction and supervision
  • It is used on expensive classes of computers to help amortize the cost by keeping high rates of utilization of those expensive resources
  • A transaction is an atomic unit of processing.

Implementations

Standard transaction-processing software, notably IBM
IBM
International Business Machines Corporation or IBM is an American multinational technology and consulting corporation headquartered in Armonk, New York, United States. IBM manufactures and sells computer hardware and software, and it offers infrastructure, hosting and consulting services in areas...

's Information Management System
Information Management System
IBM Information Management System is a joint hierarchical database and information management system with extensive transaction processing capabilities.- History :...

, was first developed in the 1960s, and was often closely coupled to particular database management system
Database management system
A database management system is a software package with computer programs that control the creation, maintenance, and use of a database. It allows organizations to conveniently develop databases for various applications by database administrators and other specialists. A database is an integrated...

s. client–server computing implemented similar principles in the 1980s with mixed success. However, in more recent years, the distributed client–server model has become considerably more difficult to maintain. 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. Today a number of transaction processing systems are available that work at the inter-program level and which scale to large systems, including mainframes
Mainframe computer
Mainframes are powerful computers used primarily by corporate and governmental organizations for critical applications, bulk data processing such as census, industry and consumer statistics, enterprise resource planning, and financial transaction processing.The term originally referred to the...

.

An important open industry standard is the X/Open Distributed Transaction Processing (DTP) (see JTA
Java Transaction API
The Java Transaction API is one of the Java Enterprise Edition APIs allowing distributed transactions to be done across multiple XA resources in a Java environment. JTA is a specification developed under the Java Community Process as JSR 907...

). However, proprietary transaction-processing environments such as IBM's CICS
CICS
Customer Information Control System is a transaction server that runs primarily on IBM mainframe systems under z/OS and z/VSE.CICS is a transaction manager designed for rapid, high-volume online processing. This processing is mostly interactive , but background transactions are possible...

 are still very popular, although CICS has evolved to include open industry standards as well.

A modern transaction processing implementation combines elements of both object-oriented persistence with traditional transaction monitoring. One such implementation is the commercial DTS/S1 product from Obsidian Dynamics, or the open-source product db4o
Db4o
db4o is an embeddable open source object database for Java and .NET developers. It is developed, commercially licensed and supported by Versant....

.

See also

  • ACID
    ACID
    In computer science, ACID is a set of properties that guarantee database transactions are processed reliably. In the context of databases, a single logical operation on the data is called a transaction...

  • ACMS
    Application Control Management System
    Application Control Management System is a transaction processing monitor software system from HP for computers running the OpenVMS operating system....

  • Audit trail
    Audit trail
    Audit trail is a sequence of steps supported by proof documenting the real processing of a transaction flow through an organization, a process or a system.....

  • CICS
    CICS
    Customer Information Control System is a transaction server that runs primarily on IBM mainframe systems under z/OS and z/VSE.CICS is a transaction manager designed for rapid, high-volume online processing. This processing is mostly interactive , but background transactions are possible...

  • Compensating transaction
    Compensating transaction
    The execution of a business process consists of one or more transactions. Each transaction may consist of several individual operations yet, as a whole, it moves the system between consistent states....

  • Concurrent programming
  • Database transaction
    Database transaction
    A transaction comprises a unit of work performed within a database management system against a database, and treated in a coherent and reliable way independent of other transactions...

  • Extreme Transaction Processing
    Extreme Transaction Processing
    Extreme transaction processing is an exceptionally demanding form of transaction processing. Transactions of 10,000 concurrent accesses or more would require this form of processing.-Description:...

     (XTP)
  • IBM TXSeries
    IBM TXSeries
    TXSeries for Multiplatforms is a distributed CICS Online Transaction Processing environment for mixed language applications. It is widely used for integrating data and applications between distributed solutions and enterprise systems, and the deployment of CICS applications written in COBOL, C ,...

     (CICS on distributed platforms)
  • IMS
    Information Management System
    IBM Information Management System is a joint hierarchical database and information management system with extensive transaction processing capabilities.- History :...

  • Java EE (e.g. WebSphere
    WebSphere
    IBM WebSphere refers to a brand of computer software products in the genre of enterprise software known as "application and integration middleware". These software products are used by end-users to create applications and integrate applications with other applications...

     Application Server)
  • Java Transaction API
    Java Transaction API
    The Java Transaction API is one of the Java Enterprise Edition APIs allowing distributed transactions to be done across multiple XA resources in a Java environment. JTA is a specification developed under the Java Community Process as JSR 907...

     (JTA)
  • Two-phase commit
  • Transaction Processing Facility
    Transaction Processing Facility
    TPF is an IBM real-time operating system for mainframes descended from the IBM System/360 family, including zSeries and System z9. The name is an initialism for Transaction Processing Facility....

  • Tuxedo (software)
    Tuxedo (software)
    Tuxedo is a middleware platform used to manage distributed transaction processing in distributed computing environments...

  • Transaction Processing Management System
    Transaction Processing Management System
    TPMS or Transaction Processing Management System is online transaction processing superstructure software from ICL that runs on their VME mainframe computers...

     (TPMS)
  • Transaction Processing Performance Council
    Transaction Processing Performance Council
    Transaction Processing Performance Council is a non-profit organization founded in 1988 to define transaction processing and database benchmarks and to disseminate objective, verifiable TPC performance data to the industry...

     (TPC)
  • Telecommunication Application Transaction Processing Benchmark (TATP)
    TATP Benchmark
    The Telecommunication Application Transaction Processing Benchmark is a benchmark designed to measure performance of in-memory database transaction systems....


External references


Further reading

  • Gerhard Weikum, Gottfried Vossen, Transactional information systems: theory, algorithms, and the practice of concurrency control and recovery, Morgan Kaufmann, 2002, ISBN 1558605088
  • Jim Gray, Andreas Reuter, Transaction Processing — Concepts and Techniques, 1993, Morgan Kaufmann, ISBN 1-55860-190-2
  • Philip A. Bernstein, Eric Newcomer, Principles of Transaction Processing, 1997, Morgan Kaufmann, ISBN 1-55860-415-4
  • Ahmed K. Elmagarmid (Editor), Transaction Models for Advanced Database Applications, Morgan-Kaufmann, 1992, ISBN 1-55860-214-3
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK