Introduction to View Serializability in DBMS
DBMS View Serializability is a method to discover that a specified schedule is either view serializable or not. To prove whether a specified schedule is view serializable, the user involves testing whether the agreed schedule is View Equivalent to its serial schedule. Since there is no synchronized transactions execution, we can confirm that a serial schedule will certainly not leave the database unpredictable. Conversely, the database can be left in an inconsistent state in a non-serial schedule because there exist multiple transactions executing concurrently in the database server. By testing that a specified non-serial schedule is view serializable, we need to ensure that it holds a consistent schedule.
Syntax of View Serializability in DBMS
In simple words, we can define the View Serializability in DBMS when a particular schedule is present to be known as view equivalent to a few serial schedule, i.e. no overlapping transactions.
Let us see how to test whether the two DBMS schedules available are defined to remain view equivalent or not:
Suppose we have two schedules X1 and X2, that are known to remain view equivalent only if they match all the succeeding conditions:
- Initial Read: In both the schedules, the initial read status of every data item should match in transactions. For illustration, if transaction X1 states a data item Y before transaction X2 in schedule T1, then in the specified schedule T2, X1 must-read Y before X2.
- Read vs Initial Read: Anyone can have confusion with the word-initial read. Therefore, the initial read denotes the preliminary read procedure on a data item. For instance, we can view that data item Y can be delivered numerous times in a schedule, but then the initial read operation on Y is known to be an initial read.
- Final Write: In the both the schedules, final write processes on every data item should satisfy. Suppose, for instance, Transaction X1 formerly writes a data item Y in schedule T1, then in T2, the latest write procedure on Y must be accomplished by the transaction X1.
- Update Read: Uncertainty in schedule T1, the transaction X1 is reading any data item restructured by X2 than in schedule T2 on the identical data item. Supposing for illustration, in schedule T1, X1 implements a read procedure on Y after the writing procedure on Y by X2, then in T2, X1 must read the Y after X2 implements write on Y.
How to Perform View Serializability in DBMS?
To inspect that a definite non-serial schedule is stated to remain view serializable, we need to confirm that it holds a consistent schedule. It may seem to check whether a non-serial schedule is serializable instead of having a serial schedule for all time. The answer for this is that the system resources are completely consumed by the concurrent implementation of transactions that are significantly quicker when associated with serial schedules.
Here, the idea of serializability benefits for identifying the precise non-serial schedules that support the consistency of the database.
Mainly, there are two kinds of serializability:
1. Conflict Serializability
We can identify whether the provided schedule is said to be conflict serializable or not by the following:
- If the specified schedule is conflict serializable after that will certainly be view serializable. Stopover and report your response.
- But if the specified schedule is not conflict kind, so then it can or cannot be view serializable. So, we need to go back and try other processes.
2. View Serializability
Find the following thumb rules which define the conditions for view serializability:
- Initial readers should be similar for entire data items.
- The write-read sequence should be identical.
- Final writers should be identical for whole data items.
- All conflict serializable schedules are said to be view serializable.
- All view serializable schedules might or might not be conflict serializable.
- No blind write denotes not any view serializable schedule.
Examples of View Serializability in DBMS
Let us see by taking an example to recognize the term View Serializability in DBMS:
For the above-specified schedule, the serial schedule is:
As we have seen that in the Serial Schedule, a transaction must only start when the present executing transaction is completed. Hence, the serial schedule of the provided schedule should look like the below one:
Thus, when we prove that the provided schedule in DBMS is View Equivalent to its serial schedule, after that, the specified schedule cab be defined as View Serializable.
Let us again illustrate the above syntax through distinct examples to test the three different methods to know whether a schedule defines a view serializability or not:
Checking if the specified schedule is present as a conflict serializable or not by following:
- When a schedule exists as a conflict serializable, so it will certainly be view serializable.
- When the provided schedule is not then, it can or cannot be view serializable in DBMS.
We will test if there occurs any blind write operation procedure where the term blind write defines writing without reading:
- If any blind write is present then, the schedule will definitely not be view serializable.
- But if there occurs a blind write, then the schedule might or might not be view serializable.
Here, we will check to get a view equivalent serial schedule:
- Using the all above three conditional methods, we will write the entire dependencies.
- After that, we will draw a graph applying those dependencies.
- But when there occurs no cycle in the graph, then the schedule will be view serializable or else not.
If any two schedules T1 and T2 are said to be known as view equivalent due to the reason that the final write operation present in the T1 schedule is performed by X1 transaction, and in T2, the X1 implements the final write operation.
Note that T2 is said to be a serial schedule of T1. If we need to prove that both the schedules be view equivalent so that we can define the T1 schedule be a view serializable schedule in DBMS.
DBMS View Serializability is a technical concept that aids in recognising the accurate non-serial schedules that uphold the consistency of the database in the server. Talking only about Serializability, it includes two types: Conflict and View Serializability. The schedulers normally promise Serializability irrespective of what the DBMS transactions do with their data.
This is a guide to View Serializability in DBMS. Here we discuss the introduction, how to perform view serializability in DBMS and examples. You may also have a look at the following articles to learn more –