SlideShare a Scribd company logo
1 of 24
 When multiple transactions are being executed by the
operating system in a multiprogramming environment,
there are possibilities that instructions of one transactions
are interleaved with some other transaction.
Schedule :
 A chronological execution sequence of a transaction is called a
schedule.
 A schedule can have many transactions in it, each comprising
of a number of instructions/tasks.
Serial schedule:
 A schedule S is serial if, for every transaction T participating in
the schedule, all the operations of T are executed consecutively
in the schedule.
 Otherwise, the schedule is called non serial schedule.
Serializable schedule:
• Serializable schedules are always considered to be correct
when concurrent transactions are executing.
1. The main difference between the serial schedule and the
serializable schedule is that in serial schedule, no concurrency is
allowed whereas in serializable schedule, concurrency is
allowed.
2. In serial schedule, if there are two transaction executing at the
same time and if no interleaving of operations is permitted, then
there are only two possible outcomes :
 Execute all the operations of transaction T1 (in sequence) followed by all
the operations of transaction T2 (in sequence).
 Execute all the operations of transaction T2 (in sequence) followed by all
the operations of transaction T1 (in sequence).
In Serializable Schedule, if there are two transaction executing at
the same time and if interleaving of operations is allowed, there
will be many possible orders in which the system can execute the
individual operations of the transactions.
3. In serializable schedule, the concurrent execution of schedule
should be equal to any serial schedule so that schedules are
always considered to be correct, when transaction executions
have interleaving of their operations in the schedules.
 Let T1 transfer $50 from A to B, and T2 transfer 10% of the balance
from A to B.
 A serial schedule in which T1 is followed by T2 :
• A serial schedule where T2 is followed by T1
 Let T1 and T2 be the transactions defined previously. The following
schedule is not a serial schedule, but it is equivalent to Schedule 1.
In Schedules 1, 2 and 3, the sum A + B is preserved.
 The following concurrent schedule does not preserve the
value of (A + B ).
When are 2 schedules equivalent?
There are three types of equivalence of schedules :
•Result equivalence
•Conflict equivalence
•View equivalence
Based on the types of equivalence, we define the types of
serializability. There are accordingly three types of serializability
which are:
•Conflict serializable
•View serializable
Result Equivalence :
In results equivalence, the end result of schedules heavily depend
on input of schedules. The final values are calculated from both
schedules (given and serial) and check whether they are equal.
Result Equivalence
NOT RESULT EQUIVALENCE
 Before we discuss conflict equivalence and conflict serializable
schedule, you must know about conflicts.
 What is a conflict?
 A pair of Operations in a schedule such that if their order is
interchanged then the behavior of at least one of the transactions
may change.
 Operations are conflict, if they satisfy all three of the following
conditions :
 They belong to different transactions
 They access the same data item
 At least one of the operation is a write operation.
 Schedules are conflict equivalent if they can be
transformed one into other by a sequence of non
conflicting interchanges adjacent actions.
 A Schedule is conflict serializable if it is conflict equivalent to
any of serial schedule.
Testing for conflict serializability
Method 1 :
 First write the given schedule in a linear way.
 Find the conflict pairs (RW, WR, WW) on same variable by
different transactions.
 Whenever conflict pairs are find, write the dependency relation
like Ti → Tj, if conflict pair is from Ti to Tj. For example,
(W1(A), R2(A)) ⇒ T1 → T2
 Check to see if there is a cycle formed,
 If yes= not conflict serializable
 No= we get a sequence and hence are conflict serializable.
Method 2:
 To test the conflict serializability, we can draw a Graph G = (V,E)
where
V = Vertices = number of transactions
E = Edges = for conflicting pair
Steps :
 Create node for each transaction.
 Find the conflict pairs (RW, WR, WW) on same variable by
different transactions.
 Draw edge from the schedule for each conflict pair such that for
example, W2(B), R1(A) is conflict pair, draw edge from T2 to T1
i.e. T2 must be executed before T1.
 Testing conditions for conflict serializability of schedule
 If precedence graph is cyclic non conflict serializable schedule
 If precedence graph is a acyclic conflict serializable schedule
W2(B)
W2(B)
 Let S and S´ be two schedules with the same set of transactions. S and S´ are
view equivalent if the following three conditions are met, for each data item
Q,
1. If in schedule S, transaction Ti reads the initial value of Q, then in
schedule S’ also transaction Ti must read the initial value of Q.
2. If in schedule S transaction Ti executes read(Q), and that value was
produced by transaction Tj (if any), then in schedule S’ also transaction
Ti must read the value of Q that was produced by the same write(Q)
operation of transaction Tj .
3. The transaction (if any) that performs the final write(Q) operation in
schedule S must also perform the final write(Q) operation in schedule S’.
As can be seen, view equivalence is also based purely on reads and writes alone.
 A schedule S is view serializable if it is view equivalent to a
serial schedule.
 Every conflict serializable schedule is also view serializable.
 Below is a schedule which is view-serializable but not conflict
serializable.
 What serial schedule is above equivalent to?
 Every view serializable schedule that is not conflict serializable
has blind writes.

More Related Content

What's hot

17. Recovery System in DBMS
17. Recovery System in DBMS17. Recovery System in DBMS
17. Recovery System in DBMSkoolkampus
 
Log based and Recovery with concurrent transaction
Log based and Recovery with concurrent transactionLog based and Recovery with concurrent transaction
Log based and Recovery with concurrent transactionnikunjandy
 
11. Storage and File Structure in DBMS
11. Storage and File Structure in DBMS11. Storage and File Structure in DBMS
11. Storage and File Structure in DBMSkoolkampus
 
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
FUNCTION DEPENDENCY  AND TYPES & EXAMPLEFUNCTION DEPENDENCY  AND TYPES & EXAMPLE
FUNCTION DEPENDENCY AND TYPES & EXAMPLEVraj Patel
 
Transaction management in DBMS
Transaction management in DBMSTransaction management in DBMS
Transaction management in DBMSMegha Sharma
 
Transaction management
Transaction managementTransaction management
Transaction managementrenuka_a
 
Transactions in dbms
Transactions in dbmsTransactions in dbms
Transactions in dbmsNancy Gulati
 
Additional Relational Algebra Operations
Additional Relational Algebra OperationsAdditional Relational Algebra Operations
Additional Relational Algebra OperationsA. S. M. Shafi
 
Graph representation
Graph representationGraph representation
Graph representationTech_MX
 
Symbol table in compiler Design
Symbol table in compiler DesignSymbol table in compiler Design
Symbol table in compiler DesignKuppusamy P
 
13. Query Processing in DBMS
13. Query Processing in DBMS13. Query Processing in DBMS
13. Query Processing in DBMSkoolkampus
 
Concurrent transactions
Concurrent transactionsConcurrent transactions
Concurrent transactionsSajan Sahu
 
Presentation on Segmentation
Presentation on SegmentationPresentation on Segmentation
Presentation on SegmentationPriyanka bisht
 

What's hot (20)

17. Recovery System in DBMS
17. Recovery System in DBMS17. Recovery System in DBMS
17. Recovery System in DBMS
 
Log based and Recovery with concurrent transaction
Log based and Recovery with concurrent transactionLog based and Recovery with concurrent transaction
Log based and Recovery with concurrent transaction
 
11. Storage and File Structure in DBMS
11. Storage and File Structure in DBMS11. Storage and File Structure in DBMS
11. Storage and File Structure in DBMS
 
DBMS - RAID
DBMS - RAIDDBMS - RAID
DBMS - RAID
 
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
FUNCTION DEPENDENCY  AND TYPES & EXAMPLEFUNCTION DEPENDENCY  AND TYPES & EXAMPLE
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
 
Transaction management in DBMS
Transaction management in DBMSTransaction management in DBMS
Transaction management in DBMS
 
Graph traversals in Data Structures
Graph traversals in Data StructuresGraph traversals in Data Structures
Graph traversals in Data Structures
 
Transaction management
Transaction managementTransaction management
Transaction management
 
Transactions in dbms
Transactions in dbmsTransactions in dbms
Transactions in dbms
 
Concurrency control
Concurrency controlConcurrency control
Concurrency control
 
Additional Relational Algebra Operations
Additional Relational Algebra OperationsAdditional Relational Algebra Operations
Additional Relational Algebra Operations
 
Graph representation
Graph representationGraph representation
Graph representation
 
Hashing
HashingHashing
Hashing
 
Measures of query cost
Measures of query costMeasures of query cost
Measures of query cost
 
Symbol table in compiler Design
Symbol table in compiler DesignSymbol table in compiler Design
Symbol table in compiler Design
 
13. Query Processing in DBMS
13. Query Processing in DBMS13. Query Processing in DBMS
13. Query Processing in DBMS
 
Acid properties
Acid propertiesAcid properties
Acid properties
 
Database System Architectures
Database System ArchitecturesDatabase System Architectures
Database System Architectures
 
Concurrent transactions
Concurrent transactionsConcurrent transactions
Concurrent transactions
 
Presentation on Segmentation
Presentation on SegmentationPresentation on Segmentation
Presentation on Segmentation
 

Similar to serializability in dbms

Similar to serializability in dbms (20)

20.SCHEDULES.ppt
20.SCHEDULES.ppt20.SCHEDULES.ppt
20.SCHEDULES.ppt
 
Unit-IV_transaction.pptx
Unit-IV_transaction.pptxUnit-IV_transaction.pptx
Unit-IV_transaction.pptx
 
Ch15 3717
Ch15 3717Ch15 3717
Ch15 3717
 
Ch15 3717
Ch15 3717Ch15 3717
Ch15 3717
 
Chapter17
Chapter17Chapter17
Chapter17
 
Transaction and serializability
Transaction and serializabilityTransaction and serializability
Transaction and serializability
 
Dbms seminar
Dbms seminarDbms seminar
Dbms seminar
 
Concurrent Transactions.ppt
Concurrent Transactions.pptConcurrent Transactions.ppt
Concurrent Transactions.ppt
 
UNIT 2- TRANSACTION CONCEPTS AND CONCURRENCY CONCEPTS (1).pdf
UNIT 2- TRANSACTION CONCEPTS AND CONCURRENCY CONCEPTS (1).pdfUNIT 2- TRANSACTION CONCEPTS AND CONCURRENCY CONCEPTS (1).pdf
UNIT 2- TRANSACTION CONCEPTS AND CONCURRENCY CONCEPTS (1).pdf
 
unit06-dbms-new.ppt
unit06-dbms-new.pptunit06-dbms-new.ppt
unit06-dbms-new.ppt
 
Ch15
Ch15Ch15
Ch15
 
Transactions.pptx
Transactions.pptxTransactions.pptx
Transactions.pptx
 
concurrencycontrol_databasemanagement_system
concurrencycontrol_databasemanagement_systemconcurrencycontrol_databasemanagement_system
concurrencycontrol_databasemanagement_system
 
Question answer
Question answerQuestion answer
Question answer
 
24904 lecture11
24904 lecture1124904 lecture11
24904 lecture11
 
unit 4.pptx
unit 4.pptxunit 4.pptx
unit 4.pptx
 
dbms sanat ppt.pdf
dbms sanat ppt.pdfdbms sanat ppt.pdf
dbms sanat ppt.pdf
 
Concurrency control and Serializability
Concurrency control and SerializabilityConcurrency control and Serializability
Concurrency control and Serializability
 
Cs501 transaction
Cs501 transactionCs501 transaction
Cs501 transaction
 
Unit06 dbms
Unit06 dbmsUnit06 dbms
Unit06 dbms
 

More from Saranya Natarajan

More from Saranya Natarajan (9)

cns unit 1.pptx
cns unit 1.pptxcns unit 1.pptx
cns unit 1.pptx
 
Asymptotic notation
Asymptotic notationAsymptotic notation
Asymptotic notation
 
Fundamentals of the Analysis of Algorithm Efficiency
Fundamentals of the Analysis of Algorithm EfficiencyFundamentals of the Analysis of Algorithm Efficiency
Fundamentals of the Analysis of Algorithm Efficiency
 
mutidimensional database
mutidimensional databasemutidimensional database
mutidimensional database
 
ER-Model-ER Diagram
ER-Model-ER DiagramER-Model-ER Diagram
ER-Model-ER Diagram
 
embedded-static-&dynamic
embedded-static-&dynamicembedded-static-&dynamic
embedded-static-&dynamic
 
Query-porcessing-& Query optimization
Query-porcessing-& Query optimizationQuery-porcessing-& Query optimization
Query-porcessing-& Query optimization
 
concurrency-control
concurrency-controlconcurrency-control
concurrency-control
 
deadlock
deadlockdeadlock
deadlock
 

Recently uploaded

Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAbhinavSharma374939
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 

Recently uploaded (20)

Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog Converter
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 

serializability in dbms

  • 1.
  • 2.  When multiple transactions are being executed by the operating system in a multiprogramming environment, there are possibilities that instructions of one transactions are interleaved with some other transaction.
  • 3. Schedule :  A chronological execution sequence of a transaction is called a schedule.  A schedule can have many transactions in it, each comprising of a number of instructions/tasks. Serial schedule:  A schedule S is serial if, for every transaction T participating in the schedule, all the operations of T are executed consecutively in the schedule.  Otherwise, the schedule is called non serial schedule. Serializable schedule: • Serializable schedules are always considered to be correct when concurrent transactions are executing.
  • 4. 1. The main difference between the serial schedule and the serializable schedule is that in serial schedule, no concurrency is allowed whereas in serializable schedule, concurrency is allowed. 2. In serial schedule, if there are two transaction executing at the same time and if no interleaving of operations is permitted, then there are only two possible outcomes :  Execute all the operations of transaction T1 (in sequence) followed by all the operations of transaction T2 (in sequence).  Execute all the operations of transaction T2 (in sequence) followed by all the operations of transaction T1 (in sequence). In Serializable Schedule, if there are two transaction executing at the same time and if interleaving of operations is allowed, there will be many possible orders in which the system can execute the individual operations of the transactions.
  • 5. 3. In serializable schedule, the concurrent execution of schedule should be equal to any serial schedule so that schedules are always considered to be correct, when transaction executions have interleaving of their operations in the schedules.
  • 6.  Let T1 transfer $50 from A to B, and T2 transfer 10% of the balance from A to B.  A serial schedule in which T1 is followed by T2 :
  • 7. • A serial schedule where T2 is followed by T1
  • 8.  Let T1 and T2 be the transactions defined previously. The following schedule is not a serial schedule, but it is equivalent to Schedule 1. In Schedules 1, 2 and 3, the sum A + B is preserved.
  • 9.  The following concurrent schedule does not preserve the value of (A + B ).
  • 10. When are 2 schedules equivalent? There are three types of equivalence of schedules : •Result equivalence •Conflict equivalence •View equivalence Based on the types of equivalence, we define the types of serializability. There are accordingly three types of serializability which are: •Conflict serializable •View serializable Result Equivalence : In results equivalence, the end result of schedules heavily depend on input of schedules. The final values are calculated from both schedules (given and serial) and check whether they are equal.
  • 12.  Before we discuss conflict equivalence and conflict serializable schedule, you must know about conflicts.  What is a conflict?  A pair of Operations in a schedule such that if their order is interchanged then the behavior of at least one of the transactions may change.  Operations are conflict, if they satisfy all three of the following conditions :  They belong to different transactions  They access the same data item  At least one of the operation is a write operation.
  • 13.
  • 14.
  • 15.  Schedules are conflict equivalent if they can be transformed one into other by a sequence of non conflicting interchanges adjacent actions.
  • 16.
  • 17.  A Schedule is conflict serializable if it is conflict equivalent to any of serial schedule. Testing for conflict serializability Method 1 :  First write the given schedule in a linear way.  Find the conflict pairs (RW, WR, WW) on same variable by different transactions.  Whenever conflict pairs are find, write the dependency relation like Ti → Tj, if conflict pair is from Ti to Tj. For example, (W1(A), R2(A)) ⇒ T1 → T2  Check to see if there is a cycle formed,  If yes= not conflict serializable  No= we get a sequence and hence are conflict serializable.
  • 18.
  • 19.
  • 20. Method 2:  To test the conflict serializability, we can draw a Graph G = (V,E) where V = Vertices = number of transactions E = Edges = for conflicting pair Steps :  Create node for each transaction.  Find the conflict pairs (RW, WR, WW) on same variable by different transactions.  Draw edge from the schedule for each conflict pair such that for example, W2(B), R1(A) is conflict pair, draw edge from T2 to T1 i.e. T2 must be executed before T1.  Testing conditions for conflict serializability of schedule  If precedence graph is cyclic non conflict serializable schedule  If precedence graph is a acyclic conflict serializable schedule
  • 21. W2(B)
  • 22. W2(B)
  • 23.  Let S and S´ be two schedules with the same set of transactions. S and S´ are view equivalent if the following three conditions are met, for each data item Q, 1. If in schedule S, transaction Ti reads the initial value of Q, then in schedule S’ also transaction Ti must read the initial value of Q. 2. If in schedule S transaction Ti executes read(Q), and that value was produced by transaction Tj (if any), then in schedule S’ also transaction Ti must read the value of Q that was produced by the same write(Q) operation of transaction Tj . 3. The transaction (if any) that performs the final write(Q) operation in schedule S must also perform the final write(Q) operation in schedule S’. As can be seen, view equivalence is also based purely on reads and writes alone.
  • 24.  A schedule S is view serializable if it is view equivalent to a serial schedule.  Every conflict serializable schedule is also view serializable.  Below is a schedule which is view-serializable but not conflict serializable.  What serial schedule is above equivalent to?  Every view serializable schedule that is not conflict serializable has blind writes.