A transaction groups multiple statements into one all-or-nothing unit — the mechanism that keeps a bank transfer from debiting one account without crediting the other. ACID is the theory; InnoDB is the implementation.
Key Points
- Atomicity: all statements succeed or none do
- Consistency: data moves from one valid state to another
- Isolation: concurrent transactions don't corrupt each other
- Durability: once committed, data survives crashes (redo log)
- Usage: START TRANSACTION; UPDATE …; UPDATE …; COMMIT; (or ROLLBACK)
- Only transactional engines like InnoDB provide ACID — MyISAM doesn't
.png)