What do the ACID properties mean?
Instruction: Explain atomicity, consistency, isolation, and durability, including a limit of each guarantee.
Updated
Example Answer
ACID describes four transaction guarantees. Atomicity means the transaction succeeds as a whole or is rolled back. Consistency means it preserves enforced database rules. Isolation controls how concurrent transactions interact. Durability means a committed change survives failures within the database’s durability guarantees.
How I would apply it
For a transfer, atomicity keeps the debit and credit together. Constraints can enforce valid balances, but application code still has to implement the correct transfer rule. Isolation prevents certain concurrent anomalies depending on the chosen level; it does not mean every level behaves like fully serial execution. Durability depends on the database’s configuration and storage guarantees, and it is not a substitute for backups.
A useful follow-up is: “Which isolation level would you choose for this operation, and which anomalies would you need to prevent?”
Reference
PostgreSQL: transaction isolation, PostgreSQL: durability and WAL