









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Students of Communication, study E-Commerce as an auxiliary subject. these are the key points discussed in these Lecture Slides of E-Commerce : Atomicity, Durability, Shadow Paging, Transaction Processing, Atomicity, Resource Manager, Section Provides, Database Recovery, Survive Failures, Hardware Operation
Typology: Slides
1 / 16
This page cannot be seen from the preview
Don't miss anything!










Introduction
Shadowing in a Nutshell
The database is a tree whose
root
is a single disk block
There are two copies of the tree, the
master
and
shadow
The root points to the master copy
Updates are applied to the shadow copy
To install the updates, overwrite the root so it points tothe shadow, thereby swapping the master and shadow
Before writing the root, none of the transaction’s updates arepart of the disk-resident database
After writing the root, all of the transaction’s updates are partof the disk-resident database
Which means the transaction is atomic and durable
More Specifically …
To Write a Page P
i^
i
After Writing Page P2b
Pt
T
[a]^123 ... Pt
T
[b]^123 ...
a b
P1a
Pt
1
[a] 1 2 3 ... Pt
1
[b] 1 2 3 ...
P2a P1b P2bOld
Initial State
D I S K
Main
Memory
For T
Master
P2bNew
What if the System Fails?
To Commit
Pt
T
[a]^123 ... Pt
T
[b]^123 ...
a b
P1aOld
Pt
1
[a] 1 2 3 ... Pt
1
[b] 1 2 3 ...
P2a P1b P2bOld
Initial State
D I S K
Master
P2bNew P1aNew
T
[a] and Pt
T
[b] to disk
Shadow Paging with Shared Files
What if two transactions update different pages of a file?
If they share their main-memory shadow copy of the pagetable,then committing one will commit the other’s updates too!
One solution: File-grained locking (but poor concurrency)
Better solution: use a private shadow-copy of each pagetable, per transaction. To commit T, do the following within a critical section
For each file F modified by T
get a private copy C of the last committed value of F’s pagetable
update C’s entries for pages modified by T
store C on disk
Write a new master record, which swaps page tables for thefiles updated by T, thereby installing just T’s updates
Managing Available Disk Space
Your Project
You need not use the exact data structure presentedhere.
In particular, you don’t necessarily need a pageabstraction.
There are design tradeoffs for you to figure out.