Back to the 2021 paper

Unit 3: Storage and Transaction Processing

20217m

Write a short note on any one of the foflowing:

  • (b) Database recovery
Worked SolutionAI Assisted

Short note on Database Recovery:

Recovery restores database to consistent state after failure (crash, power, media) ensuring atomicity and durability via ACID.

Techniques:

  • Log-Based: Write-Ahead Logging (WAL) records <T, X, old, new> before DB update to stable log. Undo/Redo.

  • Shadow Paging: Keep shadow copy, switch pointer on commit.

  • Checkpoints: Periodic flush, log checkpoint record to bound recovery time.

Recovery types: Immediate (steal, uncommitted updates on disk need UNDO) vs Deferred (no steal, only REDO).

ARIES algorithm: Analysis (identify active/dirty), Redo (repeat history), Undo (rollback loser transactions).

Example: Log <T1 start>, <T1,A,0,5>, commit. Crash after T1 commit but before flush - redo applies A=5. If T2 uncommitted had B=5 on disk, undo restores B=0.

Importance: prevents loss, ensures durability.

Similar questions

Free AppAndroid App

Coursify Android App

Generate AI courses, take quick quizzes between classes, and master complex engineering concepts on the go.