Last Updated : 13 Aug, 2025
Database Systems, like any other computer system, are subject to failures. Whether it's a sudden power outage, a software bug, or a hardware crash, a Database Management System (DBMS) needs a way to get back up and running without losing data or leaving it in a corrupted state. This process of restoring the database to a correct and consistent state is called recovery.
Types of Recovery Techniques in DBMSThe main aim of recovery is to maintain "atomicity" and "durability", which are two important parts of the ACID properties:
Some of the main database recovery techniques in DBMS are:
1. Log-Based RecoveryOne of the most common recovery methods in modern databases. The DBMS keeps a log file (or journal) on stable storage that records every change—insert, update, or delete—before it is applied to the database.
If a failure occurs, the DBMS reads the log to decide what to do:
Log-based recovery is mainly implemented in one of the following two ways:
Shadow Paging is an alternative recovery technique that avoids the need for a log. It works by keeping two versions of the database pages during a transaction: a current page table and a shadow page table
If the transaction commits, the current page table becomes the new shadow. If it fails, the system discards the modified pages and reverts to the shadow- no undo/redo needed.
3. Checkpointing: Making Recovery FasterNote: While simple in concept, shadow paging can lead to storage fragmentation and be harder to manage.
Checkpointing is not a standalone recovery technique but a crucial optimization that works with Log-Based Recovery. Without it, recovering from a crash would require the DBMS to process the entire log file, which could take a very long time. A checkpoint is like a bookmark in the log.
Periodically, the system performs a checkpoint operation, which does the following:
When recovery is needed, the DBMS finds the last checkpoint. It knows that any transaction that committed before the checkpoint is already permanently saved. Therefore, it only needs to scan the log from the checkpoint onward to figure out which transactions to undo or redo, drastically speeding up the recovey time.
4. Backup and RestoreThis serves as the last safeguard against severe failures, such as a complete disk crash, by keeping backup copies of the database files.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4