Search code examples
databaserdbmsserializable

What is Conflict serializability?


I am reading in google about the conflict serializability and serializable.

But I am not getting the correct definition and the difference between serializable and conflict serializability.

I am getting only one thing.That is Conflict serializability implies serializable.

In many things they told most over the serializable and conflict serializable are same.

Can anyone please explain what is conflict serializable and difference between serializability and serializable with examples.

Thanks for advance !


Solution

  • I was found a answer for my question.

    Serializable means the transaction is done in serial manner. That means if the scheduling is done, but the transactions are not use the same variable for read and write.

    Example:-

        T1                               T2
    
    Read(X)
                                       Read(y)
    
    Write(X) 
                                      Write(Y)
    

    In this example, the two transactions are does not use the shared variable. So, in here there is no conflict.

    Conflict serializability means the transactions in done in concurrently. The two transactions are used the same variable, the output of the transaction is conflict.

    Example:-

        T1                               T2
    
    Read(X)
                                       Read(X)
                                       Write(X)
    
    Write(X) 
    Read(Y) 
    Write(Y)
                                      Read(Y)
                                      Write(Y)
    

    In this example the two transaction T1, and T2 uses the same variable. So, the transaction T2 writes the X before T1 write. After the T1 writes the X. In here there is no use of transaction T2 writes. This is conflict serializability.