Briefly explore the shadow paging recovery technique.
Shadow Paging is an alternative recovery technique to log-based recovery. It offers a different approach to maintaining atomicity and durability. This method works by dividing the database on disk into fixed-size blocks called 'pages'. The system maintains a 'page table' that points to the most recent or 'current' pages of the database. When a transaction begins and needs to modify a page, the system does not overwrite the original page. Instead, it copies the page to a new, unused location on the disk and makes the modification to this new copy. This new copy is called the 'shadow page'. The system also creates a 'shadow page table', which is a copy of the original page table. This shadow page table is then updated to point to the new shadow page instead of the original one. The original page and page table are left untouched. To commit the transaction, the system performs a single atomic operation: it makes the shadow page table the new current page table. If the system crashes before the commit, the shadow page table is simply discarded, and the database is instantly back to its original state because the original page table was never changed. This makes undoing transactions very efficient. However, shadow paging has drawbacks, such as disk fragmentation and high commit overhead, which is why log-based recovery is more commonly used in modern systems.