SlideShare uma empresa Scribd logo
1 de 11
Transaction
Processing
Question answer
What is meant by the concurrent execution of database transactions in
a
multiuser system? Discuss why concurrency control is needed, and
give
informal examples.
Concurrent execution of database transactions in a multi-user system means that any number of users can use the same database at the same time.
Concurrency control is needed in order to avoid inconsistencies in the database.
Here is an example of how this scenario can lead to an inconsistency:
Assume we have two users, Alice and Bob, who both have access to the same bank account. Alice wants to deposit $100 and Bob wants to withdraw
$200. Assuming there is $500 in the account, here is how the execution might take place if they perform their actions at the same time:
1. Alice gets initial amount (x = $500)
2. Bob gets initial amount (x = $500)
3. Alice deposits $100 (x + 100) = $600
4. Bob withdraws $200 (x - 200) = $300
5. Alice saves the new balance ($600)
6. Bob saves the new balance ($300)
New balance after both actions should be $400. Now the database is in an inconsistent state.
Concurrency control can prevent inconsistencies by providing Alice with a temporary "lock" on the database until she is done with her action.
Discuss the different types of failures.
What is meant by catastrophic
failure?
Failures are generally classified as transaction, system, and
media failures. There are several possible reasons for a
transaction to fail in the middle of execution:
 System crash – A hardware, software, or network error
occurs in the computer system during transaction
execution. Hardware crashes are usually media failures.
 A transaction or system error – Some operation in the
transaction may cause it to fail, such as integer overflow or
division by zero.
 Local errors or exception conditions detected by the
transaction – During transaction execution,...
 Catastrophic failure is a complete, sudden, often
unexpected breakdown in a machine, electronic
system, computer or network. Such a breakdown may
occur as a result of a hardware event such as a disk drive
crash, memory chip failure or surge on the power line.
What is a schedule (history)? Define the concepts of recoverable,
cascadeless,
and strict schedules, and compare them in terms of their
recoverability.
 A schedule (or history) of a system is an abstract model to describe execution of
transactions running in the system. Often it is a list of operations (actions) ordered by
time, performed by a set of transactions that are executed together in the system. If
order in time between certain operations is not determined by the system, then a
partial order is used. Examples of such operations are requesting a read operation,
reading, writing, aborting, committing, requesting lock, locking, etc. Not all
transaction operation types should be included in a schedule, and typically only
selected operation types (e.g., data access operations) are included, as needed to
reason about and describe certain phenomena. Schedules and schedule properties are
fundamental concepts in database concurrency control theory.
 A schedule S of n transaction T1,T2,T3...Tr. is an ordering of the operations of the
transaction subject to the constraint that, for each transaction T1 that participates in S,
the operations of Ti in S must appear in the same order in which they occur in Ti.
 If we can ensure that s transaction T, when committed, never has to roll back, then we
have a demarcation between recoverable and non-recoverable schedules. Schedules
determains as non-recoverable should not be permitted.Among the recoverable
schedules, transaction failures generates a spectrum of recoverability, from easy to
complex.
Discuss the different measures of transaction equivalence. What is the
difference
between conflict equivalence and view equivalence?
S.No. Conflict Serializability View Serializability
1.
Two schedules are said to be conflict equivalent if all the
conflicting operations in both the schedule get executed in the
same order. If a schedule is a conflict equivalent to its serial
schedule then it is called Conflict Serializable Schedule.
Two schedules are said to be view
equivalent if the order of initial read,
final write and update operations is
the same in both the schedules. If a
schedule is view equivalent to its
serial schedule then it is called View
Serializable Schedule.
2.
If a schedule is view serializable then it may or may not be conflict
serializable.
If a schedule is conflict serializable
then it is also view serializable
schedule.
3.
Conflict equivalence can be easily achieved by reordering the
operations of two transactions therefore, Conflict Serializability is
easy to achieve.
Viewequivalence is rather difficult to
achieve as both transactions should
perform similar actions in a similar
manner. Thus, View Serializability is
difficult to achieve.
4.
For a transaction T1 writing a value A that no one else reads but
later some other transactions say T2 write its own value of A,
W(A) cannot be placed under positions where it is never read.
If a transaction T1 writes a value A
that no other transaction reads
(because later some other
transactions say T2 writes its own
value of A) W(A) can be placed in
positions of the schedule where it is
never read.
Discuss how serializability is used to enforce concurrency control in a
database
system. Why is serializability sometimes considered too restrictive as a
measure of correctness for schedules?
A concurrency control is said to be serializable if the
final result of that schedule istotally same as the final
result given by the serial schedule. So in executing
transaction it will be allowed to access multiple
transaction with the DBMS in orders to enhance the
efficiency and the maximum usability of the
resources. But it should give the same result for
particular transaction, otherwise it is useless. So
through serializability it will lead to the same final
outcome...
Conflict Serializability in DBMS
As discussed in Concurrency control, serial schedules have
less resource utilization and low throughput. To improve it,
two or more transactions are run concurrently. But
concurrency of transactions may lead to inconsistency in
database. To avoid this, we need to check whether these
concurrent schedules are serializable or not.
 Conflict Serializable: A schedule is called conflict
serializable if it can be transformed into a serial schedule by
swapping non-conflicting operations.
 Conflicting operations: Two operations are said to be
conflicting if all conditions satisfy:
1. They belong to different transactions
2. They operate on the same data item
3. At Least one of them is a write operation
Example: –
 Conflicting operations pair (R1(A), W2(A))
because they belong to two different transactions
on same data item A and one of them is write
operation.
 Similarly, (W1(A), W2(A)) and (W1(A), R2(A)) pairs
are also conflicting.
 On the other hand, (R1(A), W2(B)) pair is non-
conflicting because they operate on different
data item.
 Similarly, ((W1(A), W2(B)) pair is non-conflicting.
Consider the following schedule:
 S1: R1(A), W1(A), R2(A), W2(A), R1(B), W1(B), R2(B),
W2(B)
If Oi and Oj are two operations in a transaction and Oi< Oj (Oi is executed
before Oj), same order will follow in the schedule as well. Using this
property, we can get two transactions of schedule S1 as:
T1: R1(A), W1(A), R1(B), W1(B)
T2: R2(A), W2(A), R2(B), W2(B)
Possible Serial Schedules are: T1->T2 or T2->T1
-> Swapping non-conflicting operations R2(A) and R1(B) in S1, the schedule becomes,
S11: R1(A), W1(A), R1(B), W2(A), R2(A), W1(B), R2(B), W2(B)
-> Similarly, swapping non-conflicting operations W2(A) and W1(B) in S11, the schedule becomes,
S12: R1(A), W1(A), R1(B), W1(B), R2(A), W2(A), R2(B), W2(B)
S12 is a serial schedule in which all operations of T1 are performed before starting any operation of T2. Since S has
been transformed into a serial schedule S12 by swapping non-conflicting operations of S1, S1 is conflict serializable.
 Let us take another Schedule:
S2: R2(A), W2(A), R1(A), W1(A), R1(B), W1(B),
R2(B), W2(B) Two transactions will be:
T1: R1(A), W1(A), R1(B), W1(B)
T2: R2(A), W2(A), R2(B), W2(B)
Possible Serial Schedules are: T1->T2 or T2->T1
Original Schedule is:
S2: R2(A), W2(A), R1(A), W1(A), R1(B), W1(B), R2(B), W2(B)
Swapping non-conflicting operations R1(A) and R2(B) in S2, the schedule becomes,
S21: R2(A), W2(A), R2(B), W1(A), R1(B), W1(B), R1(A), W2(B)
Similarly, swapping non-conflicting operations W1(A) and W2(B) in S21, the schedule becomes,
S22: R2(A), W2(A), R2(B), W2(B), R1(B), W1(B), R1(A), W1(A)
In schedule S22, all operations of T2 are performed first, but operations of T1 are not in order
(order should be R1(A), W1(A), R1(B), W1(B)). So S2 is not conflict serializable.
Conflict Equivalent: Two schedules are said to be
conflict equivalent when one can be transformed to
another by swapping non-conflicting operations. In the
example discussed above, S11 is conflict equivalent
to S1 (S1 can be converted to S11 by swapping non-
conflicting operations). Similarly, S11 is conflict
equivalent to S12 and so on.
 Note 1: Although S2 is not conflict serializable, but
still it is conflict equivalent to S21 and S21 because
S2 can be converted to S21 and S22 by swapping
non-conflicting operations.
 Note 2: The schedule which is conflict serializable is
always conflict equivalent to one of the serial
schedule. S1 schedule discussed above (which is
conflict serializable) is equivalent to serial schedule
(T1->T2).

Mais conteúdo relacionado

Mais procurados

Dinive conquer algorithm
Dinive conquer algorithmDinive conquer algorithm
Dinive conquer algorithm
Mohd Arif
 
Cache memory
Cache memoryCache memory
Cache memory
Anuj Modi
 

Mais procurados (20)

Grasp patterns and its types
Grasp patterns and its typesGrasp patterns and its types
Grasp patterns and its types
 
Chapter 5 Database Transaction Management
Chapter 5 Database Transaction ManagementChapter 5 Database Transaction Management
Chapter 5 Database Transaction Management
 
Transaction states and properties
Transaction states and propertiesTransaction states and properties
Transaction states and properties
 
Dinive conquer algorithm
Dinive conquer algorithmDinive conquer algorithm
Dinive conquer algorithm
 
Token, Pattern and Lexeme
Token, Pattern and LexemeToken, Pattern and Lexeme
Token, Pattern and Lexeme
 
Message passing ( in computer science)
Message   passing  ( in   computer  science)Message   passing  ( in   computer  science)
Message passing ( in computer science)
 
object oriented methodologies
object oriented methodologiesobject oriented methodologies
object oriented methodologies
 
Measures of query cost
Measures of query costMeasures of query cost
Measures of query cost
 
4. block coding
4. block coding 4. block coding
4. block coding
 
Lock based protocols
Lock based protocolsLock based protocols
Lock based protocols
 
Network layer tanenbaum
Network layer tanenbaumNetwork layer tanenbaum
Network layer tanenbaum
 
Data transfer and manipulation
Data transfer and manipulationData transfer and manipulation
Data transfer and manipulation
 
Input-Buffering
Input-BufferingInput-Buffering
Input-Buffering
 
Network Layer,Computer Networks
Network Layer,Computer NetworksNetwork Layer,Computer Networks
Network Layer,Computer Networks
 
Register allocation and assignment
Register allocation and assignmentRegister allocation and assignment
Register allocation and assignment
 
Query processing in Distributed Database System
Query processing in Distributed Database SystemQuery processing in Distributed Database System
Query processing in Distributed Database System
 
Computer architecture pipelining
Computer architecture pipeliningComputer architecture pipelining
Computer architecture pipelining
 
Single pass assembler
Single pass assemblerSingle pass assembler
Single pass assembler
 
Cache memory
Cache memoryCache memory
Cache memory
 
Instruction pipeline: Computer Architecture
Instruction pipeline: Computer ArchitectureInstruction pipeline: Computer Architecture
Instruction pipeline: Computer Architecture
 

Semelhante a Question answer

Unit 5 - PPT.pdf DBMS SRM university chennai
Unit 5 - PPT.pdf DBMS SRM university chennaiUnit 5 - PPT.pdf DBMS SRM university chennai
Unit 5 - PPT.pdf DBMS SRM university chennai
PriyanshuJha69
 
Transaction management
Transaction managementTransaction management
Transaction management
renuka_a
 

Semelhante a Question answer (20)

24904 lecture11
24904 lecture1124904 lecture11
24904 lecture11
 
Ch15
Ch15Ch15
Ch15
 
Ch15 3717
Ch15 3717Ch15 3717
Ch15 3717
 
Ch15 3717
Ch15 3717Ch15 3717
Ch15 3717
 
Unit06 dbms
Unit06 dbmsUnit06 dbms
Unit06 dbms
 
Transactions in dbms
Transactions in dbmsTransactions in dbms
Transactions in dbms
 
Unit 5 - PPT.pdf DBMS SRM university chennai
Unit 5 - PPT.pdf DBMS SRM university chennaiUnit 5 - PPT.pdf DBMS SRM university chennai
Unit 5 - PPT.pdf DBMS SRM university chennai
 
Transaction management
Transaction managementTransaction management
Transaction management
 
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
 
UNIT-IV: Transaction Processing Concepts
UNIT-IV: Transaction Processing ConceptsUNIT-IV: Transaction Processing Concepts
UNIT-IV: Transaction Processing Concepts
 
TRANSACTION MANAGEMENT AND TIME STAMP PROTOCOLS AND BACKUP RECOVERY
TRANSACTION MANAGEMENT AND TIME STAMP PROTOCOLS AND BACKUP RECOVERYTRANSACTION MANAGEMENT AND TIME STAMP PROTOCOLS AND BACKUP RECOVERY
TRANSACTION MANAGEMENT AND TIME STAMP PROTOCOLS AND BACKUP RECOVERY
 
dbms sanat ppt.pdf
dbms sanat ppt.pdfdbms sanat ppt.pdf
dbms sanat ppt.pdf
 
Distributed Database Design and Relational Query Language
Distributed Database Design and Relational Query LanguageDistributed Database Design and Relational Query Language
Distributed Database Design and Relational Query Language
 
Transaction and serializability
Transaction and serializabilityTransaction and serializability
Transaction and serializability
 
Chapter17
Chapter17Chapter17
Chapter17
 
Cs501 transaction
Cs501 transactionCs501 transaction
Cs501 transaction
 
Introduction to database-Transaction Concurrency and Recovery
Introduction to database-Transaction Concurrency and RecoveryIntroduction to database-Transaction Concurrency and Recovery
Introduction to database-Transaction Concurrency and Recovery
 
Tybsc cs dbms2 notes
Tybsc cs dbms2 notesTybsc cs dbms2 notes
Tybsc cs dbms2 notes
 
Unit-IV_transaction.pptx
Unit-IV_transaction.pptxUnit-IV_transaction.pptx
Unit-IV_transaction.pptx
 
20.SCHEDULES.ppt
20.SCHEDULES.ppt20.SCHEDULES.ppt
20.SCHEDULES.ppt
 

Mais de vishal choudhary

Mais de vishal choudhary (20)

SE-Lecture1.ppt
SE-Lecture1.pptSE-Lecture1.ppt
SE-Lecture1.ppt
 
SE-Testing.ppt
SE-Testing.pptSE-Testing.ppt
SE-Testing.ppt
 
SE-CyclomaticComplexityand Testing.ppt
SE-CyclomaticComplexityand Testing.pptSE-CyclomaticComplexityand Testing.ppt
SE-CyclomaticComplexityand Testing.ppt
 
SE-Lecture-7.pptx
SE-Lecture-7.pptxSE-Lecture-7.pptx
SE-Lecture-7.pptx
 
Se-Lecture-6.ppt
Se-Lecture-6.pptSe-Lecture-6.ppt
Se-Lecture-6.ppt
 
SE-Lecture-5.pptx
SE-Lecture-5.pptxSE-Lecture-5.pptx
SE-Lecture-5.pptx
 
XML.pptx
XML.pptxXML.pptx
XML.pptx
 
SE-Lecture-8.pptx
SE-Lecture-8.pptxSE-Lecture-8.pptx
SE-Lecture-8.pptx
 
SE-coupling and cohesion.ppt
SE-coupling and cohesion.pptSE-coupling and cohesion.ppt
SE-coupling and cohesion.ppt
 
SE-Lecture-2.pptx
SE-Lecture-2.pptxSE-Lecture-2.pptx
SE-Lecture-2.pptx
 
SE-software design.ppt
SE-software design.pptSE-software design.ppt
SE-software design.ppt
 
SE1.ppt
SE1.pptSE1.ppt
SE1.ppt
 
SE-Lecture-4.pptx
SE-Lecture-4.pptxSE-Lecture-4.pptx
SE-Lecture-4.pptx
 
SE-Lecture=3.pptx
SE-Lecture=3.pptxSE-Lecture=3.pptx
SE-Lecture=3.pptx
 
Multimedia-Lecture-Animation.pptx
Multimedia-Lecture-Animation.pptxMultimedia-Lecture-Animation.pptx
Multimedia-Lecture-Animation.pptx
 
MultimediaLecture5.pptx
MultimediaLecture5.pptxMultimediaLecture5.pptx
MultimediaLecture5.pptx
 
Multimedia-Lecture-7.pptx
Multimedia-Lecture-7.pptxMultimedia-Lecture-7.pptx
Multimedia-Lecture-7.pptx
 
MultiMedia-Lecture-4.pptx
MultiMedia-Lecture-4.pptxMultiMedia-Lecture-4.pptx
MultiMedia-Lecture-4.pptx
 
Multimedia-Lecture-6.pptx
Multimedia-Lecture-6.pptxMultimedia-Lecture-6.pptx
Multimedia-Lecture-6.pptx
 
Multimedia-Lecture-3.pptx
Multimedia-Lecture-3.pptxMultimedia-Lecture-3.pptx
Multimedia-Lecture-3.pptx
 

Último

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Último (20)

How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 

Question answer

  • 2. What is meant by the concurrent execution of database transactions in a multiuser system? Discuss why concurrency control is needed, and give informal examples. Concurrent execution of database transactions in a multi-user system means that any number of users can use the same database at the same time. Concurrency control is needed in order to avoid inconsistencies in the database. Here is an example of how this scenario can lead to an inconsistency: Assume we have two users, Alice and Bob, who both have access to the same bank account. Alice wants to deposit $100 and Bob wants to withdraw $200. Assuming there is $500 in the account, here is how the execution might take place if they perform their actions at the same time: 1. Alice gets initial amount (x = $500) 2. Bob gets initial amount (x = $500) 3. Alice deposits $100 (x + 100) = $600 4. Bob withdraws $200 (x - 200) = $300 5. Alice saves the new balance ($600) 6. Bob saves the new balance ($300) New balance after both actions should be $400. Now the database is in an inconsistent state. Concurrency control can prevent inconsistencies by providing Alice with a temporary "lock" on the database until she is done with her action.
  • 3. Discuss the different types of failures. What is meant by catastrophic failure? Failures are generally classified as transaction, system, and media failures. There are several possible reasons for a transaction to fail in the middle of execution:  System crash – A hardware, software, or network error occurs in the computer system during transaction execution. Hardware crashes are usually media failures.  A transaction or system error – Some operation in the transaction may cause it to fail, such as integer overflow or division by zero.  Local errors or exception conditions detected by the transaction – During transaction execution,...  Catastrophic failure is a complete, sudden, often unexpected breakdown in a machine, electronic system, computer or network. Such a breakdown may occur as a result of a hardware event such as a disk drive crash, memory chip failure or surge on the power line.
  • 4. What is a schedule (history)? Define the concepts of recoverable, cascadeless, and strict schedules, and compare them in terms of their recoverability.  A schedule (or history) of a system is an abstract model to describe execution of transactions running in the system. Often it is a list of operations (actions) ordered by time, performed by a set of transactions that are executed together in the system. If order in time between certain operations is not determined by the system, then a partial order is used. Examples of such operations are requesting a read operation, reading, writing, aborting, committing, requesting lock, locking, etc. Not all transaction operation types should be included in a schedule, and typically only selected operation types (e.g., data access operations) are included, as needed to reason about and describe certain phenomena. Schedules and schedule properties are fundamental concepts in database concurrency control theory.  A schedule S of n transaction T1,T2,T3...Tr. is an ordering of the operations of the transaction subject to the constraint that, for each transaction T1 that participates in S, the operations of Ti in S must appear in the same order in which they occur in Ti.  If we can ensure that s transaction T, when committed, never has to roll back, then we have a demarcation between recoverable and non-recoverable schedules. Schedules determains as non-recoverable should not be permitted.Among the recoverable schedules, transaction failures generates a spectrum of recoverability, from easy to complex.
  • 5. Discuss the different measures of transaction equivalence. What is the difference between conflict equivalence and view equivalence? S.No. Conflict Serializability View Serializability 1. Two schedules are said to be conflict equivalent if all the conflicting operations in both the schedule get executed in the same order. If a schedule is a conflict equivalent to its serial schedule then it is called Conflict Serializable Schedule. Two schedules are said to be view equivalent if the order of initial read, final write and update operations is the same in both the schedules. If a schedule is view equivalent to its serial schedule then it is called View Serializable Schedule. 2. If a schedule is view serializable then it may or may not be conflict serializable. If a schedule is conflict serializable then it is also view serializable schedule. 3. Conflict equivalence can be easily achieved by reordering the operations of two transactions therefore, Conflict Serializability is easy to achieve. Viewequivalence is rather difficult to achieve as both transactions should perform similar actions in a similar manner. Thus, View Serializability is difficult to achieve. 4. For a transaction T1 writing a value A that no one else reads but later some other transactions say T2 write its own value of A, W(A) cannot be placed under positions where it is never read. If a transaction T1 writes a value A that no other transaction reads (because later some other transactions say T2 writes its own value of A) W(A) can be placed in positions of the schedule where it is never read.
  • 6. Discuss how serializability is used to enforce concurrency control in a database system. Why is serializability sometimes considered too restrictive as a measure of correctness for schedules? A concurrency control is said to be serializable if the final result of that schedule istotally same as the final result given by the serial schedule. So in executing transaction it will be allowed to access multiple transaction with the DBMS in orders to enhance the efficiency and the maximum usability of the resources. But it should give the same result for particular transaction, otherwise it is useless. So through serializability it will lead to the same final outcome...
  • 7. Conflict Serializability in DBMS As discussed in Concurrency control, serial schedules have less resource utilization and low throughput. To improve it, two or more transactions are run concurrently. But concurrency of transactions may lead to inconsistency in database. To avoid this, we need to check whether these concurrent schedules are serializable or not.  Conflict Serializable: A schedule is called conflict serializable if it can be transformed into a serial schedule by swapping non-conflicting operations.  Conflicting operations: Two operations are said to be conflicting if all conditions satisfy: 1. They belong to different transactions 2. They operate on the same data item 3. At Least one of them is a write operation
  • 8. Example: –  Conflicting operations pair (R1(A), W2(A)) because they belong to two different transactions on same data item A and one of them is write operation.  Similarly, (W1(A), W2(A)) and (W1(A), R2(A)) pairs are also conflicting.  On the other hand, (R1(A), W2(B)) pair is non- conflicting because they operate on different data item.  Similarly, ((W1(A), W2(B)) pair is non-conflicting.
  • 9. Consider the following schedule:  S1: R1(A), W1(A), R2(A), W2(A), R1(B), W1(B), R2(B), W2(B) If Oi and Oj are two operations in a transaction and Oi< Oj (Oi is executed before Oj), same order will follow in the schedule as well. Using this property, we can get two transactions of schedule S1 as: T1: R1(A), W1(A), R1(B), W1(B) T2: R2(A), W2(A), R2(B), W2(B) Possible Serial Schedules are: T1->T2 or T2->T1 -> Swapping non-conflicting operations R2(A) and R1(B) in S1, the schedule becomes, S11: R1(A), W1(A), R1(B), W2(A), R2(A), W1(B), R2(B), W2(B) -> Similarly, swapping non-conflicting operations W2(A) and W1(B) in S11, the schedule becomes, S12: R1(A), W1(A), R1(B), W1(B), R2(A), W2(A), R2(B), W2(B) S12 is a serial schedule in which all operations of T1 are performed before starting any operation of T2. Since S has been transformed into a serial schedule S12 by swapping non-conflicting operations of S1, S1 is conflict serializable.
  • 10.  Let us take another Schedule: S2: R2(A), W2(A), R1(A), W1(A), R1(B), W1(B), R2(B), W2(B) Two transactions will be: T1: R1(A), W1(A), R1(B), W1(B) T2: R2(A), W2(A), R2(B), W2(B) Possible Serial Schedules are: T1->T2 or T2->T1 Original Schedule is: S2: R2(A), W2(A), R1(A), W1(A), R1(B), W1(B), R2(B), W2(B) Swapping non-conflicting operations R1(A) and R2(B) in S2, the schedule becomes, S21: R2(A), W2(A), R2(B), W1(A), R1(B), W1(B), R1(A), W2(B) Similarly, swapping non-conflicting operations W1(A) and W2(B) in S21, the schedule becomes, S22: R2(A), W2(A), R2(B), W2(B), R1(B), W1(B), R1(A), W1(A) In schedule S22, all operations of T2 are performed first, but operations of T1 are not in order (order should be R1(A), W1(A), R1(B), W1(B)). So S2 is not conflict serializable.
  • 11. Conflict Equivalent: Two schedules are said to be conflict equivalent when one can be transformed to another by swapping non-conflicting operations. In the example discussed above, S11 is conflict equivalent to S1 (S1 can be converted to S11 by swapping non- conflicting operations). Similarly, S11 is conflict equivalent to S12 and so on.  Note 1: Although S2 is not conflict serializable, but still it is conflict equivalent to S21 and S21 because S2 can be converted to S21 and S22 by swapping non-conflicting operations.  Note 2: The schedule which is conflict serializable is always conflict equivalent to one of the serial schedule. S1 schedule discussed above (which is conflict serializable) is equivalent to serial schedule (T1->T2).