๐Ÿ›ข๏ธ Database Transactions and Recovery Techniques | Engineer Exam Prep

Engineer ExamDatabaseTransactionACIDRecovery TechniquesCertification
Read in about 1 min read
Published: 2025-07-10
Last modified: 2025-07-10
View count: 32

Summary

A summary of the ACID properties (Atomicity, Consistency, Isolation, Durability) of database transactions and various recovery techniques (Log-based, Checkpoint, Shadow Paging), including a practice problem for the certification exam.

Transaction Properties: ACID

To ensure the integrity and consistency of a database, a transaction must satisfy the following four main properties (ACID).

PropertyDescription
AtomicityAll operations of a transaction must be executed successfully, or none of them should be (All or Nothing).
ConsistencyThe database must always remain in a consistent state after a transaction is executed.
IsolationNo other transaction can interfere while one transaction is being executed.
DurabilityThe results of a successfully completed transaction must be permanently stored in the database.

Database Recovery Techniques

These are techniques for restoring data to a previous consistent state when a database failure occurs.

Core Components of Recovery Techniques

ComponentDescription
REDOIf a transaction has successfully committed but its changes have not been written to disk, REDO applies those changes again.
UNDOIf a transaction fails, UNDO reverts the database to its original state before the changes were made.

Types of Recovery Techniques

TechniqueDescription
Log-based RecoveryChanges to the database are sequentially recorded in a log file. In case of failure, this log is used for recovery.
ย ย  - Deferred UpdateDelays applying changes to the database until the transaction successfully completes. It only requires REDO, not UNDO.
ย ย  - Immediate UpdateChanges made during a transaction are immediately reflected in the database. Both REDO and UNDO may be necessary.
Checkpoint RecoverySaves a consistent state of the database at a specific point in time (a checkpoint). If a failure occurs, recovery starts from the most recent checkpoint, reducing recovery time.
Shadow PagingCreates a copy (shadow page) of the page that needs to be modified. When the transaction completes successfully, the original page is replaced with the shadow page.

โœ๏ธ Practice Problem for Engineer Exam

ProblemDescribe the core component of a database recovery technique that re-executes the changes by referring to the log when a transaction has completed successfully, but its changes have not been reflected on the disk.
Your Answer
Correct AnswerReveal Answer

โžก๏ธ Recommended Next Post