In: Computer Science
6.explain characterizing schedules based on recoverability and serialibality.(50marks)
Need own answer and no internet answers r else i il downvote nd report to chegg.Even a single is wrong i il downvote.its 50marks question so no short answer minimum 10page answer required and own answer r else i il downvote.
Note:Minimum 10page answer and no plagarism r else i il downvote and report to chegg.Minimum 10 to 15page answer required r else dnt attempt.strictly no internet answer n no plagarism.
its 50marks question so i il stricly review nd report
Serializability
Serializability is the preserve database consistency and assuming no transaction fails.
Two types of serializability.
These two are the different forms of Schedule equivalence.
Let us consider a schedule
 in which there are two consecutive
instructions
Ii
and Ij of transactions Ti and Tj
respectively ( i
j ). The Ii and Ij refer to
different data items. Then we can swap Ii and
Ij without affecting the result of any instruction in
the schedule. However if Ii and Ij refer to
the same data item Q then the order of the two steps may
matter since we are dealing with only read and write
instructions.
T1 | T2 |
read (A) write (A) |
|
read (A) write (A) |
|
read (B) write (B) |
|
read (B) write (B) |
We need to consider 4 cases:
1. Ii = read (Q) Ij = read (Q). The order of Ii and Ij does not matter. since the same value of Q is read by Ti and Tj regardless of the order.
2. Ii = read (Q) Ij = write (Q). If Ii comes before Ij then Ti does not read the value of Q. That is written by Tj. Thus the order of Ii and Ij matters.
3. Ii = write (Q) Ij = read (Q). The order of Ii and Ij matters for reasons similar to those of the previous case.
4.Ii = write (Q) Ij = write (Q). Since both instructions are write operations. The order of these instructions does not affect either Ti or Tj
Ii and Ij conflict if they are operations by different transactions on the same data item and at least one of these instructions is a write operations.
The write instruction of T1 conflicts with the read(A) instruction of T2. The write (A) instruction of T2 does not conflict with the read (B) instruction of T1. Because the two instructions access different data items.
The write (A) instruction of T2 does not conflict with the read (B) instruction of T1. We can swap these instructions to generate an equivalent schedule.
T1 | T2 |
read (A) write (A) |
|
read (A) | |
read (B) | |
write (A) | |
write (B) | |
read (B) write (B) |
To swap non conflicting instructiond are:
The final result of these swaps is a serial schedule.
If the schedule S can be transformed into a schedule S by a series of swaps of non-conflicting instructions . That is , S and S' are conflict equivalent.
The concept of conflict equivalence leads to the concept of conflict serializability. we say that schedule S is conflict serializable if it is conflict equivalent to a serial schedule.
T1 | T2 |
read (A) write (A) read (B) write (B) |
|
read (A) write (A) read (B) write (B) |
Consider the significant operations of transaction T3 and T4 . This schedule is not conflict serializable since it is not equivalent to either the serial schedule < T3,T4 > or the serial schedule < T4,T3 >
T3 | T4 |
read(Q) | |
write(Q) | |
write(Q) |
It is possible to have two schedule that produce the same outcome , but they are not conflict equivalent.
Consider two schedules S and S' . Where the same set of transactions participates in both schedules. The schedules S and S' are called view equivalent.
The three conditione are :
The conditions 1 and 2 says that each transaction reads the same values in both schedules and therefore performs the same computation. The condition 3 coupled with condition 1 and 2 says that both schedules results in the same final system state.
The concept of view equivalence leads to the concept of view serializability. We says that a schedule S is view serializable. If it is view equivalent to a serial schedule.
Recoverability
The recoverability is the transaction with in the schedule. If transaction fails atomicity requires effect of transaction to be undone.
If a transaction Ti fails for whatever reason we need to undo the effect of this transaction to ensure the atomicity property of the transaction. In a system that allows concurrent execution it is necessary also to ensure that any transaction Tj. To dependent on Ti is also aborted.
Consider T9 is a transaction that performs only one instruction- read (A). Suppose the system allows T9 to commit immediately after executing the read (A) instruction. Thus T9 commits before T8 does. Now suppose that T8 fails before it commits. Since T9 has read the value of data item A written by T8, we must abort T9 to ensure transaction atomicity. However T9 has already committed and connot be aborted. Thus we have a situation where it is impossible to recover correctly from the failure of T8.
T8 | T9 |
read (A) write (A) |
|
read (A) | |
read (B) |
The recoverable schedule is one where for each pair of transaction Ti and Tj such that Tj reads a data item previously written by Ti . The commit operation of Ti appears before the commit operation of Tj.
A schedule is recoverable, to recover from the failure of a transaction Ti. We may have to roll back several transactions. Such situations occur if transactions have read data written by Ti. The transaction T10 writes a value of A. that is read by transaction T11. Transaction T11 writes a value of A is read by transaction T12. Suppose that at this point T10 fails. T10 must be rolled back. Since T11 is dependent on T10. T11 must be rolled back since T12 is dependent on T11. T12 must be rolled back. This phenomenon is a single transaction failure leads to a series of transaction rollbacks is called cascading rollback.
T10 | T11 | T12 |
read (A) read (B) write (A) |
||
read (A) write (A) |
||
read (A) |
The cascading rollback is undesirable. It leads to the undoing of a significant amount of work. It is desirable to restrict the schedules to those where cascasing rollbacks cannot occur. Such schedules are called cascadeless schedules. A cascadeless schedule is one where 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 . It is easy to verify that every cascadeless schedule is also recoverable.