ACID properties are four guarantees associated with reliable database transactions: atomicity, consistency, isolation, and durability. Together, they describe how a transaction groups operations into a logical unit, preserves defined correctness rules, interacts with concurrent transactions, and survives failures after commitment. They are central to database management systems, although the precise guarantees provided by a product depend on its configuration, isolation level, transaction scope, and assumed failure conditions.
Transactions and the ACID model
A transaction is a sequence of operations treated as a single logical unit of work. It may read and modify multiple records, tables, or other database objects. A successful transaction commits, making its outcome permanent within the system’s guarantees; an unsuccessful transaction aborts, discarding its transactional changes.
A transfer between two bank accounts illustrates the four properties. Suppose a transaction transfers an amount from account to account :
Atomicity requires that both updates take effect or neither does. Consistency requires that the transaction preserve applicable rules, such as conservation of the combined balance. Isolation governs what happens when other transactions access the accounts concurrently. Durability requires the committed transfer to survive the failures covered by the database’s persistence guarantees.
ACID is not a particular algorithm, storage format, or database architecture. Different systems implement these guarantees using different combinations of concurrency control, logging, recovery, and replication mechanisms.
Atomicity
Atomicity means that a transaction’s transactional effects occur completely or not at all. If a transaction fails after performing only some of its operations, those partial effects must not remain as the transaction’s final outcome.
For the account transfer, subtracting money from one account without crediting the other would violate atomicity. A transaction manager must either complete both updates or restore the relevant database state.
Atomicity does not mean that all instructions execute at exactly the same instant. A transaction can take substantial time and modify many storage pages. Whether other transactions can observe intermediate changes is governed by isolation.
Common implementation techniques include:
- Undo logging, which records information needed to reverse uncommitted modifications.
- Deferred updates, which postpone installing some changes until commitment.
- Shadow paging, which preserves an earlier page structure while constructing an updated version.
Atomicity also has a defined scope. Rolling back database writes does not ordinarily retract an email, reverse an external payment, or undo a file written outside the transaction’s participating resources. Coordinating such effects requires additional protocols or application-level mechanisms.
Consistency
Consistency means that a transaction takes the database from one valid state to another, preserving its specified integrity rules. These rules may include data types, uniqueness requirements, relationships between records, and application-specific invariants.
In a relational database, declarative constraints can enforce some of these rules directly. A primary key identifies records uniquely, while a foreign key can require a referenced record to exist. More complex rules, such as keeping a financial ledger balanced, may require additional application logic or database procedures.
Consistency is therefore a shared responsibility. The database enforces the constraints it knows about and provides transaction mechanisms, but it cannot infer every intended business rule. An otherwise fully transactional system can commit an incorrect calculation if the application expresses that calculation and no enforced constraint rejects it.
Consistency also depends on concurrency behavior. Transactions that individually preserve an invariant when executed alone may violate it when interleaved under a weaker isolation level.
The word consistency has other meanings in computing. ACID consistency concerns valid database states; it is not synonymous with replicas containing identical data or with the consistency models used in distributed systems.
Isolation
Isolation governs how concurrent transactions interact and which effects they can observe. Its strongest conventional formulation is serializability: the outcome of concurrent committed transactions must be equivalent to some serial execution of those transactions.
Serializable execution does not require transactions to run one at a time. Operations can overlap as long as their combined behavior remains equivalent to an allowed serial order.
Isolation levels and anomalies
Many databases expose weaker transaction isolation levels to reduce coordination costs or improve concurrency. Commonly named levels include Read Uncommitted, Read Committed, Repeatable Read, and Serializable. Their exact behavior can differ across implementations, so the level’s name alone does not fully specify its guarantees.
Important concurrency anomalies include:
- Dirty reads: reading data written by a transaction that has not committed.
- Non-repeatable reads: obtaining different values when reading the same item again because another transaction committed a change.
- Phantom reads: obtaining a different set of matching rows when repeating a query because another transaction changed qualifying records.
- Lost updates: one transaction’s update unintentionally overwriting another’s.
- Write skew: transactions reading overlapping data and updating different items in a way that jointly violates an invariant.
Snapshot isolation lets transactions read a consistent snapshot and typically rejects conflicting concurrent writes to the same item. However, it is not generally serializable: write skew can remain possible.
For example, two transactions may each verify that another employee remains on call, then independently mark a different employee as off duty. Both may commit under snapshot isolation, leaving nobody on call even though each transaction appeared valid against its snapshot.
Concurrency-control mechanisms
Isolation can be implemented through several approaches:
- Locking, which restricts conflicting access to records, ranges, or other objects.
- Optimistic concurrency control, which allows work to proceed and checks for conflicts before commitment.
- Multiversion concurrency control, which maintains multiple versions of data so readers and writers can operate with less blocking.
- Serializable conflict detection, which identifies dependency patterns that could produce nonserializable execution.
Multiversion storage alone does not establish a particular isolation guarantee; the rules for visibility and conflict handling matter. Serializable implementations may block transactions or abort them when necessary to preserve correctness.
Serializability also does not necessarily require transaction order to respect real-world completion order. Strict serializability adds that requirement.
Durability
Durability means that once a transaction commits, its effects survive subsequent failures within the system’s stated failure model.
A database commonly provides durability through write-ahead logging. Recovery information is made persistent before the corresponding modified data pages are allowed to become persistent. After a crash, the recovery process can reconstruct committed changes even when some updated pages had not yet reached their final storage locations.
Durability does not necessarily require writing every modified database page before acknowledging commitment. Persisting sufficient recovery information can be enough. Systems may use group commit to share storage synchronization work across several transactions while retaining their durability guarantees.
The strength of durability depends on the entire persistence path, including the operating system, storage devices, caches, and configuration. A mode that acknowledges commits before the required log records reach persistent storage may lose recently acknowledged transactions after a crash.
Durability is not an unconditional promise against every kind of loss. Surviving a process crash, a power failure, a disk failure, and the destruction of an entire site are different requirements. Replication and backups address additional failure scenarios, but their guarantees depend on how and when copies are made.
Distributed transactions
In distributed computing, a transaction may span multiple servers, partitions, or independently managed resources. Preserving ACID guarantees then requires coordination across those participants.
Two-phase commit is a classical protocol for coordinating an all-or-nothing decision. A coordinator first asks participants to prepare; it then directs them to commit or abort. In its basic form, failures can leave prepared participants waiting for a decision, potentially retaining locks or other resources.
Atomic commitment and replicated agreement solve related but distinct problems. A consensus algorithm can help maintain a replicated decision or database state despite certain failures, but it does not by itself provide every aspect of transaction isolation, integrity checking, and cross-resource atomicity.
Distributed ACID transactions generally require communication and coordination. This can increase latency and reduce availability during some failures. Nevertheless, distribution does not inherently rule out ACID guarantees: distributed databases can provide strongly isolated, durable transactions when their protocols and operational assumptions support them.
Relationship to other database concepts
ACID and CAP
The CAP theorem concerns the limits of simultaneously providing a particular form of consistency and availability during a network partition. Its consistency condition is usually expressed through linearizability, not through ACID’s definition of consistency.
Consequently, ACID and CAP are not opposing classifications. ACID describes transaction guarantees, whereas CAP addresses a specific limitation in distributed operation.
ACID and eventual consistency
Eventual consistency generally means that replicas converge if updates cease and communication continues under the model’s assumptions. It does not specify the atomicity or isolation of individual transactions.
A system can provide ACID transactions within one node or partition while replicating their results asynchronously elsewhere. Conversely, a system can replicate individual operations strongly without supporting general multi-operation transactions.
ACID and database categories
ACID is historically associated with relational databases and SQL, but it is not restricted to them. Some NoSQL databases support multi-record transactions, while some relational systems offer weaker durability settings or default isolation levels below Serializable.
Claims of “ACID compliance” therefore need a scope: the guarantee may apply to a single record, one partition, an entire database, or multiple participating systems.
Historical development
The underlying ideas developed through research on transaction processing, concurrency control, and database recovery during the 1970s and early 1980s. Work on systems such as System R helped establish practical transaction-processing techniques.
Theo Härder and Andreas Reuter introduced the acronym ACID in their 1983 paper Principles of Transaction-Oriented Database Recovery. Their formulation brought together properties that had already emerged in transaction-processing research.
ACID subsequently became a standard vocabulary for describing database reliability. It remains a framework of guarantees rather than a single certification standard: evaluating a system requires examining its documented behavior, supported transaction boundaries, isolation settings, persistence configuration, and failure assumptions.