ACID properties

Home > Computer Science > Database Systems > ACID properties

A set of properties that ensure that database transactions are processed reliably.

Transactions: A transaction is a set of operations that are seen as a single unit of work. The ACID properties guarantee that each transaction executes completely, or not at all.
Atomicity: Atomicity ensures that a transaction is treated as a single, indivisible unit of work. Either all operations in the transaction are performed, or none of them are.
Consistency: Consistency ensures that a transaction moves the database from one valid state to another. This means that when a transaction is complete, the database is in a state that is consistent with the rules and constraints.
Isolation: Isolation ensures that a transaction is executed in a way that is independent of other transactions. Each transaction can only see the state of the database as it was at the beginning of the transaction.
Durability: Durability ensures that once a transaction is complete, its changes to the database are permanent, even in the event of a power outage or system failure.
Rollback: Transactions can be rolled back if an error occurs during the transaction. This restores the database to its state before the transaction began.
Write-ahead logging: Write-ahead logging is a technique used by many database systems to ensure durability. It involves writing all changes to a log file before they are applied to the actual database.
Locking: Locking is the technique used to ensure isolation between transactions. Locks are placed on data that is being accessed by a transaction, so it cannot be modified by another transaction.
Deadlocks: Deadlocks occur when transactions are waiting on each other to release locks. Techniques like timeouts and resource preemption are used to resolve deadlocks.
Serializability: Serializability is the property of a transaction schedule that ensures that the schedule would have produced the same result if the transactions had been executed in serial order.
Two-phase commit: Two-phase commit is a protocol used to ensure that distributed transactions are completed atomically across multiple systems.
Conflicts and resolution: Conflicts can occur when two transactions try to modify the same data. Techniques like optimistic and pessimistic concurrency control are used to resolve conflicts.
Atomicity: This property guarantees that a transaction is treated as a single, indivisible unit of work. Either all changes are committed, or none of them are. If a transaction is interrupted by a system failure or error, it is rolled back to its original state, leaving the database unchanged.
Consistency: This property ensures that the database remains consistent over time, regardless of the number of transactions that are processed. Each transaction must conform to the defined rules and constraints of the database, so that every transaction brings the database from one valid state to another.
Isolation: This property guarantees that transactions do not interfere with each other, even if they are processed concurrently. Each transaction is executed in its own "space" or "bubble," so that changes made by one transaction are not visible to other transactions until they have been committed.
Durability: This property ensures that once a transaction is committed, its changes are permanent and cannot be undone. Even if there is a system failure or power outage, the changes made by a committed transaction are retained indefinitely.