×

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

Inference Rules

Armstrong’s axioms are the complete set of basic inference rules used to infer all the functional dependencies on the relational database. An inference rule is a type of assertion that a user can...

2 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.

3- Tier Architecture in DBMS

Three-tier architecture is an application software architecture that arranges the output into three parts or tiers that are:  the presentation tier, where the user interacts with the application; the application...

4 minutes read.

Advantages of Database Management System in DBMS

A database management system (DBMS) is a software tool that provides an interface for managing data stored in a database. Some advantages of using a DBMS include: data integration, data...

3 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.

Three Schema Architecture of DBMS

The three schema architecture describes how the data is represented or viewed by the user in the database. This architecture is also known as three-level architecture and is sometimes called...

3 minutes read.

Red-Black Tree Properties in DBMS

What is a Red-Black Tree? A red-black tree is a kind of self-balancing binary search tree. The extra bit that each node keeps denoting "color"-either "red" or "black"-is needed to keep...

3 minutes read.

Multivalued Dependency

Multivalued Dependency exists in a relation when two attributes depend on the third attribute but independent to each other. It is a full constraint between two sets of attributes in a relation. It...

2 minutes read.

Attributes in DBMS

What is Attribute? An attribute is an element in the database management system that describes the property or certain characteristics of the database entity. It is a crucial element of the...

3 minutes read.

Fundamentals Of Distributed DBMS

Fundamentals of DDBMS Here we are going to talk about the Fundamentals of DDBMS. But first, we need to know about Distributed databases to understand the Distributed Database Management System. Distributed Database: It is...

4 minutes read.

What is Transaction in DBMS

A transaction is a collection of logically related operations which reads and possibly updates the various data items in the database. Usually, a transaction is initiated by a user program written in high-level...

3 minutes read.

ER Model: Entity Relationship Diagram (ERD) with Examples

ER model stands for Entity-Relationship Model. It is a high-level data model diagram which defines the conceptual view of the database. It is a blueprint or design of a database that will...

2 minutes read.

What is Advanced Database Management System

Before diving into the Advance Database management system, we need to learn about the database management system and its usage. Database management system Database Management System or DBMS in short implies the...

3 minutes read.

Entity and Entity set in DBMS

What is DBMS? A database management system (DBMS) is a software application that interacts with end-users, other applications, and the database itself to capture and analyze the data. A DBMS allows...

3 minutes read.

Query processing in DBMS

Operations on DBMSs are made much simpler, more organized, and methodical with SQL. These are not only simpler for people to comprehend, but after gaining a basic comprehension of them, they...

4 minutes read.

Functional Dependencies

Functional Dependencies (FD) in the relational database management system occurs when one attribute in a relation uniquely determines other attribute in that relation. It describes the relation between the attributes. The term functional...

2 minutes read.

What is a Database

A database is a structured collection of data that is often kept electronically on a computer system. Typically, a database is managed by a database management system (DBMS). Together, the...

9 minutes read.

Founder of DBMS

The first database management system was built to automate the business of the General Electric Company. It was built by a small group of programmers. The Integrated Data Store IDS...

4 minutes read.

Components of DBMS

The database management system (DBMS) represents an essential tool for processing data within effectively structured structures. The database management system consists of important components that work together to maintain the...

6 minutes read.

B Tree in DBMS

How to perform Insertion operation in B Tree A new value is inserted at the leaf node. Same like in a binary search tree we traverse from starting root node to...

10 minutes read.