Recap
Crash Recovery
Recovery algorithms
ensure database consistency, atomicity, and durability
despite failures.
Two main phases of recovery:
Normal processing actions
: Ensure the DBMS can recover from failures.
Post-failure actions
: Restore the database to a consistent state.
Failure Classification
Transaction Failures
(e.g., constraint violations, deadlocks)
System Failures
(e.g., DBMS crashes, power failures)
Storage Media Failures
(e.g., disk corruption, hardware failures)
Undo vs. Redo
Operation
Purpose
Undo
❌
Reverts changes of an
incomplete or aborted
transaction.
Redo
✅
Reapplies changes of a
committed
transaction for durability.
The method used depends on the
buffer management policy
.
Write-Ahead Logging (WAL)
Definition:
A
log file
records all changes made to the database before they are written to disk.
This log ensures
durability and consistency
.
WAL Protocol:
Before writing any modified data to disk,
log records must be flushed
to non-volatile storage.