Which of the following is an alternative to the log-based recovery schemes in database recovery system?
Shadow paging
Database recovery is a crucial process that ensures data consistency and integrity in case of failures such as system crashes, transaction errors, disk failures, or power outages. The goal is to restore the database to a consistent state that existed before the failure occurred. Various schemes are employed for database recovery.
One of the most common approaches to database recovery is using a log. A log is a sequence of records that details all update activities in the database. Before an update is made to the database on disk, a log record is written to the log. This log contains information like the transaction identifier, the data item affected, and the old and new values of the data item. There are two main types of log-based schemes:
During recovery using logs, the system reads the log records and undoes or redoes operations as needed to bring the database to a consistent state.
While log-based recovery is widely used, there are alternative schemes. One significant alternative is Shadow Paging. This scheme does not rely on a log for undo/redo operations. Instead, it maintains two versions of the page table during the lifetime of a transaction: the current page table and the shadow page table.
Let's break down the process:
Therefore, Shadow Paging is the technique among the given options that serves as an alternative to log-based recovery schemes for database recovery.
| Feature | Log-Based Recovery | Shadow Paging |
|---|---|---|
| Mechanism | Uses a log of changes (undo/redo). | Uses two page tables (current and shadow). |
| Updates | Logged before/after writing to page. | Written to new physical pages; page table updated. |
| Commit | Log records are forced to disk; commit record written. | Current page table becomes valid; pointer updated. |
| Failure Recovery | Scans log to undo uncommitted and redo committed transactions. | Discard current page table; use shadow page table. No undo/redo. |
| Overhead | Log maintenance, I/O for log. | Copying page table, garbage collection of old pages. |
| Storage | Requires space for the log file. | Requires space for multiple page tables and new pages. |
Database recovery mechanisms like log-based recovery and shadow paging are essential for ensuring the ACID properties (Atomicity, Consistency, Isolation, Durability) are maintained even in the presence of failures. Durability, in particular, requires that once a transaction commits, its changes are permanent and survive system failures. Recovery schemes provide the means to achieve this.
While Shadow Paging avoids the need for undo/redo logic on data pages, it can be inefficient for large databases due to copying the entire page table. Log-based recovery is often preferred in practice, especially for concurrent transactions, although it has its own complexities related to checkpointing and log management.
The magazine in which Mahatma Gandhi mentioned what he wanted the Constitution to do is:
Which gas shields the surface of the earth from ultraviolet radiation from the sun?
Which event is marked as an Intangible Cultural Heritage of Humanity by UNESCO?
Who has been conferred with the rank of the Commander of the Order of the British Empire in 2018?
Who directead the film ‘Bhuvan Shome’?