week 10
Teaching and Learning Methods to be Employed
1. Illustrated lecture on transactions, ACID properties, and isolation levels
2. Concurrency problem demonstration with parallel transaction scenarios
3. Recovery mechanisms and log-based recovery exercise
4. Final course review and exam preparation session
Learning Outcomes / Objectives
By the end of this week, students should be able to:
1. Define a transaction and explain the ACID properties.
2. Describe the concurrency problems that arise when transactions execute simultaneously.
3. Explain lock-based and timestamp-based concurrency control protocols.
4. Describe transaction isolation levels and their trade-offs.
5. Explain the concept of database failure and recovery.
6. Describe log-based recovery and the ARIES algorithm concepts.
10.2 ACID Properties
The four ACID properties guarantee reliable transaction processing in a DBMS:
|
ACID Property |
Definition and Banking Example |
|
ATOMICITY |
A transaction is treated as a single indivisible unit — it either completes fully (COMMIT) or has no effect (ROLLBACK). In the bank transfer: if the credit to Ngozi fails, the debit from Amina is automatically rolled back. |
|
CONSISTENCY |
A transaction brings the database from one valid state to another valid state. All integrity constraints must be satisfied before and after. E.g., bank balances must never go negative (if that's a constraint), and total money in the system is conserved. |
|
ISOLATION |
Concurrent transactions execute as if they were serial (one at a time). One transaction's intermediate results are not visible to others. E.g., while the transfer is in progress, neither Amina nor Ngozi's balances should show half-updated values. |
|
DURABILITY |
Once a transaction is committed, its changes are permanent — even if the system crashes immediately after. The ₦10,000 transfer is permanent once COMMIT executes. A power cut cannot undo it. |