Shadow Paging
Shadow paging is a copy-on-write technique: modifications go to new page copies and the page-table pointer is atomically switched, enabling log-free crash recovery.
Purpose
To understand the alternative WAL-free recovery mechanism, used in embedded databases like LMDB.
Mechanism
On modification, copy the page to a new location and update the shadow page table. At commit, atomically switch the shadow page table pointer (a single atomic write). Old pages can be reclaimed. Needs no WAL but has high write amplification and suits small databases.
Use cases
- Embedded database design
- Log-free recovery
- Copy-on-write