View Serializable Schedule In DBMS/ What is view serializable schedule?

Hello Friends, In this blog post(View Serializable Schedule In DBMS), I will let you know about the view serializable schedule. This is related to DBMS.

Inside this blog post(View Serializable Schedule In DBMS), we are going to let you know about What is view serializable schedule? What is a serializable schedule in the database? How do you tell if a schedule is serializable? How do you test the serializability of a schedule explain with an example?

I guess you probably would have heard about the view in the database, That is a customization presentation of data as per our requirement|View Serializable Schedule In DBMS|

And here this view serializable schedule is a view of its non-serializable view and here we just check whether this serializable schedule of its non-serializable schedule is view equivalent or not|View Serializable Schedule In DBMS|

What is View Serializability?|View Serializable Schedule In DBMS?

View serializability is just a simple process to check whether the given schedule is view serializable or not.

To check whether a given schedule is view serializable, we need to check whether the given schedule is View Equivalent to its serial schedule.

to check the view serializability of a given schedule, we just need to check whether the given schedule is view equivalent to its serial schedule or not.

Let’s see, we understand this with the help of a example given below.

Given Schedule:

Non-Serial

non-serial schedule
View Serializable:non-serial schedule

Serial Schedule:

As we know that in the Serial schedule a transaction only starts when the current running transaction is finished. So the serial schedule of the above-given schedule would look like this:

serial schedule
View Serializable: serial schedule

In a serial schedule, a new transaction will start only when the previous transaction has been completed. You can see the below When T1 has finished all its task then only T2 get started.

So, here if we are able to prove that this given schedule is view equivalent to its serial schedule then this given schedule will be called view serializable.

Why we need View Serializability?

As it is known to all of us that if we use serial schedule then the database will never be trapped in an inconsistent state as there are no concurrent transactions are running in this schedule.

But with the use of a non-serial schedule, there are high chances that the database may go inconsistent state as concurrent transactions are allowed in this schedule.

So to just make sure the consistency of the database we need to check the view serializability of a given non-serial schedule.

But there could be one question in your mind that instead of checking the view serializability of non-serial schedule, why don’t we have serial schedule always?

But, this is not feasible from the resources point of view. Because the concurrent executions in non-serial schedules utilize the resources completely or fully. That can’t be missed in the serial schedule.

So now the question is how can we check whether the given schedule is view equivalent to its a serial schedule?

Two schedules S1 and S2 are said to be view equivalent if they satisfy all the following conditions given below:

Initial Read:

In this condition, the initial read operations in transactions T1 and T2 must match in both the schedule. For example, in schedule S1, T1 reads data x before T2, then in schedule S2, T1 should read data x before T2.

Final Write:

In this condition, the final write operation on the data items must match in both the schedule. For example, if T1 writes the data x at last in the schedule in S1 then in schedule S2, T1 should write the data X at last.

Update Read:

In this condition if T1 reads a data X which is write by T2 in S1, then In S2 T1 will read the data X which will write by T2.

What is View Serializable?

If a schedule is a view equivalent to its serial schedule then the given schedule is said to be View Serializable. Let’s understand this with the help of another example given below.

In the below image, we have two schedule S1(non-serial) and S2(serial) with the Transactions T1 and T2 in both the schedule.

view serializability example
view serializability example

As we have seen the necessary conditions for the view serializability above, so now we check for those conditions, we these schedules follow all the conditions or not.

Initial Read

Check for data X:

schedule S1, transaction T1 first reads the data item X. In S2 also transaction T1 first reads the data item X.

Check for data Y:

In schedule S1, transaction T1 first reads the data item Y. In S2 also the first read operation on Y is performed by T1.

We checked for both data items X & Y and the initial read condition is satisfied in S1 & S2.

Final Write

Check for data X:

In schedule S1, the final write operation on X is done by transaction T2. In S2 also transaction T2 performs the final write on X.

Check for data Y:

In schedule S1, the final write operation on Y is done by transaction T2. In schedule S2, final write on Y is done by T2.

We checked for both data items X & Y and the final write condition is satisfied in S1 & S2.

Update Read

Check for data X:

In S1, transaction T2 reads the value of X, written by T1. In S2, the same transaction T2 reads the X after it is written by T1.

Check for data Y:

In S1, transaction T2 reads the value of Y, written by T1. In S2, the same transaction T2 reads the value of Y after it is updated by T1.

The update read condition is also satisfied for both the schedules.

Conclusion:

As S1 and S2 fulfill all the conditions stated above, so we can say that S1 and S2 are view equivalent. And S2 is the serial schedule of S1 so we can say that S1 is the view serializable schedule. Within this blog we have gone through What is view serializable schedule, What is serializable schedule in the database, How do you tell if a schedule is serializable, How do you test serializability of a schedule explain with an example|View Serializable Schedule In DBMS|

In the case of any queries, you can write to us at [email protected] we will get back to you ASAP|View Serializable Schedule In DBMS|

Hope! you would have enjoyed this post about View Serializable Schedule In DBMS .

Please feel free to give your important feedbacks in the comment section below|View Serializable Schedule In DBMS|

Have a great time!

Anurag

I am a blogger by passion, a software engineer by profession, a singer by consideration and rest of things that I do is for my destination.