Durability
Durability
Dealing with Transactions
The remaining failure modes that we consider:
- Failure of DBMS processes or OS.
- Failure of transactions (
ABORT).
Standard technique for managing these:
- Keep a log of changes made to database.
- Use this log to restore state in case of failures.
DBMS Architecture for Atomicity/Durability

Execution of Transactions
Transactions deal with 3 address/memory spaces:
- Data on disk (persistent DB state).
- Data in memory buffers (held for sharing by tx’s).
- Data in own local variables (where manipulated).
Each of these may hold a different version of a DB object.
Transaction Operations
Operations available for data transfer:
INPUT(X): read page containingXinto a buffer.READ(X, v): copy value ofXfrom buffer to local variablev.- May cause
INPUTif value not in buffer.
- May cause
WRITE(X, v): copy value of local variablevtoXin buffer.- May cause
OUTPUTdepending on implementation details.
- May cause
OUTPUT(X): write buffer containingXto disk.
READ/WRITE are issued by transaction. INPUT/OUTPUT are issued by buffer manager (and log manager).
Transactions and Buffer Pool
Two issues w.r.t. buffers:
- Forcing:
OUTPUTbuffer on eachWRITE.- Ensures durability: disk always consistent with buffer pool.
- Poor performance: defeats purpose of having buffer pool.
- Stealing: replace buffers of uncommitted tx’s:
- Poor throughput if we don’t (tx’s blocked on buffers).
- Potential atomicity issues as uncommitted changes are written to disk.
Stealing vs No Forcing
Handling stealing:
- Transaction
Tloads pagePand makes changes. T_2needs a buffer, andPis the victim.Pis output to disk (it’s dirty) and replaced.- If
Taborts, some of its changed are already “committed”. - Must log values changed by
TinPat steal time. - Use these to undo changes in case of failure of
T.
Handling no forcing:
- Transaction
Tmakes changes and commits, then system crashes. - But what if modified page
Pnot yet output. - Must log values changed by
TinPas soon as they change. - Use these to support redo to restore changes.
