ITP

BE - Database Management Systems

Define various approach used for Log based recovery

In : BE Subject : Database Management Systems

log-based recovery is a technique used to restore the database to a consistent state after a crash or failure. A log is a sequential record that stores all database operations performed by transactions. The log is maintained on stable storage, and each entry usually contains information such as the transaction ID, the type of operation (update, commit, abort), and the values before and after the update. In case of a failure, the recovery manager uses this log to determine which transactions need to be undone or redone. There are mainly two approaches used for log-based recovery:

  1. Deferred Update (No-Undo/Redo):
    In this approach, all updates made by a transaction are recorded in the log but are not written to the database until the transaction successfully commits. Since changes are applied only after commit, if a crash occurs before commit, there is nothing to undo. After recovery, only redo operations are required for committed transactions.

  2. Immediate Update (Undo/Redo):
    In this approach, updates made by a transaction are applied to the database immediately (even before the transaction commits), while also recording them in the log. If a transaction fails before commit, its changes must be undone using the log. If a committed transaction’s changes are lost due to a crash, they must be redone. Hence, this method requires both undo and redo operations during recovery.

About us

A truly open platform where you may ask questions and get answers. We also provide comprehensive and easy-to-understand answers to question papers.  discover...

Site status

Flag Counter

Privacy Policy

Sitemap