SlideShare a Scribd company logo
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).

More Related Content

What's hot

Indexing structure for files
Indexing structure for filesIndexing structure for files
Indexing structure for files
Zainab Almugbel
 
Address Binding Scheme
Address Binding SchemeAddress Binding Scheme
Address Binding Scheme
Rajesh Piryani
 
Distributed concurrency control
Distributed concurrency controlDistributed concurrency control
Distributed concurrency control
Binte fatima
 
Cost estimation for Query Optimization
Cost estimation for Query OptimizationCost estimation for Query Optimization
Cost estimation for Query Optimization
Ravinder Kamboj
 
20. Parallel Databases in DBMS
20. Parallel Databases in DBMS20. Parallel Databases in DBMS
20. Parallel Databases in DBMSkoolkampus
 
Serializability
SerializabilitySerializability
Serializability
Pyingkodi Maran
 
Distributed Mutual exclusion algorithms
Distributed Mutual exclusion algorithmsDistributed Mutual exclusion algorithms
Distributed Mutual exclusion algorithms
MNM Jain Engineering College
 
Distributed Operating System_4
Distributed Operating System_4Distributed Operating System_4
Distributed Operating System_4
Dr Sandeep Kumar Poonia
 
Join dependency
Join dependencyJoin dependency
Join dependency
SubashreeDoss
 
Distributed operating system(os)
Distributed operating system(os)Distributed operating system(os)
Distributed operating system(os)
Dinesh Modak
 
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
Gyanmanjari Institute Of Technology
 
Query processing and optimization (updated)
Query processing and optimization (updated)Query processing and optimization (updated)
Query processing and optimization (updated)
Ravinder Kamboj
 
Distributed DBMS - Unit 1 - Introduction
Distributed DBMS - Unit 1 - IntroductionDistributed DBMS - Unit 1 - Introduction
Distributed DBMS - Unit 1 - Introduction
Gyanmanjari Institute Of Technology
 
Complete dbms notes
Complete dbms notesComplete dbms notes
Complete dbms notes
Tanya Makkar
 
The CAP Theorem
The CAP Theorem The CAP Theorem
The CAP Theorem
Aleksandar Bradic
 
Recovery in Multi database Systems
Recovery in Multi database SystemsRecovery in Multi database Systems
Recovery in Multi database Systems
Moutasm Tamimi
 
Replication in Distributed Systems
Replication in Distributed SystemsReplication in Distributed Systems
Replication in Distributed Systems
Kavya Barnadhya Hazarika
 
DDBMS
DDBMSDDBMS
Concurrency control
Concurrency controlConcurrency control
Concurrency control
Subhasish Pati
 
Deadlock in Distributed Systems
Deadlock in Distributed SystemsDeadlock in Distributed Systems
Deadlock in Distributed Systems
Pritom Saha Akash
 

What's hot (20)

Indexing structure for files
Indexing structure for filesIndexing structure for files
Indexing structure for files
 
Address Binding Scheme
Address Binding SchemeAddress Binding Scheme
Address Binding Scheme
 
Distributed concurrency control
Distributed concurrency controlDistributed concurrency control
Distributed concurrency control
 
Cost estimation for Query Optimization
Cost estimation for Query OptimizationCost estimation for Query Optimization
Cost estimation for Query Optimization
 
20. Parallel Databases in DBMS
20. Parallel Databases in DBMS20. Parallel Databases in DBMS
20. Parallel Databases in DBMS
 
Serializability
SerializabilitySerializability
Serializability
 
Distributed Mutual exclusion algorithms
Distributed Mutual exclusion algorithmsDistributed Mutual exclusion algorithms
Distributed Mutual exclusion algorithms
 
Distributed Operating System_4
Distributed Operating System_4Distributed Operating System_4
Distributed Operating System_4
 
Join dependency
Join dependencyJoin dependency
Join dependency
 
Distributed operating system(os)
Distributed operating system(os)Distributed operating system(os)
Distributed operating system(os)
 
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
 
Query processing and optimization (updated)
Query processing and optimization (updated)Query processing and optimization (updated)
Query processing and optimization (updated)
 
Distributed DBMS - Unit 1 - Introduction
Distributed DBMS - Unit 1 - IntroductionDistributed DBMS - Unit 1 - Introduction
Distributed DBMS - Unit 1 - Introduction
 
Complete dbms notes
Complete dbms notesComplete dbms notes
Complete dbms notes
 
The CAP Theorem
The CAP Theorem The CAP Theorem
The CAP Theorem
 
Recovery in Multi database Systems
Recovery in Multi database SystemsRecovery in Multi database Systems
Recovery in Multi database Systems
 
Replication in Distributed Systems
Replication in Distributed SystemsReplication in Distributed Systems
Replication in Distributed Systems
 
DDBMS
DDBMSDDBMS
DDBMS
 
Concurrency control
Concurrency controlConcurrency control
Concurrency control
 
Deadlock in Distributed Systems
Deadlock in Distributed SystemsDeadlock in Distributed Systems
Deadlock in Distributed Systems
 

Similar to Question answer

15. Transactions in DBMS
15. Transactions in DBMS15. Transactions in DBMS
15. Transactions in DBMSkoolkampus
 
DBMS UNIT 5 46 CONTAINS NOTES FOR THE STUDENTS
DBMS UNIT 5 46 CONTAINS NOTES FOR THE STUDENTSDBMS UNIT 5 46 CONTAINS NOTES FOR THE STUDENTS
DBMS UNIT 5 46 CONTAINS NOTES FOR THE STUDENTS
SnehalVinod
 
Transactions in dbms
Transactions in dbmsTransactions in dbms
Transactions in dbms
Nancy Gulati
 
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 managementrenuka_a
 
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
KavitaShinde26
 
UNIT-IV: Transaction Processing Concepts
UNIT-IV: Transaction Processing ConceptsUNIT-IV: Transaction Processing Concepts
UNIT-IV: Transaction Processing Concepts
Raj vardhan
 
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
Rohit Kumar
 
dbms sanat ppt.pdf
dbms sanat ppt.pdfdbms sanat ppt.pdf
dbms sanat ppt.pdf
BansalShrivastava1
 
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
AAKANKSHA JAIN
 
Transaction and serializability
Transaction and serializabilityTransaction and serializability
Transaction and serializability
Yogita Jain
 
Chapter17
Chapter17Chapter17
Chapter17
gourab87
 
Cs501 transaction
Cs501 transactionCs501 transaction
Cs501 transaction
Kamal Singh Lodhi
 
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
Ajit Nayak
 
Tybsc cs dbms2 notes
Tybsc cs dbms2 notesTybsc cs dbms2 notes
Tybsc cs dbms2 notes
Niraj Bharambe
 

Similar to 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
 
15. Transactions in DBMS
15. Transactions in DBMS15. Transactions in DBMS
15. Transactions in DBMS
 
DBMS UNIT 5 46 CONTAINS NOTES FOR THE STUDENTS
DBMS UNIT 5 46 CONTAINS NOTES FOR THE STUDENTSDBMS UNIT 5 46 CONTAINS NOTES FOR THE STUDENTS
DBMS UNIT 5 46 CONTAINS NOTES FOR THE STUDENTS
 
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
 

More from vishal choudhary

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

More from 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
 

Recently uploaded

Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Po-Chuan Chen
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 

Recently uploaded (20)

Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 

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).