Shadow paging provides which of the following transaction property in...
Shadow paging provides atomicity and durability. A directory with n entries is constructed, where the ith entry points to the ith database page on the link. When a transaction begins executing the current directory is copied into a shadow directory. When a page is to be modified, a shadow page is allocated in which changes are made and when it is ready to become durable, all pages that refer to the original are updated to refer to a new replacement page.
View all questions of this test
Shadow paging provides which of the following transaction property in...
Shadow Paging in DBMS
Shadow paging is a technique used in database management systems (DBMS) to provide certain transaction properties. It is particularly used for maintaining data consistency and atomicity during transaction processing.
Transaction Properties:
- Atomicity: Atomicity ensures that a transaction is treated as a single, indivisible unit of work. It means that either all the operations within a transaction are executed successfully or none of them are executed at all. If a transaction fails or is interrupted, all the changes made by the transaction are rolled back, leaving the database in its original state.
- Consistency: Consistency ensures that a transaction brings the database from one valid state to another. It means that the execution of a transaction should not violate any integrity constraints or rules defined on the database. Consistency ensures that the database remains in a consistent state throughout the transaction process.
- Durability: Durability ensures that once a transaction is committed, its changes are permanent and will survive any subsequent system failures. The changes made by a committed transaction are written to permanent storage, ensuring that they are not lost due to system crashes or power failures.
Shadow Paging and Transaction Properties:
Shadow paging is primarily used to provide atomicity and durability in DBMS. Here's how it achieves these transaction properties:
- Atomicity:
- Shadow paging maintains two copies of the database: the current database and a shadow database.
- During a transaction, all the updates are performed on the shadow database, while the current database remains unchanged.
- If the transaction is successful, the changes in the shadow database are merged with the current database in a single atomic operation called "swapping".
- If the transaction fails or is interrupted, the shadow database is discarded, and the current database remains unchanged.
- This ensures that either all the changes in a transaction are applied to the current database or none of them are applied, providing atomicity.
- Durability:
- Shadow paging maintains a log or a page map that keeps track of the changes made to the shadow database during a transaction.
- After a transaction is committed, the log or page map is updated to reflect the changes made in the shadow database.
- This log or page map is stored in a stable storage, which ensures that it survives system failures.
- In case of a system failure, the log or page map is used to recover the database and bring it back to a consistent state, ensuring durability.
Therefore, shadow paging provides both atomicity and durability in DBMS, making it a suitable technique for maintaining transaction properties.
To make sure you are not studying endlessly, EduRev has designed Railways study material, with Structured Courses, Videos, & Test Series. Plus get personalized analysis, doubt solving and improvement plans to achieve a great score in Railways.