View Serializability in DBMS

Spread the love

Schedules in DBMS-

 

Before you go through this article, make sure that you have gone through the previous article on Serializability in DBMS.

 

We have discussed-

  • The concept of serializability helps to identify the correct non-serial schedules that maintains the consistency of the database.
  • There are two types of serializability-

 

 

In this article, we will discuss about View Serializability.

 

View Serializability-

 

If a given schedule is found to be view equivalent to some serial schedule, then it is called as a view serializable schedule.

 

Also read- Schedules in DBMS

 

View Equivalent Schedules-

 

Consider two schedules S1 and S2 each consisting of two transactions T1 and T2.

Schedules S1 and S2 are called view equivalent if the following three conditions hold true for them-

 

Condition-01:

 

For each data item X, if transaction Ti reads X from the database initially in schedule S1, then in schedule S2 also, Tmust perform the initial read of X from the database.

 

Thumb Rule

“Initial readers must be same for all the data items”.

 

Condition-02:

 

If transaction Ti reads a data item that has been updated by the transaction Tj in schedule S1, then in schedule S2 also, transaction Ti must read the same data item that has been updated by the transaction Tj.

 

Thumb Rule

“Write-read sequence must be same.”.

 

Condition-03:

 

For each data item X, if X has been updated at last by transaction Ti in schedule S1, then in schedule S2 also, X must be updated at last by transaction Ti.

 

Thumb Rule

“Final writers must be same for all the data items”.

 

Checking Whether a Schedule is View Serializable Or Not-

 

Method-01:

 

Check whether the given schedule is conflict serializable or not.

  • If the given schedule is conflict serializable, then it is surely view serializable. Stop and report your answer.
  • If the given schedule is not conflict serializable, then it may or may not be view serializable. Go and check using other methods.

 

Thumb Rules

  • All conflict serializable schedules are view serializable.
  • All view serializable schedules may or may not be conflict serializable.

 

Method-02:

 

Check if there exists any blind write operation.

(Writing without reading is called as a blind write).

  • If there does not exist any blind write, then the schedule is surely not view serializable. Stop and report your answer.
  • If there exists any blind write, then the schedule may or may not be view serializable. Go and check using other methods.

 

Thumb Rule

No blind write means not a view serializable schedule.

 

Method-03:

 

In this method, try finding a view equivalent serial schedule.

  • By using the above three conditions, write all the dependencies.
  • Then, draw a graph using those dependencies.
  • If there exists no cycle in the graph, then the schedule is view serializable otherwise not.

 

Next Article- Practice Problems On View Serializability

 

Get more notes and other study material of Database Management System (DBMS).

Watch video lectures by visiting our YouTube channel LearnVidFun.

Summary
View Serializability in DBMS
Article Name
View Serializability in DBMS
Description
View Serializability- A view serializable schedule is a schedule which is view equivalent to some serial schedule. View Serializability and Conflict Serializability are two types of serializability in DBMS. Conditions to check whether a given schedule is view serializable or not.
Author
Publisher Name
Gate Vidyalay
Publisher Logo

Spread the love