Forward Recovery and Backward Recovery

Transaction modifies data that are stored in a Database. Transaction must always pass ACID Test. Transaction has to make sure the data in database remains consistence after it modifies the database. For example: Online payment when made has to have effects on both parties. The amount must be withdrawn from one account and must be deposited to another account. Or neither must happen. Only one of them must not happen in any circumstances. In such a case Database has to rollback the transaction.

When recovering the database, it is must redo the effects of the previous transactions. This is called Rolling Forward or simple Forward Recovery.

Let’s see the process of Rolling Forward or Forward Recovery:

Disk drive that was holding the data was crashed and you had backup copy that was 2 days older. Now you have to recover the lost data. You can use your log file to roll forward all the transaction that was completed but lost due to disk crash. This recovery process is called Rolling Forward or simple Forward Recovery.

Not all but some active transaction that didn’t complete successfully needs to rollback, when the disk drive crashed. Such kind of rollback is called Backward Recovery.

Leave a Reply