0% found this document useful (0 votes)
2 views

Modul 5 Session 7

The document discusses serial schedules and their implications on database transactions, specifically focusing on whether certain schedules are serializable. It explains the concepts of conflict serializability and view serializability, highlighting the differences between them. The document concludes that general serializability is complex to determine, but can be assessed through database operations like reads and writes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Modul 5 Session 7

The document discusses serial schedules and their implications on database transactions, specifically focusing on whether certain schedules are serializable. It explains the concepts of conflict serializability and view serializability, highlighting the differences between them. The document concludes that general serializability is complex to determine, but can be assessed through database operations like reads and writes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 14

A B C

Serial Schedule
500 500 500
Read (A, t)
t = t - 100
T1 Write (A, t)
Read (B, t)
t = t + 100
Write (B, t) 400 600 500
Read (A, s)
s = s - 100
Write (A, s)
T2 Read (C, s)
s = s + 100
Write (C, s) 300 600 600

300 + 600 + 600 = 1500


A B C

Serial Schedule Read (A, s) 500 500 500


s = s - 100
Write (A, s)
T2
Read (C, s)
s = s + 100
Write (C, s) 400 500 600
Read (A, t)
t = t - 100
Write (A, t)
T1
Read (B, t)
t = t + 100
Write (B, t) 300 600 600

300 + 600 + 600 = 1500


Serial Schedule
T1 T2 Tn

S0 S1 S2 Sn

Consistent States

4
Is this Serializable?
Read (A, t)
t = t - 100
Write (A, t)
Read (A, s)
s = s - 100
Write (A, s)
Read (B, t)
t = t + 100
Write (B, t)
Read (C, s)
s = s + 100
Transaction T1 Write (C, s) Transaction T2
Read (A, t) Equivalent Serial Schedule
t = t - 100
Write (A, t)
Read (B, t)
t = t + 100
Write (B, t)
Read (A, s)
s = s - 100
Write (A, s)
Read (C, s)
s = s + 100
Write (C, s)
Transaction T1 Transaction T2
Is this Serializable?
Read (A, t)
t = t - 100
Read (A, s)
s = s - 100
Write (A, s)
Write (A, t)
Read (B, t) No. In fact, it leads
t = t + 100 to inconsistent state
Write (B, t)
Read (C, s)
s = s + 100
Write (C, s)
Transaction T1 Transaction T2
Read (A, t)
Is this Serializable?
t = t - 100
Read (A, s)
s = s - 100 0
Write (A, s)
Write (A, t)
Read (B, t)
t = t + 100
Write (B, t)
Read (C, s)
s = s + 100 0
Write (C, s)
Transaction T1 Transaction T2
Read (A, t)
Is this Serializable?
t = t - 100
Read (A, s)
s=s-0
Write (A, s)
Write (A, t) Yes, T2 is no-op
Read (B, t)
t = t + 100
Write (B, t)
Read (C, s)
s=s+0
Write (C, s)
Transaction T1 Transaction T2
Serializable Schedule
Read (A, t)
t = t - 100
Read (A, s)
s=s-0
Write (A, s)
Write (A, t) Serializability depends
Read (B, t) on code details
t = t + 100
Write (B, t)
Read (C, s)
s=s+0
Write (C, s)
Transaction T1 Transaction T2
Serializable Schedule
Read (A, t)
t = t - 100
Write (A, t)
Read (A, s)
s = s - 100
Write (A, s)
Read (B, t) Still Serializable!
t = t + 100
Write (B, t)
Read (C, s)
s = s + 100
Write (C, s)
Transaction T1 Transaction T2
Serializability
• General Serializability:
• Hard to determine
• Goal: weaker serializability
• Determined from database operations alone
• Database Operations:
• Reads, Writes, Inserts, …

12
Types of Serializability

 Conflict Serializability
• Weaker notion of serializability
• Depends only on reads and writes

13
View Serializability

• A schedule S is view serializable if there exists a serial


schedule S’, such that the source of all reads in S and S’
are the same.

14

You might also like