Hamish Burke | 2025-06-16
Related to: #databases
Immediate Update Algorithm
- Changes written to database during transaction execution (before it commits)
- Means changes immediately visible to other transactions (violates isolation in ACID), unless Concurrency Control Mechanism used
- Needs undo and redo
- Undo
- If Transaction fails before committed
- If a transaction was uncommitted at the time of the crash
- Redo
- If Transaction committed but changes lost (eg system crash)
- If a transaction committed after the checkpoint but before the crash
- Done through logging (think
Pencil->StrokeHistory
)
<T1, start>
<T1, X, 100, 150> // transaction, item, before, after
<T1, Y, 200, 170>
<T1, commit>