Transaction databases
What Are Transaction Databases?
Transaction databases are database management systems designed to process sequences of read and write operations as indivisible units, called transactions, while preserving data integrity even under concurrent access and system failures. A transaction groups one or more operations such that they either all take effect or none do, eliminating the partial-update states that would leave data inconsistent. These systems are optimized for online transaction processing (OLTP) workloads characterized by many short, concurrent operations, such as financial payments, order placements, and inventory updates.
Transaction databases derive their foundational principles from relational database theory and the formal study of concurrency control, developed primarily in the 1970s and 1980s at IBM Research and at Berkeley. Jim Gray's work on transactions and recovery, recognized with the 1998 Turing Award, established the theoretical and engineering basis for the transaction models used in commercial database systems today.
Transaction Concepts and ACID Properties
The correctness requirements for transaction databases are expressed through four properties known collectively as ACID: atomicity, consistency, isolation, and durability. Atomicity guarantees that a transaction is treated as a single unit: either all its operations commit to the database or none do, with the system rolling back any partial changes if a failure occurs mid-transaction. Consistency requires that a completed transaction moves the database from one valid state to another, respecting all integrity constraints and business rules. Isolation ensures that concurrently executing transactions do not observe each other's intermediate states, preserving the illusion of serial execution. Durability guarantees that once a transaction commits, its changes survive subsequent system failures, typically enforced through write-ahead logging to persistent storage. The Airbyte technical guide on transactional databases and ACID properties gives a practical account of how these properties interact, noting that the implementation of atomicity and durability depends on the same transaction log infrastructure, while isolation is managed separately through locking or multiversion concurrency control.
Concurrency Control
When multiple transactions execute simultaneously, they must be coordinated to prevent anomalies such as dirty reads, non-repeatable reads, and phantom reads. Two-phase locking (2PL) is the classical concurrency control protocol: a transaction acquires all needed locks before releasing any, guaranteeing serializability at the cost of potential deadlocks. Multiversion concurrency control (MVCC), used by PostgreSQL, Oracle, and MySQL InnoDB, maintains multiple versions of each data item so that readers do not block writers and vice versa, improving throughput at the expense of storage for old versions and the overhead of garbage collection. SQL transaction isolation levels, defined in the ISO SQL standard and ranging from Read Uncommitted to Serializable, give applications control over the trade-off between consistency and concurrency. The AWS comparison of ACID and BASE database models situates ACID transaction databases relative to distributed systems that relax isolation for higher availability, a trade-off formalized in the CAP theorem.
Persistence and Recovery
Durability is implemented through recovery mechanisms that reconstruct the committed database state after crashes. Write-ahead logging (WAL) records changes to a sequential log on persistent storage before applying them to the data pages; during recovery, the system replays committed log records and undoes uncommitted ones to restore consistency. Checkpointing periodically flushes dirty pages and advances the log recovery point, bounding the amount of log that must be replayed after a failure. Modern distributed transaction databases, such as Google Spanner, extend these single-node mechanisms to globally distributed systems using two-phase commit and Paxos-based consensus. Teradata's overview of ACID compliance discusses how enterprise-scale analytic databases extend ACID guarantees to massively parallel processing architectures without sacrificing the transactional consistency that financial and regulatory workloads require.
Applications
Transaction databases have applications in a wide range of fields, including:
- Banking and financial services for payment processing and account management
- E-commerce order management and inventory tracking
- Healthcare systems for patient record updates and prescription processing
- Airline and hotel reservation systems
- Supply chain management and logistics tracking
- Regulatory reporting and audit trail maintenance