Recoverability & Database Recovery in DBMS: Logs, Checkpoints & Transaction Failures

DBMS Chapter 21 · Database Recovery Emergency Room
Recoverability & Database Recovery in DBMS: Logs, Checkpoints & Transaction Failures

Recoverability tells us whether transactions can commit safely when one transaction reads data written by another transaction. Database recovery is the process of restoring a correct database state after failures such as transaction errors, system crashes or storage problems. The DBMS uses tools such as logs, Write-Ahead Logging (WAL), checkpoints, UNDO and REDO to recover work. This chapter also explains recoverable, cascadeless and strict schedules, transaction failures, immediate and deferred update, log records and crash-recovery examples in very easy language.

Recoverable schedules Cascadeless & strict Logs + WAL Checkpoints UNDO / REDO Checked: 19 September 2026
Quick answer first

What Is Recoverability in DBMS?

Recoverability & Database Recovery in DBMS: Logs, Checkpoints & Transaction Failures

A schedule is recoverable when a transaction that reads data written by another transaction commits only after the writer transaction commits. This prevents a transaction from permanently committing based on data that may later be rolled back.

Suppose T2 reads X after T1 writes X. If T2 depends on T1's value, T2 should not commit before T1. Otherwise, T2 may commit using data that later disappears if T1 aborts.

W1(X)
R2(X)

Safe commit order:
C1 before C2

Recoverability memory line

Read from T1? Then do not commit before T1 commits.

Before this chapter, revise Transactions & ACID Properties in DBMS and Serializability in DBMS. Serializability and recoverability are different correctness properties, and both matter.

Big picture

What Is Database Recovery?

Database recovery is the process of bringing the database back to a correct state after a failure. Recovery decides which changes must be undone, which committed changes must be redone, and how the DBMS can restart without losing valid work.

TransactionNormal database work starts.
LogImportant changes are recorded.
FailureCrash or transaction error occurs.
UNDO / REDORecovery repairs the state.
RestartDatabase returns to safe operation.
Three schedule safety levels

Recoverable, Cascadeless and Strict Schedules

Recoverable

If Tj reads a value written by Ti, then Tj commits only after Ti commits.

Cascadeless

Tj is allowed to read a value written by Ti only after Ti has committed.

Strict

If Ti writes X, no other transaction may read or write X until Ti commits or aborts.

Strict -> Cascadeless -> Recoverable
Level 01

Recoverable Schedule With Example

Consider:

W1(X)
R2(X)
C1
C2

T2 reads X written by T1. T2 commits only after T1 commits. Therefore the schedule is recoverable.

Now compare:

W1(X)
R2(X)
C2
A1

T2 commits before T1. Later T1 aborts. T2 has already committed using a value that should no longer exist.

T2 committed too early = non-recoverable schedule
Level 02

What Is a Cascadeless Schedule?

A cascadeless schedule does not allow a transaction to read uncommitted data written by another transaction.

Safe example:

W1(X)
C1
R2(X)
C2

T2 reads X only after T1 commits, so if T1 fails before commit, T2 never sees that temporary value.

This avoids cascading rollback, where one aborted transaction forces several dependent transactions to roll back.

Cascading rollback

What Is Cascading Rollback?

Suppose T1 writes X, T2 reads that uncommitted X, and T3 then reads a value produced by T2. If T1 later aborts, T2 may need to abort because its work depended on T1. Then T3 may also need to abort.

T1 writes X
T2 reads X from T1
T3 reads data from T2
T1 aborts

Result:
T2 may abort
T3 may abort

Why cascadeless schedules help

Do not read uncommitted data -> avoid cascading rollback
Level 03

What Is a Strict Schedule?

A strict schedule does not allow another transaction to read or write a data item written by an uncommitted transaction.

If T1 writes X:

W1(X)

then T2 must wait before doing either:

R2(X)
or
W2(X)

until T1 commits or aborts.

Strict schedules make recovery simpler because uncommitted values cannot be read or overwritten by other transactions.

Fast comparison

Recoverable vs Cascadeless vs Strict Schedule

PropertyRecoverableCascadelessStrict
Can read uncommitted data?Yes, but commit must waitNoNo
Can overwrite uncommitted write?PossiblyPossiblyNo
Avoids cascading rollback?Not alwaysYesYes
Recovery simplicityLowerBetterBest among these three
StrengthBasicStrongerStrongest
Types of failures

Transaction and Database Failures

Logical transaction errorInvalid input, arithmetic problem, insufficient balance or application rule failure.
Constraint violationPRIMARY KEY, FOREIGN KEY, CHECK or another database rule rejects an operation.
Deadlock victimThe DBMS aborts one transaction to break a deadlock.
System crashPower loss, OS crash or DBMS process crash stops execution.
Media failureDisk or storage damage affects database pages or files.
Communication failureDistributed transactions may fail because of network or node problems.
The DBMS black box recorder

What Is a Log in DBMS?

A log is a sequential record of important transaction events and database changes used during recovery.

Possible log records

<T1 START> <T1, X, old=5000, new=4500> <T1, Y, old=3000, new=3500> <T1 COMMIT>

Why the log matters

If the system crashes, the recovery manager can inspect the log to identify transactions that committed and transactions that were incomplete.

The old value can help with UNDO. The new value can help with REDO, depending on the recovery method.

Important recovery rule

What Is Write-Ahead Logging (WAL)?

Write-Ahead Logging means the required log record must reach stable storage before the corresponding changed database page is written to persistent database storage.

For a transaction commit, the DBMS also needs the required commit-related log information safely recorded before reporting the commit as durable.

WAL memory line

Log first, data page later

WAL is one of the core ideas that allows the DBMS to recover correctly after a crash.

UNDO and REDO

What Is UNDO and REDO in Database Recovery?

UNDO

Remove the effects of transactions that did not successfully commit.

Think: restore an old value.

REDO

Reapply changes of committed transactions whose updates may not yet be reflected in database pages after a crash.

Think: restore the committed new value.

UNDO = cancel incomplete work · REDO = restore committed work
Interactive crash lab

Crash Recovery Simulator

Assume T1 updates X and T2 updates Y. Click a crash case to see the recovery action.

Case 1: T1 changed X but did not commit

<T1 START> <T1, X, old=100, new=150> SYSTEM CRASH No T1 COMMIT record

Recovery action

UNDO T1 T1 was incomplete, so recovery removes its uncommitted effect and restores the old value where required.
UNDO
Recovery optimization

What Is a Checkpoint in DBMS?

A checkpoint is a recovery marker that lets the DBMS avoid scanning the entire log from the beginning after every crash.

Old logEarlier transaction history.
CheckpointKnown recovery position.
Recent logTransactions after checkpoint.
CrashRecovery focuses on relevant recent work.

The exact checkpoint procedure varies by recovery system. Some checkpoints may record active transactions and coordinate dirty pages or log positions rather than forcing every changed page immediately.

Checkpoint = recovery shortcut, not a transaction COMMIT
Deferred update

Deferred Update Recovery

In a deferred-update approach, database pages are not updated with a transaction's changes until the transaction reaches the required commit stage.

Because uncommitted changes are not written to the database, crash recovery mainly needs to REDO committed changes that were recorded but not yet reflected in the database.

Typical idea:
Record changes in log
Commit transaction
Apply committed changes to database

Recovery:
REDO committed transactions if needed

Textbooks often summarize this style as NO-UNDO / REDO, though actual systems can use more sophisticated designs.

Immediate update

Immediate Update Recovery

In an immediate-update approach, a transaction's changed database page may reach storage before the transaction commits.

Therefore recovery may need:

UNDORemove uncommitted changes that reached the database.
REDORestore committed changes that were not fully reflected after a crash.

WAL is crucial here because the log information needed for recovery must be safe before the changed database page is written.

Immediate update commonly needs UNDO + REDO
Recovery policy terms

Steal and No-Steal, Force and No-Force

These terms explain whether uncommitted pages may be written and whether committed pages must be forced to disk at commit time.

PolicyMeaningRecovery effect
StealA page containing uncommitted changes may be written to disk.UNDO may be needed.
No-StealUncommitted changed pages are not written to disk.Reduces need for UNDO of disk-resident data.
ForceAll changed pages of a committed transaction are forced to disk at commit.Reduces need for REDO.
No-ForceSome committed changed pages may remain only in memory after commit.REDO may be needed after crash.

Many high-performance recovery systems use combinations such as steal/no-force, which makes both UNDO and REDO important.

Commit and crash timeline

What Happens If the System Crashes?

DBMS restartsThe recovery manager inspects logs and recovery metadata.
Find relevant transactionsDetermine which transactions committed and which were incomplete.
Start from a useful checkpointA checkpoint reduces unnecessary log scanning.
REDO where requiredReapply committed changes that may be missing from database pages.
UNDO where requiredRemove effects of incomplete transactions that reached storage.
Return to serviceThe database is brought back to a consistent recoverable state.
Recovery and durability

How Recovery Supports ACID Properties

AtomicityUNDO helps prevent partial failed transactions from remaining.
DurabilityREDO and logging help committed work survive crashes.
ConsistencyCorrect recovery returns the database to valid transaction outcomes.
IsolationStrict scheduling and concurrency control reduce unsafe dependencies.

For the complete ACID foundation, revise Transactions & ACID Properties in DBMS.

Serializability vs recoverability

Serializability and Recoverability Are Not the Same

Serializability

Asks whether the interleaved operations are equivalent to some serial execution.

Recoverability

Asks whether commit order is safe when transactions depend on values written by other transactions.

A schedule can satisfy one property and still fail another. Good transaction processing needs both concurrency correctness and safe recovery behavior.

Revise Conflict & View Serializability for precedence-graph and schedule-equivalence problems.

A small log problem

Solved Recovery Example From a Log

Suppose the log before a crash is:

<T1 START>
<T1, X, old=100, new=120>
<T1 COMMIT>

<T2 START>
<T2, Y, old=50, new=80>

SYSTEM CRASH

T1

T1 has a COMMIT record. If its changed page is not safely reflected in the database, recovery may need to REDO T1.

T2

T2 has no COMMIT record. If T2's changed page reached the database before the crash, recovery may need to UNDO T2 and restore Y to 50.

Committed but missing? REDO · Uncommitted but written? UNDO
Advanced but useful

What Is ARIES Recovery?

ARIES is a well-known recovery method used as a reference model in database systems. Its name expands to Algorithms for Recovery and Isolation Exploiting Semantics.

At a high level, ARIES-style recovery is commonly described using three phases:

AnalysisFigure out transaction and page state at the time of crash.
RedoRepeat history as needed so logged changes are reflected correctly.
UndoRoll back incomplete transactions in a controlled way.

This is an advanced topic. For semester-level basics, understanding logs, WAL, checkpoints, UNDO and REDO is usually the important foundation.

Alternative technique

What Is Shadow Paging?

Shadow paging is a recovery technique that keeps an old stable page table while updates are directed to new pages. If the transaction commits, the system can switch to the new page table. If it fails, the old stable version can still be used.

Log-based recovery

Uses transaction logs, WAL, checkpoints and UNDO/REDO logic.

Shadow paging

Uses old and new page mappings rather than normal UNDO/REDO logging for the same role.

Shadow paging is useful conceptually, but modern general-purpose database systems often rely heavily on log-based recovery techniques.

Common mistakes

Recoverability and Recovery Mistakes to Avoid

Confusing recoverability with serializabilityRecoverability focuses on safe commit dependencies; serializability focuses on schedule equivalence.
Thinking recoverable means no dirty readsA recoverable schedule may still allow dirty reads if dependent commit order is safe.
Confusing cascadeless and strictCascadeless blocks dirty reads; strict also blocks overwriting uncommitted writes.
Thinking checkpoint equals commitA checkpoint is a recovery marker, not a transaction commit.
Thinking logs store only new valuesDepending on the method, logs may store transaction events, old values, new values and other recovery metadata.
Using REDO for every transactionRecovery action depends on whether the transaction committed and whether its changes reached the database.
Using UNDO for every crashDeferred-update methods may not need UNDO of database pages.
Ignoring WALThe recovery log must be protected before affected database pages are written.
Write according to marks

How to Write Recoverability and Recovery in Semester Exams

2 marks

Definition

Define recoverable schedule or database recovery and write one short example.

5 marks

Compare schedules

Explain recoverable, cascadeless and strict schedules, or explain log, WAL, checkpoint, UNDO and REDO.

8-10 marks

Full recovery answer

Cover failures, schedule safety, logging, WAL, checkpoints, immediate/deferred update and a crash-recovery example.

For presentation, revise How to Write High-Scoring Answers in University Semester Exams. For revision priority, use the previous-year-paper method.

Practice with answers

Practice Questions With Answers

1. What is a recoverable schedule?

A schedule is recoverable when a transaction that reads data from another transaction commits only after the writer transaction commits.

2. What is a cascadeless schedule?

A cascadeless schedule allows a transaction to read data written by another transaction only after the writer has committed.

3. What is a strict schedule?

A strict schedule prevents other transactions from reading or writing a data item written by an uncommitted transaction.

4. What is cascading rollback?

Cascading rollback happens when one aborted transaction forces other dependent transactions to abort because they used its uncommitted data.

5. What is a database log?

A database log records important transaction events and changes so the DBMS can recover after failures.

6. What is Write-Ahead Logging?

WAL requires the needed log record to reach stable storage before the related changed database page is written to persistent storage.

7. What is the difference between UNDO and REDO?

UNDO removes incomplete uncommitted effects, while REDO reapplies committed effects that may be missing after a crash.

8. What is a checkpoint?

A checkpoint is a recovery marker that helps the DBMS reduce the amount of log history it must examine after a crash.

9. What is the difference between immediate and deferred update?

Deferred update delays database writes until commit and mainly needs REDO, while immediate update may write before commit and can require both UNDO and REDO.

10. What should I study after database recovery?

Study locking protocols, Two-Phase Locking, deadlocks, timestamp ordering, MVCC and advanced concurrency control.

60-second revision

Recoverability and Recovery One-Minute Revision Sheet

RecoverableReader commits after writer commits.
CascadelessRead only committed values.
StrictNo read or write of an uncommitted written item.
Cascading rollbackOne abort forces dependent transactions to abort.
LogRecovery record of transaction events and changes.
WALWrite log before changed page.
UNDORemove incomplete uncommitted effects.
REDORestore committed effects.
CheckpointRecovery shortcut marker.
Deferred updateCommonly NO-UNDO / REDO.
Immediate updateCan require UNDO + REDO.
Strictness chainStrict implies cascadeless implies recoverable.

Ultimate memory line

Safe commits = recoverability · Safe crash restart = recovery
Frequently asked questions

Frequently Asked Questions

What is recoverability in DBMS in simple words?

Recoverability means a transaction should not commit permanently before the transaction whose data it used has safely committed.

What is database recovery in DBMS?

Database recovery is the process of restoring a correct database state after transaction failures, system crashes or storage problems.

What is the difference between recoverable, cascadeless and strict schedules?

Recoverable controls commit order, cascadeless prevents reading uncommitted data, and strict also prevents reading or overwriting data written by an uncommitted transaction.

What is a log in database recovery?

A log is a sequential record of transaction events and data changes used by the DBMS during crash recovery.

What is a checkpoint in DBMS recovery?

A checkpoint is a recovery marker that reduces how much of the log the DBMS needs to process after a crash.

What is the difference between UNDO and REDO?

UNDO removes uncommitted changes, while REDO reapplies committed changes that need to be restored after a failure.

Next chapter

What Should You Learn Next?

Tags

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.
Join Telegram Exam updates and free resources