Compare the Difference Between Similar Terms

Difference Between

Home / Technology / IT / Database / Difference Between Deferred Update and Immediate Update

Difference Between Deferred Update and Immediate Update

May 14, 2011 Posted by Indika

Deferred Update vs Immediate Update

Deferred Update and Immediate Update are two techniques used to maintain transaction log files of Database Management Systems (DBMS). Transaction log (also referred to as the journal log or the redo log) is a physical file that stores the Transaction ID, the time stamp of the transaction, the old value and the new values of the data. This allows the DBMS to keep track of the data before and after each transaction. When the transactions are committed and the database is returned to a consistent state, the log might be truncated to remove the committed transactions.

Deferred Update

Deferred update also called NO-UNDO/REDO is a technique used to recover/support transaction failures that occur due to operating system, power, memory or machine failures. When a transaction runs, any updates or alterations made to the database by the transaction are not done immediately. They are recorded in the log file. Data changes recorded in the log file are applied to the database on commit. This process is called “Re-doing”. On rollback, any changes to data recorded in the log file are discarded; hence no changes will be applied to the database. If a transaction fails and it is not committed due to any of the reasons mentioned above, the records in the log file are discarded and the transaction is restarted. If the changes in a transaction are committed before crashing, then after the system restarts, changes recorded in the log file are applied to the database.

Immediate Update

Immediate update also called UNDO/REDO, is also another technique used to recover/support transaction failures that occur due to operating system, power, memory or machine failures. When a transaction runs, any of the updates or alterations made by the transaction are written directly in to the database. Both the original values and the new values are also recorded in the log file before changes are made to the database. On commit all changes made to the database are made permanent and the records in the log file are discarded. On rollback old values are restored in to the database using the old values stored in the log file. All the changes made by transactions to the database are discarded and this process is called “Un-doing”. When the system restarts after a crash, all the database changes are made permanent for committed transactions. For uncommitted transactions, original values are restored using the values in the log file.

What is the difference between Deferred Update and Immediate Update

Even though Deferred Update and Immediate Update are two methods for recovering after a system failure, the process that each method uses is different. In differed update method, any changes made to the data by a transaction are first recorded in a log file and applied to the database on commit. In immediate update method, changes made by a transaction are directly applied to the database and old values and new values are recorded in the log file. These records are used to restore old values on rollback. In differed update method, records in the log file are discarded on roll back and are never applied to the database. One disadvantage of deferred update method is the increased time taken to recover in case of a system failure. On the other hand, frequent I/O operations while the transaction is active, is a disadvantage in immediate update method.

Related posts:

Difference Between MySQL and PostgreSQL Difference Between SQL Server 2008 and Express Difference Between RDBMS and ORDBMS Difference Between DBMS and Data Warehouse Difference Between Explicit Cursor and Implicit Cursor

Filed Under: Database Tagged With: committed transactions, Deferred Update, Immediate Update, journal log, log file, NO-UNDO/REDO, Re-doing, recover transaction failures, redo log, transaction log, transaction log files, uncommitted transactions, UNDO/REDO

About the Author: Indika

Indika, BSc.Eng, MSECE Computer Engineering, PhD. Computer Science, is an Assistant Professor and has research interests in the areas of Bioinformatics, Computational Biology, and Biomedical Natural Language Processing.

Comments

  1. Jeleigh15 says

    August 22, 2011 at 9:30 am

    very informative article :))

    Reply
  2. Sahil Sharma says

    April 28, 2015 at 4:43 pm

    Concise and GREAT

    Reply
    • Jessica says

      January 9, 2018 at 5:00 pm

      Please what is the Disadvantage and advantage of deferred update

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Request Article

Featured Posts

Difference Between Coronavirus and Cold Symptoms

Difference Between Coronavirus and Cold Symptoms

Difference Between Coronavirus and SARS

Difference Between Coronavirus and SARS

Difference Between Coronavirus and Influenza

Difference Between Coronavirus and Influenza

Difference Between Coronavirus and Covid 19

Difference Between Coronavirus and Covid 19

You May Like

What is the Difference Between Alpha and Beta Oxidation

What is the Difference Between Alpha and Beta Oxidation

Difference Between Horn and Antler

Difference Between Spontaneous and Stimulated Emission

Difference Between Cuprous and Cupric

Difference Between Cuprous and Cupric

What is the Difference Between Bubble Point and Diffusion Test

What is the Difference Between Bubble Point and Diffusion Test

Latest Posts

  • What is the Difference Between Sharara and Lehenga
  • What is the Difference Between Leucoderma and Albinism
  • What is the Difference Between Cytosolic and Chloroplastic Glycolysis
  • What is the Difference Between Hammer Toe and Mallet Toe
  • What is the Difference Between Osteoporosis and Scoliosis
  • What is the Difference Between Saree and Half Saree
  • Home
  • Vacancies
  • About
  • Request Article
  • Contact Us

Copyright © 2010-2018 Difference Between. All rights reserved. Terms of Use and Privacy Policy: Legal.