Week 5 Database System
Week 5 Database System
Transaction Processing
WEEK 5
• Consistency means that each transaction must bring the database from
one valid state to another. This means that any changes made to the
database during a transaction must adhere to the rules and constraints
that govern the data in the database.
Atomicity, Consistency, Isolation,
Durability
• Isolation means that transactions are executed in such a way that they
appear to be running alone, even if there are multiple transactions
occurring at the same time.
Suppose two transactions, T1 and T2, both want to update the same row in a
table. If locking is used for concurrency control, one of the transactions (say T1)
will acquire a lock on the row before making the update, and the other transaction
(T2) will have to wait until T1 releases the lock before it can access the row. On
the other hand, if timestamping is used, the database system will assign each
transaction a timestamp, and the transaction with the earlier timestamp (say T1)
will be allowed to update the row first, while the other transaction (T2) will have to
wait until T1 has finished.
Recovery and backup