/trænˈzækʃən/
noun — "atomic unit of work in computing."
Transaction is a sequence of operations performed as a single, indivisible unit in computing or database systems. A transaction either completes entirely or has no effect at all, ensuring system consistency. It encapsulates multiple read, write, or update actions that must succeed together, maintaining data integrity even under concurrent access or system failures.
Technically, transactions are defined by the ACID properties: Atomicity, Consistency, Isolation, and Durability. Atomicity ensures all operations within the transaction are applied fully or not at all. Consistency guarantees that the system remains in a valid state after the transaction. Isolation ensures that concurrent transactions do not interfere with each other, and Durability preserves the committed changes permanently. Database management systems implement transactions through mechanisms like write-ahead logs, locks, or multi-version concurrency control (MVCC).
In workflow terms, a typical example is a bank transfer. A transaction debits Account A and credits Account B. Both actions must succeed together; otherwise, the transaction is rolled back, leaving both accounts unchanged. Similarly, in e-commerce, an order placement may update inventory, process payment, and send a confirmation email—all encapsulated within a single transaction to ensure consistency.
Transactions are also used in distributed systems. Distributed transactions coordinate multiple nodes or services to maintain consistency across a network, often using protocols like two-phase commit or consensus algorithms to guarantee ACID properties across disparate systems.
Conceptually, a transaction is like a sealed envelope containing multiple instructions: it either delivers everything inside or nothing at all, ensuring no partial execution can corrupt the system.
See ACID, Atomicity, Consistency, Isolation, Durability.