Why do We Need Checkpoints?

Whenever transaction logs are created in a real-time environment, it eats up lots of storage space. Also keeping track of every update and its maintenance may increase the physical space of the system. Eventually, the transaction log file may not be handled as the size keeps growing. This can be addressed with checkpoints. The methodology utilized for removing all previous transaction logs and storing them in permanent storage is called a Checkpoint. 

Checkpoints in DBMS

Pre-Requisite: Transaction Management 

The Checkpoint is used to declare a point before which the DBMS was in a consistent state, and all transactions were committed. During transaction execution, such checkpoints are traced. After execution, transaction log files will be created. Upon reaching the savepoint/checkpoint, the log file is destroyed by saving its update to the database. Then a new log is created with upcoming execution operations of the transaction and it will be updated until the next checkpoint and the process continues.

Similar Reads

Why do We Need Checkpoints?

Whenever transaction logs are created in a real-time environment, it eats up lots of storage space. Also keeping track of every update and its maintenance may increase the physical space of the system. Eventually, the transaction log file may not be handled as the size keeps growing. This can be addressed with checkpoints. The methodology utilized for removing all previous transaction logs and storing them in permanent storage is called a Checkpoint....

Steps to Use Checkpoints in the Database

Write the begin_checkpoint record into a log. Collect checkpoint data in stable storage. Write the end_checkpoint record into a log....

Types of Checkpoints

There are basically two main types of Checkpoints:...

Relevance of Checkpoints

A checkpoint is a feature that adds a value of C in ACID-compliant to RDBMS. A checkpoint is used for recovery if there is an unexpected shutdown in the database. Checkpoints work on some intervals and write all dirty pages (modified pages) from logs relay to data file from i.e from a buffer to a physical disk. It is also known as the hardening of dirty pages. It is a dedicated process and runs automatically by SQL Server at specific intervals. The synchronization point between the database and transaction log is served with a checkpoint....

Advantages of Checkpoints

Checkpoints help us in recovering the transaction of the database in case of a random shutdown of the database. It enhancing the consistency of the database in case when multiple transactions are executing in the database simultaneously. It  increasing the data recovery process. Checkpoints work as a synchronization point between the database and the transaction log file in the database. Checkpoint records in the log file are used to prevent unnecessary redo operations. Since dirty pages are flushed out continuously in the background, it has a very low overhead and can be done frequently. Checkpoints provide the baseline information needed for the restoration of the lost state in the event of a system failure. A database checkpoint keeps track of change information and enables incremental database backup.  A database storage checkpoint can be mounted, allowing regular file system operations to be performed. Database checkpoints can be used for application solutions which include backup, recovery or database modifications....

Disadvantages of Checkpoints

1. Database storage checkpoints can only be used to restore from logical errors (E.g. a human error)....

Real-Time Applications of Checkpoints

Backup and Recovery Performance Optimization Auditing...

Conclusion

Checkpoints are one of the essential elements of a Database Management System. The major contribution of Checkpoints in DBMS is, it helps in faster recovery of the system in case of system failure or crash of the system. Checkpoints mark the position till the consistency of the transaction is maintained. It is a useful component in the recovery of the database....