Database Basics
Among the ACID properties a transaction should have, which is the property that a transfer debiting account A and crediting account B is either carried out completely or not at all, even if a failure occurs partway through?
- AConsistency
- BDurability
- CAtomicity
Show answer and explanation
Answer: C. Atomicity
The ACID properties are named after the initials of four properties a transaction should satisfy. Atomicity means the operations in a transaction are either all executed or none are; if a failure occurs, the updates made so far are cancelled. Consistency means the data keeps satisfying integrity constraints (balances never negative, foreign keys always referring to existing rows, and so on) before and after the transaction. Isolation means that transactions running concurrently do not interfere with each other and produce the same result as if they had been executed one at a time. Durability means that the results of a committed transaction are not lost even if a failure occurs afterwards. The all-or-nothing property in the question is atomicity.
- A. Consistency is the property that data keeps satisfying integrity constraints before and after a transaction.
- B. Durability is the property that committed results survive later failures.
- C. Correct. Atomicity is the property that everything is executed or nothing is.