In: Computer Science
Q)
What is serializability? Explain different types of serializability.
Solutions:-
serializability:-
serializability is a schedule. Its over a set of committed transaction is schedule whose effect on any consistent database instance is guaranteed to be identical to that of some complete serial schedule over S. That is the database instance that results from executing the given schedule is identical to the database instance that results from executing the transaction in some serial order.
Two schedules S and S' are equal if and only if
i) Initial read operation of S and S' should be same for the every data.
ii) And finally updation of data in S and S' should be same.
Types of serializability:-
serializability are two types are following below:-
i) Conflict serializability:-
Schedule S is conflict serialiable only if there exist atleast one serial schedule S' which is conflict equivalent to S. Two schedule S and S' are conflict equal schedule only if S' is resulted after swapping or exchangeing some consicutive non conflict pairs. Two operations in the schedule are said to conflict if they belongs to different transactions,access the same datbase item and atleast one of the operation is write operations.If two schedule have same precedence graph,that does not imply they are conflict equal.
conflict pairs | Non-conflict pairs |
ri(x).............wj(x) wi(x)..........wj(x) wi(x)............rj(x) |
ri(x)........rj(x) ri(x)/wi(x)..........rj(y)/wj(y) |
r=read operation
w=write operation
ii) View serializability:-
A schedule S is said to be view serializable if it is view equivalent to some serial schedule. Two schedules S and S' are said to be view equivalent if the following three condition holds.
a) For each data item Q if transaction Ti executes read(Q) in schedule S, and that value was produced by transaction Tj ,than transaction Ti must in schedule S' also read the value of Q that was produced by transaction Tj.
b)For each data item Q if transaction Ti reads the initials value of Q in schedule S, then transaction Ti must also read the initial value of Q in schedule S'.
c) For each data Q, the transaction that performs the final write(Q) operation in schedule S must perform the final write(Q) operation in schedule S'.