Transactions - Life Preservers
Classic: system crash between one bank account being debited and another being credited.
Dramatic: power failure during update statement on 3 million rows after 2 seconds when only part way through.
Real-world: complex series of inter-related updates, deletes and inserts on many separate tables fails at the last step due to a duplicate unique key on an insert.
Transaction recovery would handle all these situations automatically.
- Makes a system far more robust and trustworthy over the long term.
Use transactions if your database supports them.
- If it doesn't and you need them, switch to a different database.