Recovery Intuition: Change Tracking 📝
💡 The Database Challenge
Scale: Tables have billions of rows, transactions change a tiny subset
Copying entire database for each transaction would be impossibly slow
🎯 Solution: Track only what changes - just like Google Docs and Git!
You Already Know This!
Google Docs Version History

Key insight: Google Docs doesn't store 50 complete document copies. It stores the changes between versions.
Git Version Control

Key insight: Git doesn't store every file version. Conceptually, it stores diffs - what changed, when, and by whom.
Example Change Tracking in DB 🎫
Let's see how this applies to our ticket resale scenario:


Instead of storing complete database snapshots, we track:
📝 Before & After Values
⏰ When it changed: Transaction timing and sequence
🆔 Who changed it: Which transaction made the change
🎯 Recovery Goals
✅ COMMIT: Make changes permanent and visible
❌ ABORT: Undo changes, return to original state
💥 CRASH: Determine what to keep vs. what to discard