×

View Serializability in DBMS

View Serializability

It is a type of serializability that can be used to check whether the given schedule is view serializable or not. A schedule called as a view serializable if it is view equivalent to a serial schedule.

View Equivalent

Two schedules S1 and S2 are said to be view equivalent if both satisfy the following conditions:

1. Initial read

An initial read of the data item in both the schedule must be same. For example, lets two schedule S1 and S2. If transaction T1 reads the data item A in schedule S1, then in schedule S2 transaction T1 also reads A.

Schedule S1:

Time Transaction T1 Transaction T2
t1 Read(X)  
t2   Write(X)

Schedule S2:

Time Transaction T1 Transaction T2
t1   Write(X)
t2 Read(X)  

Above two schedules, S1 and S2 are view equivalent, because initial read instruction in S1 is done by T1 transaction and in schedule S2 is also done by transaction T2.

2. Updated Read

In schedule S1, if the transaction Ti is reading the data item A which is updated by transaction Tj, then in schedule S2 also, Ti should read data item A which is updated by Tj.

Schedule S1:

Time Transaction T1 Transaction T2
 t1 Write(X)  
t2   Read(X)

Schedule S2:

Time Transaction T1 Transaction T2
 t1 Write(X)  
t2   Read(X)


Above two schedules S1 and S2 are view equivalent because in schedule S1 transaction T2 reads the data item A which is updated by T1 and in schedule S2 T2 also reads the data item A which is updated by T1.  


3. Final write

 The final write operation on each data item in both the schedule must be same. In a schedule S1, if a transaction T1 updates data item A at last then in schedule S2, final writes operations should also be done by T1 transaction.

Schedule S1:

Time Transaction T1 Transaction T2 Transaction T3
t1     Write(X)
t2   Read(X)  
t3 Write(X)    

Schedule S2:

Time Transaction T1 Transaction T2 Transaction T3
t1     Write(X)
t2   Read(X)  
t3 Write(X)    

Above two schedules, S1 and S2 are view equivalent because final write operation in schedule S1 is done by T1 and in S2, T1 also does the final write operation.

View Serializable

A schedule is said to be a view serializable if that schedule is view equivalent to a serial schedule.

View Serializable example

Schedule S1 (Non-Serial Schedule):

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

Schedule S2 (Serial Schedule):

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

Note: S2 is the serial schedule of S1. If we can prove that both the schedule are view equivalent, then we can say that S1 schedule is a view serializable schedule.

Now, check the three conditions of view serializability for this example:

1. Initial Read

In S1 schedule, T1 transaction first reads the data item X. In Schedule S2 also transaction T1 first reads the data item X.
Now, check for Y. In schedule S1, T1 transaction first reads the data item Y. In schedule S2 also the first read operation on data item Y is performed by T1.
We checked for both data items X and Y, and the initial read condition is satisfied in schedule S1 & S2.

2. Updated Read

In Schedule S1, transaction T2 reads the value of X, which is written by transaction T1. In Schedule S2, the same transaction T2 reads the data item X after T1 updates it.
Now check for Y. In Schedule S1, transaction T2 reads the value of Y, which is written by T1. In S2, the same transaction T2 reads the value of data item Y after T1 writes it.
The update read condition is also satisfied for both the schedules S1 and S2.

3. Final Write

In schedule S1, the final write operation on data item X is done by transaction T2. In schedule S2 also transaction T2 performs the final write operation on X.
Now, check for data item Y. In schedule S1, the final write operation on Y is done by T2 transaction. In schedule S2, a final write operation on Y is done by T2.
We checked for both data items X and Y, and the final write condition is also satisfied for both the schedule S1 & S2.

Conclusion: Hence, all the three conditions are satisfied in this example, which means Schedule S1 and S2 are view equivalent. Also, it is proved that schedule S2 is the serial schedule of S1. Thus we can say that the S1 schedule is a view serializable schedule.


Related Topics

Red-Black Tree Deletion in DBMS

Introduction To Red Black Tree Each node's extra bit in a red-black tree, a type of self-balancing binary search tree, is frequently understood as the color (red or black). The balance...

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.

Advantages of B-Tree in DBMS

A self-balancing search tree is the B-Tree. It is assumed that everything is in the main memory in most other self-balancing search trees (such as AVL and Red-Black Trees). We must...

3 minutes read.

Domain Constraints in DBMS

Introduction about DBMS:- DBMS stands for DataBase Management System. DBMS(DataBase Management System) is a type of software by which we can save and retrieve the user's data with the security process....

3 minutes read.

Constraints in Database Management System

In a database management system, certain constraints are applied while performing any operation on the database to ensure that the integrity and quality of the data are maintained throughout the...

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

Relational algebra in DBMS

Relational algebra in DBMS Relational algebra is a procedural query language used to retrieve the data from a database in a different way. It works on the relational model. It performs...

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.

Query optimization in DBMS

Choosing an effective execution strategy to execute a query is a process known as query optimization. After the decision-making process of query parsing, which determines how many distinct ways a given...

5 minutes read.

Components of Relational Database Management System

A relational database management system compromises various component. Tables, records, attributes, instances, schemas and keys together form a relational database. In this page, we will discuss each component of RDBMS in...

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

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.

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.

DBMS Languages

User can access, update, delete, and store data or information in the database using database languages. The following are the databases languages in the database management system: Data Definition Language Data Manipulation...

3 minutes read.

DBMS Architecture

Architecture of Database Management System DBMS architecture helps in development, implementation, design, and maintenance of a database that store and organize information for agencies, businesses, and institutions. It is the base of any database...

2 minutes read.

Trigger in DBMS

Trigger in DBMS: A trigger is a procedure of SQL statements, which is automatically fired when the DML statements are executed on the table of the database. Triggers are the...

3 minutes read.

Applications of DBMS

There are various fields where a database management system is used. Following are some applications which make use of the database management system: 1. Railway Reservation System: In the railway reservation...

7 minutes read.

Levels of Abstraction in DBMS

Data abstraction is a way to hide unwanted or irrelevant information from the end user in DBMS. It helps in enhancing the security of data, and simplifies database design using...

4 minutes read.

ER Diagram for Student Management System in DBMS

Entity Relationship diagrams Entity Relationship Diagrams, or ER Diagrams for short, are diagrams that show the relationships among entity sets that are stored in databases. Alternatively said, ER diagrams assist in...

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.