0% found this document useful (0 votes)
1 views10 pages

Module - 4

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views10 pages

Module - 4

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Module-4

Presented by
Basanti Bhattacharyya
Assistant Professor ( IT Department)of
St. Thomas’ College of Engineering & Technology
1
Reliability

❖ In distributed databases, reliability is the system's


capacity to reliably operate correctly and offer precise
data access, even in the event of hardware or software
malfunctions.

❖ A dependable distributed database guarantees data


availability, integrity, and fault tolerance, which enables
it to carry on with operations and preserve data accuracy
in the event of server or network outages.
➢ Because distributed systems cover numerous
locations and entail a complex architecture with multiple
nodes, making them more susceptible to a variety of
failures, reliability is crucial.
2
Reliability(Cont…)

• Reliability A measure of success with which


a system complies with an authorized description of
its behavior.

• Availability The fraction of the time that a


system meets its specification.

• Failure The deviation of a system from the


behavior that is described in its specification.

3
Types of Failures
• Transaction failures Transaction aborts (due to deadlock)

• System (site) failures


Failure of processor, main memory, power supply, …
Main memory contents are lost, but secondary storage contents are
safe
Partial (some sites) vs. total (all sites) failure

• Media failures
Failure of secondary storage devices such that the stored data is lost
Head crash/controller failure (?)
Permanent data loss (secondary, resilient, stable memory – hard disk)

• Communication failures
Lost/undeliverable messages
Network partitioning 4
Types of Recovery Techniques

• The main aim of recovery is to maintain "atomicity" and "durability",


which are two important parts of the ACID properties:
• Atomicity: A transaction should either complete fully or not at all.
• Durability: Once a transaction is committed, its changes must stay in
the database even if a failure occurs afterward.
• Some of the main database recovery techniques are:
• 1. Log-Based Recovery
• One of the most common recovery methods in modern databases.
The keeps a log file (or journal) on stable storage that records every
change—insert, update, or delete—before it is applied to the
database.
• If a failure occurs, the DBMS reads the log to decide what to do:
• Undo: Reverse changes from transactions that didn’t finish (ensuring
atomicity).
• Redo: Reapply changes from committed transactions (ensuring
durability).
5
Types of Recovery Techniques(cont…)

• Log-based recovery is mainly implemented in one of the


following two ways:

➢ Immediate Update (Undo/Redo): The database may be


updated before a transaction commits. On failure, the
system undoes uncommitted changes and redoes
committed ones.

➢ Deferred Update (No-Undo/Redo): Updates are applied


only after commit. On failure, nothing needs to be
undone; only redo is performed for committed
transactions.

6
Types of Recovery Techniques(cont…)

• 2. Shadow Paging
➢ Shadow Paging is an alternative recovery technique that avoids the need for
a log. It works by keeping two versions of the database pages during a
transaction: a current page table and a shadow page table.

➢ The shadow page table points to the original, unmodified database pages
from before the transaction began. It's a "shadow" of the consistent database
state.

➢ When a transaction starts modifying data, new copies of the modified pages
are created. The current page table is updated to point to these new pages
while the shadow page table remains unchanged.

➢ If the transaction commits, the current page table becomes the new shadow.
If it fails, the system discards the modified pages and reverts to the shadow-
no undo/redo needed.

** Shadow paging can lead to storage fragmentation and be harder to manage.


7
Types of Recovery Techniques(cont…)

• 3. Checkpointing: Making Recovery Faster


• Checkpointing is not a standalone recovery technique but
a crucial optimization that works with Log-Based
Recovery. Without it, recovering from a crash would
require the DBMS to process the entire log file, which
could take a very long time. A checkpoint is like a
bookmark in the log.
• Periodically, the system performs a checkpoint operation,
which does the following:
➢ Forces all log records from memory to stable storage.
➢ Forces all modified database pages from memory to
stable storage.
➢ Writes a special checkpoint record into the log file.
8
Types of Recovery Techniques(cont…)
***When recovery is needed, the DBMS finds the last checkpoint. It knows that
any transaction that committed before the checkpoint is already permanently
saved. Therefore, it only needs to scan the log from the checkpoint onward to
figure out which transactions to undo or redo, drastically speeding up the
recovery time.

4. Backup and Restore


• This serves as the last safeguard against severe failures, such as a
complete disk crash, by keeping backup copies of the database files.
• Full Backup: A complete copy of the entire database.
• Differential Backup: A copy of only the data that has changed since
the last full backup.
• Transaction Log Backup: A copy of the transaction log. This is
crucial because it allows the database to be restored to a specific point
in time. For example, you could restore a full backup from Sunday
night and then apply the transaction logs to recover the database right
up to the moment before it failed on Tuesday morning.
9
THANKS

10

You might also like