Assignment 1 2
Assignment 1 2
Assignments 1& 2
marks)
1. Transaction Logging:
o Log file: Records all changes made to the database during a transaction.
o Types of logs:
▪ Undo log: Records before images of updated data.
▪ Redo log: Records after images of updated data.
2. Checkpointing:
o Periodically records the state of the database and the log file.
o Used to reduce recovery time after a failure.
1. Deferred-Write:
o Changes are first written to a buffer in memory.
o The buffer is written to disk at a later time, possibly when the buffer is full or when the
transaction commits.
o Advantages:
▪ Improves performance by reducing the number of disk I/O operations.
▪ Can reduce the impact of a system crash if the log is written to disk before the
data.
o Disadvantages:
▪ May result in data loss if the system crashes before the buffer is written to disk.
▪ Requires a write-ahead log (WAL) to ensure that the log is written to disk before
the data.
2. Write-Through:
o Changes are written to disk immediately after they are made.
o Advantages:
▪ Ensures that data is always consistent on disk.
▪ Reduces the risk of data loss in case of a system crash.
o Disadvantages:
▪ Can degrade performance by increasing the number of disk I/O operations.
1. Identify the last checkpoint: This determines the starting point for recovery.
2. Scan the log:
o Undo changes: For transactions that did not commit, undo the changes using the before
images recorded in the undo log.
o Redo changes: For transactions that committed but did not complete writing their
changes to disk, redo the changes using the after images recorded in the redo log.
3. Update the database: Apply the undone or redone changes to the database.
- DBMS Standardization
(4marks)
Distributed Database Management Systems (DDBMS) are systems where data is stored and
managed across multiple interconnected computers or nodes in a network. This offers several
advantages, including scalability, reliability, and improved performance.
DBMS Standardization
• Partitioned Database: Data is divided into fragments and stored on different nodes based on
attributes or location.
• Replicated Database: Data is replicated across multiple nodes to improve availability and
performance.
• Hybrid Database: A combination of partitioned and replicated databases.
(3 marks)
Concurrency control algorithms ensure that multiple transactions can execute simultaneously
without interfering with each other.