AlgoPlus//structures / recovery
Read the theory

Recovery & Logging

After a crash, redo committed transactions and undo uncommitted ones from the write-ahead log.

Phase
Redo
Undo
Legend
Redo (committed)
Undo (uncommitted)
Crash
AI Tutor Workspace
In a nutshell
To survive crashes, a database keeps a write-ahead log: it writes down each change before applying it. When it restarts after a crash, it scans the log from the last checkpoint, redoes the work of transactions that had committed (using the recorded new values) and undoes transactions that hadn't (using the old values), restoring a clean, consistent state.
Ready
Press play to begin the cinematic walkthrough.
Write-ahead logging records old and new values before changes. After a crash, recovery scans from the last checkpoint, redoes committed transactions (new values) and undoes uncommitted ones (old values) — preserving atomicity and durability.
Key terms
Go deeper in the lesson
Read the full theory, intuition & complexity for Recovery & Logging.