In: Computer Science
IT-344: Database Management Systems
please No handwriting
thank you
Topic of Discussion
According to the conflicts and failure in transactions processing,
the need of concurrency control and recovery appeared.
Discuss the differences between concurrency control and recovery in
terms of:
The purposes.
The algorithms.
The problems.
Concurrency control
——————————
They are multiple transactions that are allowed to run currently
in the system
Advantages of concurrent executions
1.Increased processor and disk utilization, leading to better
transaction throughput: one transaction can be using the CPU while
another is reading from or writing to the disk.
2.Reduced average response time for transactions: short
transactions need not wait behind long ones.
Concurrency control schemes:
—————————————-
They are mechanisms to control the interaction among the concurrent
transactions in order to prevent them from destroying the
consistency of the database.
Schedules:
Schedules are sequences that indicate the chronological order in
which instructions of concurrent transactions are executed.
1.A schedule for a set of transactions must consist of all
instructions of those Transactions
2.Must preserve the order in which the instructions appear in each
individual transaction.
Example Schedules
Let T1 transfer $50 from A to B, and T2 transfer 10% of the Balance
from A to B. The following is a Serial Schedule in which T1 is
followed by T2.
Let T1 and T2 be the transactions defined previously. The
schedule 2 is not a serial schedule,but it is equivalent to
Schedule 1.
In both Schedules 1 and 3, the sum A+ B is preserved.
Recoverability
Recoverable schedule — if a transaction Tj reads a data items
previously written by a transaction Ti, the commit operation of Ti
appears before the commit operation
of Tj.
The following schedule (Schedule 11) is not recoverable
1.If T9 commits immediately after the read
2.If T8 should abort, T9 would have read (and possibly shown to the
user) an inconsistent
database state. Hence database must ensure that schedules are
recoverable.
Cascading rollback:
Definition: If a single transaction failure leads to a series of
transaction rollbacks, It is called as cascaded rollback.
Consider the following schedule where none of the transactions has
yet committed
1. If T10 fails, T11 and T12 must also be rolled back.
2. Can lead to the undoing of a significant amount of work
Cascade less schedules:
The cascading rollbacks cannot occur; for each pair of transactions
Ti and Tj such that Tj reads a data item previously written by Ti,
the commit operation of Ti appears before the read operation of
Tj.
1. Every cascade less schedule is also recoverable
2. It is desirable to restrict the schedules to those that are
cascade