Which of the following techniques is an alternative to log based reco...
Shadow paging is an alternative to transaction log based recovery technique. This is the method where all the transactions are executed in the primary memory or the shadow copy of the database. Once all the transactions are completely executed, it will be updated to the database.
View all questions of this test
Which of the following techniques is an alternative to log based reco...
Shadow paging
Shadow paging is an alternative to log-based recovery technique used in database management systems. It is a technique that provides recovery and concurrency control without the need for maintaining a log file.
How Shadow Paging works:
1. Pages: In shadow paging, the database is divided into fixed-size pages. Each page consists of a header and data area.
2. Shadow Page Table (SPT): Shadow paging uses a separate data structure called the Shadow Page Table (SPT) to keep track of the pages. The SPT contains information about the current state of each page, such as whether it is in use or free, and the address of its corresponding shadow page.
3. Shadow Pages: Shadow pages are copies of the original pages that are created during the checkpoint operation. They are used for recovery in case of failures.
4. Checkpoint: Periodically, a checkpoint operation is performed to update the shadow pages. During the checkpoint, the entire database is copied into the shadow pages, and the SPT is updated to point to the new shadow pages.
5. Transaction Execution: During normal operation, when a transaction modifies a page, it creates a copy of the original page and applies the modifications to the copy. The SPT is updated to point to the new shadow page.
6. Transaction Commit: When a transaction is committed, the modified pages are written back to the original pages, and the SPT is updated to reflect the changes.
7. Transaction Abort: If a transaction is aborted, the modified pages are discarded, and the SPT is reverted to point to the original pages.
8. Recovery: In case of a failure, the system can recover by restoring the original pages from the shadow pages using the SPT.
Advantages of Shadow Paging:
- Simplicity: Shadow paging is a relatively simple recovery technique compared to log-based recovery.
- No log maintenance: Since shadow paging does not use a log file, there is no need to maintain and update the log during normal operation, reducing overhead.
- Faster recovery: Recovery in shadow paging is faster compared to log-based recovery as it involves restoring the original pages directly from the shadow pages.
Disadvantages of Shadow Paging:
- Increased storage overhead: Shadow paging requires additional storage space to maintain the shadow pages.
- Limited concurrency control: Shadow paging does not provide fine-grained concurrency control mechanisms like locking, which may result in reduced concurrency in a multi-user environment.
Overall, shadow paging is an alternative recovery technique that provides simplicity and faster recovery compared to log-based recovery. However, it has certain limitations in terms of storage overhead and concurrency control.
To make sure you are not studying endlessly, EduRev has designed Railways study material, with Structured Courses, Videos, & Test Series. Plus get personalized analysis, doubt solving and improvement plans to achieve a great score in Railways.