What is Shadow Paging?

Nadeem Khan
2 min readMay 9, 2021

--

What is shadow paging?

Shadow paging an alternative of log based system and is used to recover the database.

During the process of shadow paging two page tables create such as current page table and shadow page table to access the pages of the disk (where data is stored). And if the system crash, our data will be saved by shadow page.

How shadow paging works?

As we know the entire information store in disk. And which is divided into blocks/pages. It is not mandatory that all the pages will be consecutive in the order.

Now we maintain a page table or current page which pointer (like C pointer) helps us to access the data of the disk.

On executing the transaction, we access the pages of the disk and take them into the memory and for to do read or write operation, we do update in the disk. For this another page is required that’s called Shadow Page.

Let’s assume we have a transaction T. And this transaction wants to access first page.

· By current page table we can reach the location of first page

· By accessing this page, we take it to the memory

· Current page transfer this page (first page) to the unused space of the disk.

· All the updating will have been perform here (in the free space of disk).

· Now Shadow page point the current status of the page.

How shadow paging helps?

If the transaction gets failed or our system gets crashed while updating the page which is pointing by shadow page, that page will be pointed by current page.

Learn More

--

--

Nadeem Khan
Nadeem Khan

Written by Nadeem Khan

0 Followers

Hello everyone. Thanks for coming here. This is Nadeem. I am a digital marker, a coder, writer.

No responses yet