Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
73 views14 pages

Schedules and Serializabilty in Dbms

Gshs

Uploaded by

tvcartoon610
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
73 views14 pages

Schedules and Serializabilty in Dbms

Gshs

Uploaded by

tvcartoon610
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 14
Serializability is a concept in database management systems (DBMS) that ensure the correctness of concurrent transactions When multiple transactions are executed a the same time, serializability in DBMS ensures that their combined effects on the database are equivalent to the effects of running them serially, one after the other. Ir What Is Serializability in DBMS? Serializability in DBMS guarantees that the execution of multiple transactions in parallel does not produce any unexpected or incorrect results. This is accomplished by enforcing a set of rules that ensure that each transaction is executed as if it were the only transaction running in the system. A schedule can include multiple transactions running concurrently, each performing a series of read and write operations on the database. The order of execution of these operations can significantly impact the final state of the database and the correctness of the results. e Serial Schedule e Non-Serial Schedule 1. Serial Schedule in DBMS: The serial schedule is a type of schedule where each transaction is executed in its entirety before the next transaction begins. This schedule can be viewed as the simplest and most straightforward type of schedule, as it guarantees that transactions are executed in isolation from each other. Due to the fact that transactions only execute one after the other, serial schedules are always serializable. Moreover, there are n! possible serial schedules for a transaction (where n is the number of transactions) Example of Serial Schedule: Transaction 1 Transaction 2 R(x) Wo) Ri) wy) Ry) wy) RX) W(x) 2. Non-Serial Schedule in DBMS: The Non-Serial schedule is a type of schedule where transactions are executed concurrently, with some overlap in time. Unlike a serial schedule, where transactions are executed one after the other with no overlap, a non-serial schedule allows transactions to execute simultaneously. Example of Non-Serial Schedule: Transaction 1 Transaction 2 R(x) W(x) Ry) wy) RY) R(x) a) Testing of Serializability in DBMS Testing for serializability in a database management system (DBMS) is an important step in ensuring that concurrent transactions executing in the database do not produce inconsistent or incorrect results. Serializability testing involves verifying that a given schedule of transactions is serializable, meaning that the effects of running the transactions concurrently are equivalent to running them serially, one after the other. We can use below two techniques to test serializability in DBMS: ¢ Serialization Graph « Precedence Graph It can be described as a Graph G(V, E) with vertices V = "V1, V2, V3... Vn' and directed edges E = "E1, E2, E3...., En’. One of the two operations—READ or WRITE—performed by a certain transaction is contained in the collection of ¢déGi ®)——>® The meaning of the above graph is that, before Transaction y , Transaction x is performing a read or write operation. Types of Serializability in DBMS There are mainly two types of serializability in DBMS: ¢ View Serializability © Conflict Serializability 1. View Serializability in DBMS: View Serializability is the process of determining whether or not a given schedule is view serializable. If a schedule is a view equivalent to a serial schedule, it is view serializable. To test for view serializability, we first identify the read and write operations of each transaction. A schedule is considered view serializable if it is view equivalent to a serial schedule, which is a schedule where the transactions are executed one after the other without any overlap. Example of View Serializability in DBMS: Transaction 1 Transaction 2 R(a) W(a) R(a) W(a) R(b) W(b) R(b) W(b) Let's swap the read-write operations in the middle of the two transactions to create the view equivalent schedule. Transaction 1 Transaction 2 R(a) W(a) ro Ts W(b) R(a) w(a) R(b) W(b) 2. Conflict Serializability in DBMS: A database management system (DBMS) schedule’ ability to prevent the sequence of conflicting transactions from having an impact on the transactions’ results is known as conflict serializability in DBMS. Conflicting transactions are those that make unauthorized changes to the same database data item. Example of Conflict Serialzabilit in DBMS: Transaction Transaction 2 Transaction 3 R(x) Ry) R(x) Ry) R(z) wi) we) R(2) W(x) Ww(z) Let's see how a precedence graph looks like of above schedule. @Q-—® \n In the above precedence graph, we can see that there is no cycle present in the graph. So, we can Say that the above schedule is conflict serializable. Conclusion In conclusion, serializability is a fundamental concept in database management systems that ensures data consistency and integrity in multi-user environments. By enforcing serializability, DBMS maintains the illusion of executing transactions in a sequential order, even in concurrent scenarios. This property plays a critical role in preventing data anomalies and conflicts that may arise when multiple transactions access and modify the same data simultaneously.

You might also like