A transaction is unit of work consisting of one or more requests or updates to a system. A transaction is successfully completed with a commit command that finalizes all changes. If the transaction is not successful, a rollback command is used to undo changes and return the system to its previous state. A transaction, therefore, processes either all or none of its changes.
Consider, for example, the common transaction of withdrawing money from a checking account. The customer enters the request at an automated teller, causing a program to check the availability of funds, dispense the money, and update the balance of the user account. Each step must be completed before a successful transaction can occur.
Transaction processing software keeps track of each part of the transaction, ensuring data integrity by verifying that the transaction has been successfully completed before performing any updates.
The four basic properties of a transaction are known as the ACID properties: