ACID is a set of four properties: atomicity, consistency, isolation, and durability. that ensure database transactions are processed reliably. In IB Computer Science HL, these properties explain how a database management system protects data when transactions overlap or fail.
A transaction is a sequence of database operations treated as one logical unit. For example, transferring money between accounts requires both debiting one account and crediting another.
| Property | Meaning | Bank-transfer example |
|---|---|---|
| Atomicity | Every operation in a transaction is completed, or none is completed. The transaction is indivisible. | If the credit operation fails, the debit is rolled back. Money cannot disappear. |
| Consistency | A transaction moves the database from one valid state to another while preserving defined rules and constraints. | Balance rules, data types, keys, and other integrity constraints remain satisfied. |
| Isolation | Concurrent transactions do not interfere in a way that produces incorrect intermediate results. Each behaves as though it were executed separately. | Another transaction cannot use an unfinished balance produced midway through the transfer. |
| Durability | Once a transaction has been committed, its changes remain stored even after a crash or power failure. | A completed transfer is recovered from persistent storage or transaction logs after restart. |
The database management system supports these properties through mechanisms such as commit, rollback, locking, concurrency control, and transaction logs. A successful transaction is committed; an unsuccessful one is rolled back to restore the previous valid state.
A common misconception is that consistency means all duplicated data is identical. In ACID, consistency specifically means that transactions preserve the database's integrity rules. Likewise, isolation does not necessarily require transactions to run one at a time; it requires concurrent execution to produce a valid result equivalent to an acceptable sequential execution.
For an IB exam response, define all four properties precisely and apply each one to a transaction scenario. When asked to explain, link every property to its consequence rather than merely expanding the acronym. This content belongs to A3.3 Database programming.