Serializability of scheduling

 A serializable schedule always leaves the database in a consistent state. In a serial schedule, a transaction only starts when the other transaction finished execution. However, a non-serial schedule needs to be checked for Serializability.

A non-serial schedule of n number of transactions is said to be a serializable schedule if it is equivalent to the serial schedule of those n transactions. A serial schedule doesn’t allow concurrency, only one transaction executes at a time and the other starts when the already running transaction finished.

Serializability is mainly of two types-

1.Conflict Serializability

2.View Serializability

Conflict Serializability-

If a given non-serial schedule can be converted into a serial schedule by swapping its non-conflicting operations, then it is called as a conflict serializable schedule.

Two operations are called as conflicting operations if all the following conditions hold true for them-

  • Both the operations belong to different transactions
  • Both the operations are on the same data item
  • At least one of the two operations is a write operation

View Serializability-  A Schedule is called view serializable if it is view equal to a serial schedule (no overlapping transactions).

Two schedules S1 and S2 are said to be view equal if the below conditions are satisfied :

1) Initial Read
If a transaction T1 reading data item A from the initial database in S1 then in S2 also T1 should read A from the initial database.

Transaction T2 is reading A from the initial database.

2) Updated Read
If Ti is reading A which is updated by Tj in S1 then in S2 also Ti should read A which is updated by Tj.

3) Final Write operation

If a transaction T1 updated A at last in S1, then in S2 also T1 should perform final write operations. 
The above two schedules are not viewed as the Final write operation in S1 is done by T1 while in S2 done by T2.

Post a Comment

0 Comments