Transactions
- A transaction groups several writes so they succeed together or not at all
5:06.
- Canonical example: debiting one account and crediting another inside one transaction
5:06.
- Failure scenario without transactions: customer A is debited 100, the credit step fails — account B never receives the money and account A has lost it
5:35.
- Rule of thumb: always use transactions — it's all or nothing, then you commit
5:35.
ACID — the characteristics of transactions
| Property | Meaning |
|---|
| Atomicity | All writes happen or none do |
| Consistency | Rules and constraints always hold |
| Isolation | Concurrent transactions don't corrupt each other |
| Durability | Once committed, it survives a crash |
All four defined at 5:35–6:29.