Pages

Sunday 1 April 2012

Serializability in DBMS

Let’s get started!


Definition : It is sequences of actions (read,write, commit,abort) from set of transactions (which obey the sequence of operations with in the transactions ).



Serial schedules : The schedules which gets execute one after other is serial schedules.


Interleaved schedules : The schedules which allows the parts of multiple transactions to get execute.







Basic Assumption :  Each  transactions preserve database consistency. Thus serial execution of set of transactions preserves database consistency.

Difference forms of scheduling gives rise to the notations of :
1.Conflict Serializability
2.View Serializability

1. Conflict Serializability

                                 There are 4 cases to consider 

>>>1<<<<

                  I(1) = read(Q)
                  I(2) = read(Q)
                                        The order of I(1) & I(2) doesn't matter , since the same value of Q is read by T(1) & T(2).

>>>2<<<<  

                  I(1) = read(Q)
                  I(2) = write(Q)    
                                        If the I(1) comes before I(2),then T(1) doesnt read the value of Q that is  written by T(2) in Instruction I(2).
                                        If the I(2) comes before I(1) then T(1) reads the value of the Q i.e. written by T(2).Thus the order of I(1) & I(2) matters.
       
>>>3<<<<
                  I(1) = write(Q)
                  I(2) = read(Q)

                                        The order of I(1) & I(2) matters (reason is same as previous one.)
                                  >>>4<<<                                        
                  

                  I(1) = write(Q)
                  I(2) = write(Q)
                                       Since both instructions are write operations, the order of their instructions doesnt affect either T(1) or T(2) .


Thus  I(1) = read(Q),I(2) = read(Q).I(1) & I(2)  don't conflict.
        I(1) = read(Q),I(2) = write(Q).I(1) & I(2)  are conflict.
        I(1) = write(Q),I(2) = read(Q).I(1) & I(2) are conflict.
        I(1) = write(Q),I(2) = write(Q).I(1) & I(2) are conflict.


NOTE:
         1.different transactions in same data items.
         2.at least one of these instructions is write operation.

6 comments: