×

Conflict Serializability in DBMS

Conflict Serializability

A schedule is said to be conflict serializable if it can transform into a serial schedule after swapping of non-conflicting operations. It is a type of serializability that can be used to check whether the non-serial schedule is conflict serializable or not.

Conflicting operations

The two operations are called conflicting operations, if all the following three conditions are satisfied:

  • Both the operation belongs to separate transactions.
  • Both works on the same data item.
  • At least one of them contains one write operation.

Note: Conflict pairs for the same data item are:
Read-Write
Write-Write
Write-Read

Conflict Equivalent Schedule

Two schedules are called as a conflict equivalent schedule if one schedule can be transformed into another schedule by swapping non-conflicting operations.

Example of conflict serializability:

Schedule S2 (Non-Serial Schedule):

Time Transaction T1 Transaction T2 Transaction T3
t1 Read(X)    
t2     Read(Y)
t3     Read(X)
t4   Read(Y)  
t5   Read(Z)  
t6     Write(Y)
t7   Write(Z)  
t8 Read(Z)    
t9 Write(X)    
t10 Write(Z)    

Precedence graph for schedule S2:

In the above schedule, there are three transactions: T1, T2, and T3. So, the precedence graph contains three vertices.

Precedence graph for schedule S2:

To draw the edges between these nodes or vertices, follow the below steps:

Step1: At time t1, there is no conflicting operation for read(X) of Transaction T1.
Step2: At time t2, there is no conflicting operation for read(Y) of Transaction T3.
Step3: At time t3, there exists a conflicting operation Write(X) in transaction T1 for read(X) of Transaction T3. So, draw an edge from T3?T1.

edges between these nodes or vertices

Step4: At time t4, there exists a conflicting operation Write(Y) in transaction T3 for read(Y) of Transaction T2. So, draw an edge from T2?T3.

Step5: At time t5, there exists a conflicting operation Write (Z) in transaction T1 for read (Z) of Transaction T2. So, draw an edge from T2?T1.

exists a conflicting operation

Step6: At time t6, there is no conflicting operation for Write(Y) of Transaction T3.
Step7: At time t7, there exists a conflicting operation Write (Z) in transaction T1 for Write (Z) of Transaction T2. So, draw an edge from T2?T1, but it is already drawn.

After all the steps, the precedence graph will be ready, and it does not contain any cycle or loop, so the above schedule S2 is conflict serializable. And it is equivalent to a serial schedule. Above schedule S2 is transformed into the serial schedule by using the following steps:

Step1: Check the vertex in the precedence graph where indegree=0. So, take the vertex T2 from the graph and remove it from the graph.

Check the vertex in the precedence graph

Step 2: Again check the vertex in the left precedence graph where indegree=0. So, take the vertex T3 from the graph and remove it from the graph. And draw the edge from T2?T3.

graph and remove it from the graph

Step3: And at last, take the vertex T1 and connect with T3.

vertex T1 and connect with T3

Precedence graph equivalent to schedule S2

Precedence graph equivalent

Schedule S2 (Serial Schedule):

Time Transaction T1 Transaction T2 Transaction T3
t1   Read(Y)  
t2   Read(Z)  
t3   Write(Z)  
t4     Read(Y)
t5     Read(X)
t6     Write(Y)
t7 Read(X)    
t8 Read(Z)    
t9 Write(X)    
t10 Write(Z)    

Schedule S3 (Non-Serial Schedule):

Time Transaction T1 Transaction T2
t1 Read(X)  
t2    Read(X)
t3   Read (Y)
t4   Write(Y)
t5 Read(Y)  
t6 Write(X)  

To convert this schedule into a serial schedule, swap the non- conflicting operations of T1 and T2.

Time Transaction T1 Transaction T2
t1    Read(X)
t2   Read (Y)
t3   Write(Y)
t4 Read(X)  
t5 Read(Y)  
t6 Write(X)  

Then, finally get a serial schedule after swapping all the non-conflicting operations, so this schedule is conflict serializable.


Related Topics

DBMS Schedule

A schedule is a process of combining the multiple transactions into one and executing the operations of these transactions in a predefined order. A schedule can have multiple transactions in it, each transaction...

2 minutes read.

What is Non-Relational Database

Databases can be sorted as either relational or non-relational. Non-relational data sets are now and again alluded to as "NoSQL," which represents Not Only SQL. The principal difference between these...

4 minutes read.

ER Diagram for School Management System in DBMS

What is ER Diagram? An ERD, or entity relationship diagram, is a diagram that depicts the connections between a group of entities contained in a database. In other words, ER diagrams...

6 minutes read.

What is a Cloud Database

Cloud computing is the process of commoditizing data storage and processing time using standardized technologies. Cloud databases are databases that are hosted on cloud computing platforms such as Salesforce, GoGrid,...

4 minutes read.

DBMS Architecture

This is the first step when creating a database management system. The architecture of a database management system plays an important role in determining the actual design and layout of...

4 minutes read.

Deadlock in DBMS

Deadlock in DBMS A deadlock is an unwanted condition in which two or more transaction are waiting indefinitely for one another to give up locks. It is said to be one of the...

3 minutes read.

Advantages of Threaded Binary Tree in DBMS

We know that every node in a binary tree contains both its data value and the address pointers for its left and right children. A null pointer is used to...

3 minutes read.

Relational DBMS Concepts

What is RDBMS? RDBMS stands for Relational Database Management System.The relational database management system is a type of DBMS that stores information in the form of related tables and uses a...

3 minutes read.

States of Transaction in DBMS

Transaction States A transaction passes through many different states in its life cycle. These states are known as transaction states. A transaction can be in one of the following states in the database: Active statePartially...

3 minutes read.

Concurrent Execution of Transaction

In the transaction process, a system usually allows executing more than one transaction simultaneously. This process is called a concurrent execution. Advantages of concurrent execution of a transaction Decrease waiting time or...

4 minutes read.

Generalization in DBMS

Generalization in DBMS In the database management system, generalization is a concept combining the common attributes of two or more lower-level entity and form a new higher level with the common...

3 minutes read.

Relational Integrity Constraints

Relational Integrity Constraints are the set of rules that can be used to maintain the data integrity during an insert, delete and update operations into a table. These constraints are checked in the...

2 minutes read.

Codds Rule of DBMS

Codd’s Rule of DBMS Database having certain constraints and tables, need not to be a relational database system always. For perfect database management system, there are certain rules for the database,...

3 minutes read.

Data Abstraction in DBMS

Introduction Data abstraction is a fundamental concept in database management systems (DBMS). It refers to the process of hiding the details of how data is stored and retrieved from the user,...

3 minutes read.

DBMS Examples

Introduction to DBMS A database management system (DBMS) is a software application that is designed to manage and organize data stored in a database. It is responsible for storing, retrieving, and...

4 minutes read.

File Organization in DBMS

File Organization in DBMS: A database contains a huge amount of data, which is stored is in the physical memory in the form of files. A file is a set...

9 minutes read.

DBMS Schema

Schema It is a physical representation of data that appears in the database management system. In simple words, a schema is the structure of any database.It defines how the data is stored...

2 minutes read.

Concurrency Control Protocols

Concurrency Control Protocols Concurrency control protocols ensure the atomicity, serializability and isolation of the concurrent transactions. The Concurrency control protocols can be broadly classified into the following categories: Lock Based ProtocolTimestamp protocol Lock Based Protocol In this protocol,...

5 minutes read.

B+ (Plus) Tree in DBMS

What is a B+ tree? The B+ tree is known as a balanced binary search tree. in this tree, we can store the data in the form of nodes. B+ tree...

9 minutes read.

Difference between Dropbox and Amazon Drive

What is Dropbox? It is a file organising company that is owned by the American Company Dropbox Inc. Itsheadquarters is situated in San Francisco, California, U.S. Dropbox offers personal cloud, client...

3 minutes read.