SlideShare a Scribd company logo
Transaction Serializability
Prof. Deptii Chaudhari
HOPE FOUNDATION’S
INTERNATIONAL INSTITUTE OF INFORMATION TECHNOLOGY, (I²IT)
www.isquareit.edu.in
+91 20 22933441 / 2
Transaction Serializability
•Basic Assumption – Each transaction preserves database
consistency.
•Thus serial execution of a set of transactions preserves
database consistency.
•A (possibly concurrent) schedule is serializable if it is
equivalent to a serial schedule.
•Different forms of schedule equivalence give rise to the
notions of:
1. Conflict serializability
2. View serializability
Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057
Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
Conflicting Instructions
• Instructions li and lj of transactions Ti and Tj respectively, conflict if and
only if there exists some item Q accessed by both li and lj, and at least one of
these instructions wrote Q.
1. li = read(Q), lj = read(Q). li and lj don’t conflict.
2. li = read(Q), lj = write(Q). They conflict.
3. li = write(Q),lj = read(Q). They conflict
4. li = write(Q),lj = write(Q). They conflict
• Intuitively, a conflict between li and lj forces a (logical) temporal order
between them.
• If li and lj are consecutive in a schedule and they do not conflict, their results would
remain the same even if they had been interchanged in the schedule.
Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057
Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
Conflict Serializability
•If a schedule S can be transformed into a schedule S´
by a series of swaps of non-conflicting instructions,
we say that S and S´ are conflict equivalent.
•We say that a schedule S is conflict serializable if it
is conflict equivalent to a serial schedule.
Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057
Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
Conflict Serializability
• Schedule 1 can be transformed into Schedule 2, a serial schedule where T2
follows T1, by series of swaps of non-conflicting instructions.
• Therefore Schedule 1 is conflict serializable.
Schedule 1 Schedule 2
Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057
Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
• Example of a schedule that is not conflict serializable:
• We are unable to swap instructions in the above schedule to obtain
either the serial schedule < T3, T4 >, or the serial schedule < T4, T3
>.
Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057
Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
Testing for Serializability
•Consider some schedule of a set of transactions T1, T2, ..., Tn
•Precedence graph — a direct graph where the vertices are
the transactions (names).
•We draw an arc from Ti to Tj if the two transaction conflict,
and Ti accessed the data item on which the conflict arose
earlier.
•We may label the arc by the item that was accessed.
Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057
Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
Example
Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057
Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
How to check for Conflict serializability?
• Consider the schedule
• T1 | R1(X) R1(X)
• T2 | R2(Y) R2(Y) W2(X)
• T3 | W3(Y)
• Step #1 : Check for the conflicting actions.
• Two or more actions are said to be in conflict if:
• 1. The actions belong to different transactions.
2. At least one of the actions is a write operation.
3. The actions access the same object (read or write).
• The following set of actions is conflicting:
• T1:R(X), T2:W(X), T1:R(X)
Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057
Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
• While the following sets of actions are not:
• T1:R(X), T2:R(Y), T3:R(X)
T1:R(X), T2:W(Y), T3:R(X)
• For our example, we have a conflict on X (T1 reads it and T2 writes it).
We also have a conflict on Y (T2 reads it and T3 writes it).
• So it has a conflict property but is it serializable?
• Step #2 : Check for a cycle in the Precedence Graph.
• First, draw all the Transactions (Tx):
Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057
Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
T1 T2
T3
Initial Graph
• Check if there is a Tx that reads an item after a different Tx writes it.
• We have T1 that reads X after T2 writes it, so draw arrow from T2 -> T1
• Check if there is a Tx that writes an item after a different Tx reads it.
• We have T2 that writes X after T1 reads it, so draw arrow from T1 -> T2
• We also have T3 that writes Y after T2 reads it, so draw arrow from T2 -> T3
• Check if there is a Tx that writes an item after a different TX writes it.
Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057
Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
• We can see that there is a cycle between T1 and T2, so
the graph is cyclic, and therefore it is not conflict
serializable.
Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057
Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
T1 T2
T3
Final Graph
VIEW SERIALIZABILITY
• Consider two schedules S1 and S2, where the same set of
transactions participates in both schedules. The schedules S1
and S2 are said to be view equivalent if three conditions are
met:
• 1. If Ti reads initial value of A in S1, then Ti also reads initial
value of A in S2
• 2. If Ti reads value of A written by Tj in S1, then Ti also reads
value of A written by Tj in S2
• 3. If Ti writes final value of A in S1, then Ti also writes final
value of A in S2
Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057
Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
• The concept of view equivalence leads to the concept of view
serializability.
• We say that a schedule S is view serializable if it is view
equivalent to a serial schedule.
Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057
Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
View Equivalent Schedule
• Consider two schedules S1 and S2, they are said to be view equivalent if
following conditions are true :
• Initial read must be same.
• S1 : T1 reads A from Database.
S2 : T1 reads A from T2.
∴ S1 ≠ S2.
Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057
Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
T1 T2
R(A)
W(A)
T1 T2
W(A)
R(A)
S1 S2
• There are two transactions say Ti and Tj, The schedule S1 and S2 are view
equivalent if in schedule S1, Ti reads A that has been updated by Tj, and in
schedule S2, Ti must read A from Tj. i.e. write-read(WR) sequence must be
same between S1 and S2.
S1 : T3 reads value of A from T2.
S2 : T3 reads value of A from T1.
∴ S1 ≠ S2.
i.e. write-read sequence is not
same between S1 and S2.
Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057
Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
T1 T2 T3
W(A)
W(A)
R(A)
S1
T1 T2 T3
W(A)
W(A)
R(A)
S2
• Final write operations should be same between S1 and S2.
Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057
Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
T1 T2 T3
W1(A)
R2(A)
W3(A)
S1
T1 T2 T3
W2(A)
W3(A)
R2(A)
W1(A)
S2
S1 : A is finally updated by T3.
S2 : A is finally updated by T1.
∴ S1 ≠ S2.
• Check whether the schedule is view serializable or not?
• S : R2(B); R2(A); R1(A); R3(A); W1(B); W2(B); W3(B)
• Solution: With 3 transactions, total number of schedules possible = 3! = 6
• <T1 T2 T3>
• <T1 T3 T2>
• <T2 T3 T1>
• <T2 T1 T3>
• <T3 T1 T2>
• <T3 T2 T1>
• Step 1 : Final Updation (Write) on data items
• A : -
• B : T1 T2 T3
Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057
Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
• Since the final updation on B is made by T3, so the transaction T3 must execute before transactions T1 and
T2.
• Therefore, (T1,T2) → T3
• Now, Removing those schedules in which T3 is not executing at last.
• Remaining Schedules : <T1 T2 T3> and <T2 T1 T3>
• Step 2 : Initial Read + Which transaction updates after read?
• A : T2 T1 T3
• B : T2 T1
• The transaction T2 reads B initially which is updated by T1. So T2 must execute before T1.
• Hence, T2 → T1
• Now, Removing those schedules in which T2 is not executing before T1.
• Remaining Schedules : <T2 T1 T3>
Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057
Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
• Step 3 : Write Read Sequence (WR) :
• No need to check here.
• Hence, view equivalent serial schedule is :
• T2 → T1 → T3
Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057
Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
• Check whether the schedules is View serializable or not ?
• R2(A); R1(A); W1(C); R3(C); W1(B); R4(B); W3(A); R4(C); W2(D);
R2(B); W4(A); W4(B)
• Solution
• The data items on which operations are occurring are A,B,C,D.
• Step 1 : Check for Final Updation (Write) on data items
• A : T3 T4
• B : T1 T4
• C : T1
• D : T2
Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057
Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
• Since the final updation on A is made by T4, so the transaction T4 must execute after T3
transaction.
• Since the final updation on B is made by T4, so the transaction T1 must execute before T3
transaction.
• Dependency 1 : (T1 T3) → T4 ..... (1)
• Step 2 : Initial Read
• Initial Read + Which transaction updates after read?
• A : T2 T1 T3
• The transaction T2 and T1 reads A initially from DB which is updated by T3. So T3 must
execute after T1 and T2.
• Dependency 2 : (T2 T1) → T3 ..... (2)
• From (1) and (2) dependencies, another dependency can be concluded as :
• Dependency 3 : (T1 T2) → T3 → T4 ..... (3)
Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057
Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
• Step 3 : Write Read Sequence (WR) :
WR Seq. : Dependencies :
W1(C) R3(C) T1 → T3
W1(C) R4(C) T1 → T4
W1(B) R4(B) T1 → T4
W1(B) R2(B) T1 → T2
• ⇒ T1 → (T2 T3 T4) ....(4)
• From (3) and (4) dependencies, We conclude the view equivalent serial schedule is :
• T1 → T2 → T3 → T4.
Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057
Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
• Check whether given schedule is view serializable. Justify your answer.
• Step 1 : Check for Final Updation (Write) on data item Q
• (T4, T3 ) -> T5
• DEPENDENCY : (T4 ,T3)→ T5 ……(1)
Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057
Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
• Step 2 : Initial Read
• Initial Read + Which transaction updates after read?
• T3 T4, T5
• The transaction T3 reads Q initially from DB which is updated by T4 & T5. So T3 must
execute before T4 and T5.
• Dependency 2 : T3 → (T4, T5) ..... (2)
• Step 3 : Write Read Sequence (WR)
• No need to check here.
• From dependency (1) T4 must happen before T3 & from dependency 2 T3 must happen
before T4. This results in cyclic dependency which cannot be resolved.
• Hence the given schedule is not view serializable.
Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057
Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
THANK YOU !!
For further information please contact
Prof. Deptii Chaudhari
Department of Computer Engineering
Hope Foundation’s International Institute of Information Technology, I2IT
Hinjawadi, Pune – 411 057
Phone - +91 20 22933441
www.isquareit.edu.in | deptiic@isquareit.edu.in
Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057
Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in

More Related Content

What's hot

Acid properties
Acid propertiesAcid properties
Acid properties
Abhilasha Lahigude
 
Concurrency control
Concurrency controlConcurrency control
Concurrency control
Soumyajit Dutta
 
Transaction management DBMS
Transaction  management DBMSTransaction  management DBMS
Transaction management DBMS
Megha Patel
 
Lock based protocols
Lock based protocolsLock based protocols
Lock based protocols
ChethanMp7
 
Concurrency Control Techniques
Concurrency Control TechniquesConcurrency Control Techniques
Concurrency Control Techniques
Raj vardhan
 
16. Concurrency Control in DBMS
16. Concurrency Control in DBMS16. Concurrency Control in DBMS
16. Concurrency Control in DBMS
koolkampus
 
Degree of relationship set
Degree of relationship setDegree of relationship set
Degree of relationship set
Megha Sharma
 
Transaction management in DBMS
Transaction management in DBMSTransaction management in DBMS
Transaction management in DBMS
Megha Sharma
 
Concurrency control
Concurrency controlConcurrency control
Concurrency control
Subhasish Pati
 
Triggers
TriggersTriggers
Triggers
Pooja Dixit
 
Adbms 43 multiversion concurrency control
Adbms 43 multiversion concurrency controlAdbms 43 multiversion concurrency control
Adbms 43 multiversion concurrency control
Vaibhav Khanna
 
Databases: Concurrency Control
Databases: Concurrency ControlDatabases: Concurrency Control
Databases: Concurrency Control
Damian T. Gordon
 
trigger dbms
trigger dbmstrigger dbms
trigger dbms
kuldeep100
 
SQL Server Transaction Management
SQL Server Transaction ManagementSQL Server Transaction Management
SQL Server Transaction Management
Mark Ginnebaugh
 
Adbms 36 transaction support in sql 2
Adbms 36 transaction support in sql 2Adbms 36 transaction support in sql 2
Adbms 36 transaction support in sql 2
Vaibhav Khanna
 
Concurrency Control.
Concurrency Control.Concurrency Control.
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
FUNCTION DEPENDENCY  AND TYPES & EXAMPLEFUNCTION DEPENDENCY  AND TYPES & EXAMPLE
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
Vraj Patel
 
joins in database
 joins in database joins in database
joins in database
Sultan Arshad
 
ACID- Database Transaction Properties
ACID- Database Transaction PropertiesACID- Database Transaction Properties
ACID- Database Transaction Properties
Markajul Hasnain Alif
 
Concurrency control!
Concurrency control!Concurrency control!
Concurrency control!
Ashish K
 

What's hot (20)

Acid properties
Acid propertiesAcid properties
Acid properties
 
Concurrency control
Concurrency controlConcurrency control
Concurrency control
 
Transaction management DBMS
Transaction  management DBMSTransaction  management DBMS
Transaction management DBMS
 
Lock based protocols
Lock based protocolsLock based protocols
Lock based protocols
 
Concurrency Control Techniques
Concurrency Control TechniquesConcurrency Control Techniques
Concurrency Control Techniques
 
16. Concurrency Control in DBMS
16. Concurrency Control in DBMS16. Concurrency Control in DBMS
16. Concurrency Control in DBMS
 
Degree of relationship set
Degree of relationship setDegree of relationship set
Degree of relationship set
 
Transaction management in DBMS
Transaction management in DBMSTransaction management in DBMS
Transaction management in DBMS
 
Concurrency control
Concurrency controlConcurrency control
Concurrency control
 
Triggers
TriggersTriggers
Triggers
 
Adbms 43 multiversion concurrency control
Adbms 43 multiversion concurrency controlAdbms 43 multiversion concurrency control
Adbms 43 multiversion concurrency control
 
Databases: Concurrency Control
Databases: Concurrency ControlDatabases: Concurrency Control
Databases: Concurrency Control
 
trigger dbms
trigger dbmstrigger dbms
trigger dbms
 
SQL Server Transaction Management
SQL Server Transaction ManagementSQL Server Transaction Management
SQL Server Transaction Management
 
Adbms 36 transaction support in sql 2
Adbms 36 transaction support in sql 2Adbms 36 transaction support in sql 2
Adbms 36 transaction support in sql 2
 
Concurrency Control.
Concurrency Control.Concurrency Control.
Concurrency Control.
 
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
FUNCTION DEPENDENCY  AND TYPES & EXAMPLEFUNCTION DEPENDENCY  AND TYPES & EXAMPLE
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
 
joins in database
 joins in database joins in database
joins in database
 
ACID- Database Transaction Properties
ACID- Database Transaction PropertiesACID- Database Transaction Properties
ACID- Database Transaction Properties
 
Concurrency control!
Concurrency control!Concurrency control!
Concurrency control!
 

Similar to Transaction Serializability in DBMS

Basics of Digital Electronics
Basics of Digital ElectronicsBasics of Digital Electronics
NP-Complete Problem
NP-Complete Problem NP-Complete Problem
What Is LEX and YACC?
What Is LEX and YACC?What Is LEX and YACC?
Importance of Theory of Computations
Importance of Theory of ComputationsImportance of Theory of Computations
Importance of Theory of Computations
International Institute of Information Technology (I²IT)
 
Transaction in DBMS
Transaction in DBMSTransaction in DBMS
Transaction in DBMS
Pyingkodi Maran
 
Engineering Mathematics | Maxima and Minima
Engineering Mathematics | Maxima and MinimaEngineering Mathematics | Maxima and Minima
Engineering Mathematics | Maxima and Minima
International Institute of Information Technology (I²IT)
 
Block Diagram Reduction Techniques
Block Diagram Reduction TechniquesBlock Diagram Reduction Techniques
Conformal Mapping - Introduction & Examples
Conformal Mapping - Introduction & ExamplesConformal Mapping - Introduction & Examples
Conformal Mapping - Introduction & Examples
International Institute of Information Technology (I²IT)
 
Data Structures and Algorithm - Week 11 - Algorithm Analysis
Data Structures and Algorithm - Week 11 - Algorithm AnalysisData Structures and Algorithm - Week 11 - Algorithm Analysis
Data Structures and Algorithm - Week 11 - Algorithm Analysis
Ferdin Joe John Joseph PhD
 
AVL Tree Explained
AVL Tree ExplainedAVL Tree Explained
Transaction and serializability
Transaction and serializabilityTransaction and serializability
Transaction and serializability
Yogita Jain
 
Time Series With OrientDB - Fosdem 2015
Time Series With OrientDB - Fosdem 2015Time Series With OrientDB - Fosdem 2015
Time Series With OrientDB - Fosdem 2015
wolf4ood
 
Engineering Mathematics with Examples and Applications
Engineering Mathematics with Examples and ApplicationsEngineering Mathematics with Examples and Applications
Engineering Mathematics with Examples and Applications
International Institute of Information Technology (I²IT)
 

Similar to Transaction Serializability in DBMS (13)

Basics of Digital Electronics
Basics of Digital ElectronicsBasics of Digital Electronics
Basics of Digital Electronics
 
NP-Complete Problem
NP-Complete Problem NP-Complete Problem
NP-Complete Problem
 
What Is LEX and YACC?
What Is LEX and YACC?What Is LEX and YACC?
What Is LEX and YACC?
 
Importance of Theory of Computations
Importance of Theory of ComputationsImportance of Theory of Computations
Importance of Theory of Computations
 
Transaction in DBMS
Transaction in DBMSTransaction in DBMS
Transaction in DBMS
 
Engineering Mathematics | Maxima and Minima
Engineering Mathematics | Maxima and MinimaEngineering Mathematics | Maxima and Minima
Engineering Mathematics | Maxima and Minima
 
Block Diagram Reduction Techniques
Block Diagram Reduction TechniquesBlock Diagram Reduction Techniques
Block Diagram Reduction Techniques
 
Conformal Mapping - Introduction & Examples
Conformal Mapping - Introduction & ExamplesConformal Mapping - Introduction & Examples
Conformal Mapping - Introduction & Examples
 
Data Structures and Algorithm - Week 11 - Algorithm Analysis
Data Structures and Algorithm - Week 11 - Algorithm AnalysisData Structures and Algorithm - Week 11 - Algorithm Analysis
Data Structures and Algorithm - Week 11 - Algorithm Analysis
 
AVL Tree Explained
AVL Tree ExplainedAVL Tree Explained
AVL Tree Explained
 
Transaction and serializability
Transaction and serializabilityTransaction and serializability
Transaction and serializability
 
Time Series With OrientDB - Fosdem 2015
Time Series With OrientDB - Fosdem 2015Time Series With OrientDB - Fosdem 2015
Time Series With OrientDB - Fosdem 2015
 
Engineering Mathematics with Examples and Applications
Engineering Mathematics with Examples and ApplicationsEngineering Mathematics with Examples and Applications
Engineering Mathematics with Examples and Applications
 

More from International Institute of Information Technology (I²IT)

Minimization of DFA
Minimization of DFAMinimization of DFA
Understanding Natural Language Processing
Understanding Natural Language ProcessingUnderstanding Natural Language Processing
Understanding Natural Language Processing
International Institute of Information Technology (I²IT)
 
What Is Smart Computing?
What Is Smart Computing?What Is Smart Computing?
Professional Ethics & Etiquette: What Are They & How Do I Get Them?
Professional Ethics & Etiquette: What Are They & How Do I Get Them?Professional Ethics & Etiquette: What Are They & How Do I Get Them?
Professional Ethics & Etiquette: What Are They & How Do I Get Them?
International Institute of Information Technology (I²IT)
 
Writing Skills: Importance of Writing Skills
Writing Skills: Importance of Writing SkillsWriting Skills: Importance of Writing Skills
Writing Skills: Importance of Writing Skills
International Institute of Information Technology (I²IT)
 
Professional Communication | Introducing Oneself
Professional Communication | Introducing Oneself Professional Communication | Introducing Oneself
Professional Communication | Introducing Oneself
International Institute of Information Technology (I²IT)
 
Servlet: A Server-side Technology
Servlet: A Server-side TechnologyServlet: A Server-side Technology
What Is Jenkins? Features and How It Works
What Is Jenkins? Features and How It WorksWhat Is Jenkins? Features and How It Works
What Is Jenkins? Features and How It Works
International Institute of Information Technology (I²IT)
 
Cloud Computing
Cloud ComputingCloud Computing
Hypothesis-Testing
Hypothesis-TestingHypothesis-Testing
Data Science, Big Data, Data Analytics
Data Science, Big Data, Data AnalyticsData Science, Big Data, Data Analytics
Data Science, Big Data, Data Analytics
International Institute of Information Technology (I²IT)
 
Types of Artificial Intelligence
Types of Artificial Intelligence Types of Artificial Intelligence
Difference Between AI(Artificial Intelligence), ML(Machine Learning), DL (Dee...
Difference Between AI(Artificial Intelligence), ML(Machine Learning), DL (Dee...Difference Between AI(Artificial Intelligence), ML(Machine Learning), DL (Dee...
Difference Between AI(Artificial Intelligence), ML(Machine Learning), DL (Dee...
International Institute of Information Technology (I²IT)
 
Sentiment Analysis in Machine Learning
Sentiment Analysis in  Machine LearningSentiment Analysis in  Machine Learning
Sentiment Analysis in Machine Learning
International Institute of Information Technology (I²IT)
 
What Is Cloud Computing?
What Is Cloud Computing?What Is Cloud Computing?
Introduction To Design Pattern
Introduction To Design PatternIntroduction To Design Pattern
Java as Object Oriented Programming Language
Java as Object Oriented Programming LanguageJava as Object Oriented Programming Language
Java as Object Oriented Programming Language
International Institute of Information Technology (I²IT)
 
What Is High Performance-Computing?
What Is High Performance-Computing?What Is High Performance-Computing?
Data Visualization - How to connect Microsoft Forms to Power BI
Data Visualization - How to connect Microsoft Forms to Power BIData Visualization - How to connect Microsoft Forms to Power BI
Data Visualization - How to connect Microsoft Forms to Power BI
International Institute of Information Technology (I²IT)
 
Yoga To Fight & Win Against COVID-19
Yoga To Fight & Win Against COVID-19Yoga To Fight & Win Against COVID-19
Yoga To Fight & Win Against COVID-19
International Institute of Information Technology (I²IT)
 

More from International Institute of Information Technology (I²IT) (20)

Minimization of DFA
Minimization of DFAMinimization of DFA
Minimization of DFA
 
Understanding Natural Language Processing
Understanding Natural Language ProcessingUnderstanding Natural Language Processing
Understanding Natural Language Processing
 
What Is Smart Computing?
What Is Smart Computing?What Is Smart Computing?
What Is Smart Computing?
 
Professional Ethics & Etiquette: What Are They & How Do I Get Them?
Professional Ethics & Etiquette: What Are They & How Do I Get Them?Professional Ethics & Etiquette: What Are They & How Do I Get Them?
Professional Ethics & Etiquette: What Are They & How Do I Get Them?
 
Writing Skills: Importance of Writing Skills
Writing Skills: Importance of Writing SkillsWriting Skills: Importance of Writing Skills
Writing Skills: Importance of Writing Skills
 
Professional Communication | Introducing Oneself
Professional Communication | Introducing Oneself Professional Communication | Introducing Oneself
Professional Communication | Introducing Oneself
 
Servlet: A Server-side Technology
Servlet: A Server-side TechnologyServlet: A Server-side Technology
Servlet: A Server-side Technology
 
What Is Jenkins? Features and How It Works
What Is Jenkins? Features and How It WorksWhat Is Jenkins? Features and How It Works
What Is Jenkins? Features and How It Works
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud Computing
 
Hypothesis-Testing
Hypothesis-TestingHypothesis-Testing
Hypothesis-Testing
 
Data Science, Big Data, Data Analytics
Data Science, Big Data, Data AnalyticsData Science, Big Data, Data Analytics
Data Science, Big Data, Data Analytics
 
Types of Artificial Intelligence
Types of Artificial Intelligence Types of Artificial Intelligence
Types of Artificial Intelligence
 
Difference Between AI(Artificial Intelligence), ML(Machine Learning), DL (Dee...
Difference Between AI(Artificial Intelligence), ML(Machine Learning), DL (Dee...Difference Between AI(Artificial Intelligence), ML(Machine Learning), DL (Dee...
Difference Between AI(Artificial Intelligence), ML(Machine Learning), DL (Dee...
 
Sentiment Analysis in Machine Learning
Sentiment Analysis in  Machine LearningSentiment Analysis in  Machine Learning
Sentiment Analysis in Machine Learning
 
What Is Cloud Computing?
What Is Cloud Computing?What Is Cloud Computing?
What Is Cloud Computing?
 
Introduction To Design Pattern
Introduction To Design PatternIntroduction To Design Pattern
Introduction To Design Pattern
 
Java as Object Oriented Programming Language
Java as Object Oriented Programming LanguageJava as Object Oriented Programming Language
Java as Object Oriented Programming Language
 
What Is High Performance-Computing?
What Is High Performance-Computing?What Is High Performance-Computing?
What Is High Performance-Computing?
 
Data Visualization - How to connect Microsoft Forms to Power BI
Data Visualization - How to connect Microsoft Forms to Power BIData Visualization - How to connect Microsoft Forms to Power BI
Data Visualization - How to connect Microsoft Forms to Power BI
 
Yoga To Fight & Win Against COVID-19
Yoga To Fight & Win Against COVID-19Yoga To Fight & Win Against COVID-19
Yoga To Fight & Win Against COVID-19
 

Recently uploaded

Wearable antenna for antenna applications
Wearable antenna for antenna applicationsWearable antenna for antenna applications
Wearable antenna for antenna applications
Madhumitha Jayaram
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
VICTOR MAESTRE RAMIREZ
 
bank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdfbank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdf
Divyam548318
 
2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt
PuktoonEngr
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
IJECEIAES
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Christina Lin
 
Question paper of renewable energy sources
Question paper of renewable energy sourcesQuestion paper of renewable energy sources
Question paper of renewable energy sources
mahammadsalmanmech
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
gestioneergodomus
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
Aditya Rajan Patra
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
MIGUELANGEL966976
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
kandramariana6
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
KrishnaveniKrishnara1
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
insn4465
 
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
Mukeshwaran Balu
 
6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)
ClaraZara1
 
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
University of Maribor
 
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
awadeshbabu
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
SUTEJAS
 
Technical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prismsTechnical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prisms
heavyhaig
 

Recently uploaded (20)

Wearable antenna for antenna applications
Wearable antenna for antenna applicationsWearable antenna for antenna applications
Wearable antenna for antenna applications
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
 
bank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdfbank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdf
 
2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
 
Question paper of renewable energy sources
Question paper of renewable energy sourcesQuestion paper of renewable energy sources
Question paper of renewable energy sources
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
 
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
 
6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)
 
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
 
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
 
Technical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prismsTechnical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prisms
 

Transaction Serializability in DBMS

  • 2. HOPE FOUNDATION’S INTERNATIONAL INSTITUTE OF INFORMATION TECHNOLOGY, (I²IT) www.isquareit.edu.in +91 20 22933441 / 2
  • 3. Transaction Serializability •Basic Assumption – Each transaction preserves database consistency. •Thus serial execution of a set of transactions preserves database consistency. •A (possibly concurrent) schedule is serializable if it is equivalent to a serial schedule. •Different forms of schedule equivalence give rise to the notions of: 1. Conflict serializability 2. View serializability Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057 Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
  • 4. Conflicting Instructions • Instructions li and lj of transactions Ti and Tj respectively, conflict if and only if there exists some item Q accessed by both li and lj, and at least one of these instructions wrote Q. 1. li = read(Q), lj = read(Q). li and lj don’t conflict. 2. li = read(Q), lj = write(Q). They conflict. 3. li = write(Q),lj = read(Q). They conflict 4. li = write(Q),lj = write(Q). They conflict • Intuitively, a conflict between li and lj forces a (logical) temporal order between them. • If li and lj are consecutive in a schedule and they do not conflict, their results would remain the same even if they had been interchanged in the schedule. Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057 Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
  • 5. Conflict Serializability •If a schedule S can be transformed into a schedule S´ by a series of swaps of non-conflicting instructions, we say that S and S´ are conflict equivalent. •We say that a schedule S is conflict serializable if it is conflict equivalent to a serial schedule. Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057 Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
  • 6. Conflict Serializability • Schedule 1 can be transformed into Schedule 2, a serial schedule where T2 follows T1, by series of swaps of non-conflicting instructions. • Therefore Schedule 1 is conflict serializable. Schedule 1 Schedule 2 Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057 Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
  • 7. • Example of a schedule that is not conflict serializable: • We are unable to swap instructions in the above schedule to obtain either the serial schedule < T3, T4 >, or the serial schedule < T4, T3 >. Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057 Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
  • 8. Testing for Serializability •Consider some schedule of a set of transactions T1, T2, ..., Tn •Precedence graph — a direct graph where the vertices are the transactions (names). •We draw an arc from Ti to Tj if the two transaction conflict, and Ti accessed the data item on which the conflict arose earlier. •We may label the arc by the item that was accessed. Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057 Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
  • 9. Example Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057 Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
  • 10. How to check for Conflict serializability? • Consider the schedule • T1 | R1(X) R1(X) • T2 | R2(Y) R2(Y) W2(X) • T3 | W3(Y) • Step #1 : Check for the conflicting actions. • Two or more actions are said to be in conflict if: • 1. The actions belong to different transactions. 2. At least one of the actions is a write operation. 3. The actions access the same object (read or write). • The following set of actions is conflicting: • T1:R(X), T2:W(X), T1:R(X) Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057 Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
  • 11. • While the following sets of actions are not: • T1:R(X), T2:R(Y), T3:R(X) T1:R(X), T2:W(Y), T3:R(X) • For our example, we have a conflict on X (T1 reads it and T2 writes it). We also have a conflict on Y (T2 reads it and T3 writes it). • So it has a conflict property but is it serializable? • Step #2 : Check for a cycle in the Precedence Graph. • First, draw all the Transactions (Tx): Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057 Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in T1 T2 T3 Initial Graph
  • 12. • Check if there is a Tx that reads an item after a different Tx writes it. • We have T1 that reads X after T2 writes it, so draw arrow from T2 -> T1 • Check if there is a Tx that writes an item after a different Tx reads it. • We have T2 that writes X after T1 reads it, so draw arrow from T1 -> T2 • We also have T3 that writes Y after T2 reads it, so draw arrow from T2 -> T3 • Check if there is a Tx that writes an item after a different TX writes it. Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057 Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
  • 13. • We can see that there is a cycle between T1 and T2, so the graph is cyclic, and therefore it is not conflict serializable. Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057 Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in T1 T2 T3 Final Graph
  • 14. VIEW SERIALIZABILITY • Consider two schedules S1 and S2, where the same set of transactions participates in both schedules. The schedules S1 and S2 are said to be view equivalent if three conditions are met: • 1. If Ti reads initial value of A in S1, then Ti also reads initial value of A in S2 • 2. If Ti reads value of A written by Tj in S1, then Ti also reads value of A written by Tj in S2 • 3. If Ti writes final value of A in S1, then Ti also writes final value of A in S2 Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057 Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
  • 15. • The concept of view equivalence leads to the concept of view serializability. • We say that a schedule S is view serializable if it is view equivalent to a serial schedule. Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057 Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
  • 16. View Equivalent Schedule • Consider two schedules S1 and S2, they are said to be view equivalent if following conditions are true : • Initial read must be same. • S1 : T1 reads A from Database. S2 : T1 reads A from T2. ∴ S1 ≠ S2. Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057 Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in T1 T2 R(A) W(A) T1 T2 W(A) R(A) S1 S2
  • 17. • There are two transactions say Ti and Tj, The schedule S1 and S2 are view equivalent if in schedule S1, Ti reads A that has been updated by Tj, and in schedule S2, Ti must read A from Tj. i.e. write-read(WR) sequence must be same between S1 and S2. S1 : T3 reads value of A from T2. S2 : T3 reads value of A from T1. ∴ S1 ≠ S2. i.e. write-read sequence is not same between S1 and S2. Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057 Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in T1 T2 T3 W(A) W(A) R(A) S1 T1 T2 T3 W(A) W(A) R(A) S2
  • 18. • Final write operations should be same between S1 and S2. Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057 Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in T1 T2 T3 W1(A) R2(A) W3(A) S1 T1 T2 T3 W2(A) W3(A) R2(A) W1(A) S2 S1 : A is finally updated by T3. S2 : A is finally updated by T1. ∴ S1 ≠ S2.
  • 19. • Check whether the schedule is view serializable or not? • S : R2(B); R2(A); R1(A); R3(A); W1(B); W2(B); W3(B) • Solution: With 3 transactions, total number of schedules possible = 3! = 6 • <T1 T2 T3> • <T1 T3 T2> • <T2 T3 T1> • <T2 T1 T3> • <T3 T1 T2> • <T3 T2 T1> • Step 1 : Final Updation (Write) on data items • A : - • B : T1 T2 T3 Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057 Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
  • 20. • Since the final updation on B is made by T3, so the transaction T3 must execute before transactions T1 and T2. • Therefore, (T1,T2) → T3 • Now, Removing those schedules in which T3 is not executing at last. • Remaining Schedules : <T1 T2 T3> and <T2 T1 T3> • Step 2 : Initial Read + Which transaction updates after read? • A : T2 T1 T3 • B : T2 T1 • The transaction T2 reads B initially which is updated by T1. So T2 must execute before T1. • Hence, T2 → T1 • Now, Removing those schedules in which T2 is not executing before T1. • Remaining Schedules : <T2 T1 T3> Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057 Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
  • 21. • Step 3 : Write Read Sequence (WR) : • No need to check here. • Hence, view equivalent serial schedule is : • T2 → T1 → T3 Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057 Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
  • 22. • Check whether the schedules is View serializable or not ? • R2(A); R1(A); W1(C); R3(C); W1(B); R4(B); W3(A); R4(C); W2(D); R2(B); W4(A); W4(B) • Solution • The data items on which operations are occurring are A,B,C,D. • Step 1 : Check for Final Updation (Write) on data items • A : T3 T4 • B : T1 T4 • C : T1 • D : T2 Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057 Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
  • 23. • Since the final updation on A is made by T4, so the transaction T4 must execute after T3 transaction. • Since the final updation on B is made by T4, so the transaction T1 must execute before T3 transaction. • Dependency 1 : (T1 T3) → T4 ..... (1) • Step 2 : Initial Read • Initial Read + Which transaction updates after read? • A : T2 T1 T3 • The transaction T2 and T1 reads A initially from DB which is updated by T3. So T3 must execute after T1 and T2. • Dependency 2 : (T2 T1) → T3 ..... (2) • From (1) and (2) dependencies, another dependency can be concluded as : • Dependency 3 : (T1 T2) → T3 → T4 ..... (3) Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057 Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
  • 24. • Step 3 : Write Read Sequence (WR) : WR Seq. : Dependencies : W1(C) R3(C) T1 → T3 W1(C) R4(C) T1 → T4 W1(B) R4(B) T1 → T4 W1(B) R2(B) T1 → T2 • ⇒ T1 → (T2 T3 T4) ....(4) • From (3) and (4) dependencies, We conclude the view equivalent serial schedule is : • T1 → T2 → T3 → T4. Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057 Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
  • 25. • Check whether given schedule is view serializable. Justify your answer. • Step 1 : Check for Final Updation (Write) on data item Q • (T4, T3 ) -> T5 • DEPENDENCY : (T4 ,T3)→ T5 ……(1) Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057 Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
  • 26. • Step 2 : Initial Read • Initial Read + Which transaction updates after read? • T3 T4, T5 • The transaction T3 reads Q initially from DB which is updated by T4 & T5. So T3 must execute before T4 and T5. • Dependency 2 : T3 → (T4, T5) ..... (2) • Step 3 : Write Read Sequence (WR) • No need to check here. • From dependency (1) T4 must happen before T3 & from dependency 2 T3 must happen before T4. This results in cyclic dependency which cannot be resolved. • Hence the given schedule is not view serializable. Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057 Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in
  • 27. THANK YOU !! For further information please contact Prof. Deptii Chaudhari Department of Computer Engineering Hope Foundation’s International Institute of Information Technology, I2IT Hinjawadi, Pune – 411 057 Phone - +91 20 22933441 www.isquareit.edu.in | deptiic@isquareit.edu.in Hope Foundation’s International Institute of Information Technology, I²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057 Tel - +91 20 22933441 / 2 / 3 | Website - www.isquareit.edu.in ; Email - info@isquareit.edu.in