Skip to content
Related Articles

Related Articles

Improve Article

Difference between Deferred update and Immediate update

  • Last Updated : 07 Apr, 2021

1. Deferred Update : 
It is a technique for the maintenance of the transaction log files of the DBMS. It is also called NO-UNDO/REDO technique. It is used for the recovery of the transaction failures which occur due to power, memory or OS failures. Whenever any transaction is executed, the updates are not made immediately to the database. They are first recorded on the log file and then those changes are applied once commit is done. This is called “Re-doing” process. Once the rollback is done none of the changes are applied to the database and the changes in the log file are also discarded. If commit is done before crashing of the system, then after restarting of the system the changes that have been recorded in the log file are thus applied to the database. 

2. Immediate Update : 
It is a technique for the maintenance of the transaction log files of the DBMS.It is also called UNDO/REDO technique. It is used for the recovery of the transaction failures which occur due to power, memory or OS failures. Whenever any transaction is executed, the updates are made directly to the database and the log file is also maintained which contains both old and new values. Once commit is done, all the changes get stored permanently into the database and records in log file are thus discarded.Once rollback is done the old values get restored in the database and all the changes made to the database are also discarded. This is called “Un-doing” process. If commit is done before crashing of the system, then after restarting of the system the changes are stored permanently in the database. 

Difference between Deferred update and Immediate update: 
 

S.NO.Deferred UpdateImmediate Update
1.In deferred update, the changes are not applied immediately to the database.In immediate update, the changes are applied directly to the database.
2.The log file contains all the changes that are to be applied to the database.The log file contains both old as well as new values.
3.In this method once rollback is done all the records of log file are discarded and no changes are applied to the database.In this method once rollback is done the old values are restored into the database using the records of the log file.
4.Concepts of buffering and caching are used in deferred update method.Concept of shadow paging is used in immediate update method.
5.The major disadvantage of this method is that it requires a lot of time for recovery in case of system failure.The major disadvantage of this method is that there are frequent I/O operations while the transaction is active.

Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.

 

My Personal Notes arrow_drop_up
Recommended Articles
Page :