Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 10

Serializability

Academic year:2020-21 (June – Dec.)


Department of Information Technology
Course: 3130703 – Database Management System

Presented By :
Krupa M. Patel(190630116041)
Preksha N. Patel(1190630116049)
Outline
1. What is Serializability?
2. Explain Conflict and View Serializability in
detail with example.
Serializability
• Serializability is a concept that helps to
identify which non-serial schedules are correct
and will maintain the consistency of the
database.
Example of Serializability

• Schedule1 is a serial schedule consisting of Transaction1 and


Transaction2 wherein the operations on data item A (A1 and
A2) are performed first and later the operations on data item B
(B1 and B2) are carried out serially.
• Schedule2 is a non-serial schedule consisting of Transaction1
and Transaction2 wherein the operations are interleaved.
Types of Serializability
1) Result Equivalent Schedule
2) Conflict Equivalent Schedule
3) View Equivalent Schedule
Conflict Equivalent Schedule

• When either of a conflict operation such as Read-Write or Write-Read


or Write-Write is implemented on the same data item at the same time
within different transactions then the schedule holding such
transactions is said to be a conflict schedule. The prerequisites for such
conflict schedule are:
1. The conflict operations are to be implemented on the same data item.
2. The conflict operations (RW, WR, WW) must take place within different
transactions.
3. At least one of the conflict operations must be the write operation.
4. Two Read operations will not create any conflict.
• Two schedules are said to be conflict serializable if the conflict
operations in both the schedules are executed in the same order
Example :

• Schedule2 (a non-serial schedule) is considered to


be conflict serializable when its conflict operations
are the same as that of Shedule1 (a serial
schedule).
View Equivalent Schedule

• Two schedules (one being serial schedule and another being


non-serial) are said to be view serializable if they satisfy the
rules for being view equivalent to one another.

• The rules to be upheld are:


1. Initial values of the data items involved within a schedule
must be the same.
2. Final values of the data items involved within a schedule
must be the same.
3. The number of WR operations performed must be
equivalent for the schedules involved.
Example :

• The (non-serial) Schedule2 is considered as a view equivalent of the (serial)


Schedule1, when the 3 rules of view serializability are satisfied. For the example
shown above,
• The Initial transaction of read operation on the data items A and B both begin at
T1
• The Final transaction of write operations on the data items A and B both end at T2
• The number of updates from write-read operations are 2 in both the cases
• Hence satisfying all the rules required, Schedule2 becomes view serializable w.r.t
Schedule1
Thank You

You might also like