ACID Properties
Context: FIT2094_MOC · the four guarantees a correct transaction must satisfy · A/D from recovery, I from locking
Quick Revision
- 🎯 Objective: the guarantees every transaction upholds ➔ Atomicity, Consistency, Isolation, Durability.
- ⚡ Key Constraint: these are guarantees under failure/concurrency — Isolation is enforced by locks, Atomicity+Durability by the transaction log.
📝 Core
- Atomicity ➔ all statements succeed or none do; a failed step triggers ROLLBACK so no partial change remains (“all or nothing”).
- Consistency ➔ moves the DB from one valid state to another; PK/FK/CHECK/business rules hold before and after (may be momentarily broken during).
- Isolation ➔ concurrent transactions don’t interfere; the DBMS locks data so one completes before another modifies it (“independent”).
- Durability ➔ once COMMITted, changes survive crash/restart/power loss (“data is permanent”).
- Mnemonic ➔ All-or-nothing · Correct/consistent state · Independent · Data permanent.
⚠️ Common Mistakes
- 💡 Consistency is violated mid-transaction on purpose ➔ e.g. A{-}\100B{+}$100$ leaves money “missing”; the guarantee is only about the committed start and end states.
- 💡 Isolation ≠ serial execution ➔ interleaving is allowed; locks just make the result equivalent to some serial order.
🧠 Active Recall
Map each ACID property to the mechanism that enforces it.
Answer
- Short answer: Atomicity & Durability ← transaction log (UNDO/REDO); Isolation ← locking (S/X, 2PL); Consistency ← constraints + the other three.
- Why: Failure vs concurrency ➔ the log handles crash recovery (A, D); locks handle interference (I); together they preserve valid state (C).