Shadow paging in DBMS

Bsc 033 Devaraj B
2 min readMay 9, 2021

--

In this article we are going to discuss about shadow paging in DBMS and its advantages and disadvantages.

Shadow paging:-

  1. Shadow Paging is recovery technique that is used to recover database. In this recovery technique, database is considered as made up
    of fixed size of logical units of storage which are referred as pages. pages are mapped into physical blocks of storage, with help of
    the page table which allow one entry for each logical page of database. This method uses two page tables named current page table and
    shadow page table.
  2. The entries which are present in current page table are used to point to most recent database pages on disk. Another table i.e., Shadow
    page table is used when the transaction starts which is copying current page table. After this, shadow page table gets saved on disk and
    current page table is going to be used for transaction. Entries present in current page table may be changed during execution but in shadow page table it never get changed.
    After transaction, both tables become identical.This technique is also known as Cut-of-Place updating.

Shadow paging considers:-

1)The database is partitioned into fixed-length blocks referred to as PAGES.
2) Page table has n entries — one for each database page.
3) Each contain pointer to a page on disk (1 to 1st page on database and so on…).

The idea is to maintain 2 pages tables during the life of transaction.

1)The current page table.
2) The shadow page table.

When transaction starts, both page tables are identical

1)The shadow page table is never changed over the duration of the transaction.
2) The current page table may be changed when a transaction performs a write operation.
3) All input and output operations use the current page table to locate database pages on disk.

Advantages of shadow paging:-
*This method require fewer disk accesses to perform operation.
*In this method, recovery from crash is inexpensive and quite fast.
*There is no need of operations like- Undo and Redo.

Disadvantages of shadow paging:-
* Data gets fragmented or scattered.
* After every transaction completion database pages containing old version of modified data need to be garbage collected.
* Hard to extend algorithm to allow transaction to run concurrently.

Website:-

https://www.tutorialcup.com/

--

--

No responses yet