SlideShare a Scribd company logo
2
Most read
3
Most read
4
Most read
VALIDATION BASED PROTOCOL AND MULTIPLE
GRANULARITY
VALIDATION BASED PROTOCOL
PRESENTED BY: KASHISH HORA
SAMYAK JAIN
submitted to – Anju Sharma Mam
INTRODUCTION
 Validation Based Protocol is also called Optimistic Concurrency Control Technique. This protocol is used in
DBMS (Database Management System) for avoiding concurrency in transactions.
 It is called optimistic because of the assumption it makes, i.e. very less interference occurs, therefore,
there is no need for checking while the transaction is executed.
 In this technique, no checking is done while the transaction is been executed. Until the transaction end is
reached updates in the transaction are not applied directly to the database. All updates are applied to local
copies of data items kept for the transaction.
 At the end of transaction execution, while execution of the transaction, a validation phase checks whether
any of transaction updates violate serializability. If there is no violation of serializability the transaction is
committed and the database is updated; or else, the transaction is updated and then restarted.
 Optimistic Concurrency Control is a three-phase protocol. The three phases for validation based protocol:
•READ PHASE:- In this phase Ti reads all data & store them in temporary variables(local
variables of Ti)
After reading all the write operations are made on temporary variables instead of
actual Database.
•VALIDATION PHASE:-In this validation test is performed to determine whether changes
in actual
database can be made.
•WRITE PHASE:- If Ti clear the validation test then actual changes are made to
database.
Validation test ensures the violation free execution of transaction.
•Timestamp is used to determine when to start validation test.
•Every Ti is associated with three timestamp which are:-
1.Start(Ti):- It gives time when it start execution.
2.Validation(Ti):- It gives time when Ti finishes its read phase & starts its validation
phase.
3. Finish(Ti):- It gives time when Ti finished its execution or write phase.
• If any transaction failed in validation test then its aborted & rollback.
VALIDATION TEST:-
To clear all the validation test by Ti then Ti must satisfy one of the following
condition:-
• Finish(Ti)<Start(Ti):- It means Ti is older transaction and it get enabled before Tj
starts.
• Finish(Ti)<Validate(Tj):- this ensures actual write by Ti & Tj will not overlap.
• Validate(Ti)< Validate(Tj):- It ensures that Ti has completed read phase before Tj
complete read phase.
Example:-
Advantages:-
1. Avoid Cascading-rollbacks: This validation based scheme avoid cascading rollbacks since
the final write operations to the database are performed only after the transaction passes the
validation phase. If the transaction fails then no updation operation is performed in the database
So no dirty read will happen hence possibilities cascading-rollback would be null.
2. Avoid deadlock: Since a strict time-stamping based technique is used to maintain the specific
the specific order of transactions. Hence deadlock isn’t possible in this scheme.
Disadvantages:
1. Starvation: There might be a possibility of starvation for long-term transactions, due
to a sequence of conflicting short-term transactions that cause the repeated sequence
of restarts of the long-term transactions so on and so forth. To avoid starvation ,
conflicting transactions must be temporarily blocked for some time, to let the
long-term transactions to finish.
Multiple Granularity
It is the size of data item allowed to lock and define a
hierarchy of data granularities , where the small
granularities are nested within larger ones.
Fine Granularity- refers to small data item size.
example - a tuple or an attribute.
Course Granularity- refers to large data item size
example - entire relation or a database.
The hereachy of data item of various size can be
represented in the form of a tree
Fig: Granularity Hierarchy
When a transaction locks a node in the tree explicitly , it implicitly locks all the
node descendants in the same mode.
• Tj must traverse from the root of the tree to record ra1 to check whether this
request can be granted.
• If any node in that path is locked in incompatiable mode then the lock request
can not be granted.
Intention Lock Modes
 In addition to S and X lock modes, there are three additional lock modes with multiple granularity:
1. Intention shared(IS): indicates explicit locking at a lower level of tree but only with shared locks.
2. Intention exclusive(IX): indicates explicit locking at a lower level with exclusive or shared locks.
3. Shared and Intention exclusive(SIX): the subtree rooted by that node is locked explicitly in shared mode and explicit
locking is being done at a lower level with exclusive mode locks.
 intention locks allow a higher level node to be locked in S or X mode without having to check all descendent
nodes.
Check the compatibility of each lock with another
THANK YOU

More Related Content

PPTX
Validation based protocol
PPT
16. Concurrency Control in DBMS
PPTX
Concurrency control
PPTX
Concurrency control
PPTX
Concurrency Control in Database Management System
PPT
Deadlock management
PPTX
Recovery with concurrent transaction
PPTX
Transaction management in DBMS
Validation based protocol
16. Concurrency Control in DBMS
Concurrency control
Concurrency control
Concurrency Control in Database Management System
Deadlock management
Recovery with concurrent transaction
Transaction management in DBMS

What's hot (20)

PPTX
Symbol Table
PPTX
Code optimization
PDF
PPTX
Lecture 14 run time environment
PPT
Type Checking(Compiler Design) #ShareThisIfYouLike
PPTX
Basic blocks - compiler design
PPTX
Syntax Analysis in Compiler Design
PPTX
Operating system 22 threading issues
PPTX
Monolithic kernel
PPTX
Instruction Pipelining
PPTX
Compiler Design Unit 4
PPTX
Basic blocks and control flow graphs
PPTX
Semaphore
PDF
Intermediate code generation in Compiler Design
PPT
File access methods.54
PPT
Introduction to Compiler Construction
PDF
Intermediate code generation
PPTX
Recursion in Data Structure
PPTX
Methods for handling deadlock
PPTX
LR(1) and SLR(1) parsing
Symbol Table
Code optimization
Lecture 14 run time environment
Type Checking(Compiler Design) #ShareThisIfYouLike
Basic blocks - compiler design
Syntax Analysis in Compiler Design
Operating system 22 threading issues
Monolithic kernel
Instruction Pipelining
Compiler Design Unit 4
Basic blocks and control flow graphs
Semaphore
Intermediate code generation in Compiler Design
File access methods.54
Introduction to Compiler Construction
Intermediate code generation
Recursion in Data Structure
Methods for handling deadlock
LR(1) and SLR(1) parsing
Ad

Similar to VALIDATION BASED PROTOCOL AND MULTIPLE GRANULARITY.pptx (20)

PPTX
Concurrency control
PPTX
protocols of concurrency control
PDF
concurrencycontrol from power pint pdf a
PPTX
Concurrency control
PPTX
Concurrency control!
PPTX
Unit 4 Concurrency control.pptx dbms lovely
PPTX
Concurrency Control.pptx
PPTX
Adbms 43 multiversion concurrency control
PPTX
Transaction management transparencies
PPTX
Unit 5 dbms
PDF
Advanced Database Chapter 4.pdf shnsbxlajmndm woweosmkl m,xcnkl C NOOxcx xcbnxc
DOCX
Dbms voc 5 unit
PPTX
Multi version Concurrency Control and its applications in Advanced database s...
PDF
CONCURRENCY CONTOL notes.pdf
PPTX
Concujsjsjejejejejejejerreny control.pptx
PDF
Concurrency note.pdf
PPTX
Concurrency Control
PDF
Unit 5 rdbms study_material
PPTX
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
PPTX
Concurrency control PPT
Concurrency control
protocols of concurrency control
concurrencycontrol from power pint pdf a
Concurrency control
Concurrency control!
Unit 4 Concurrency control.pptx dbms lovely
Concurrency Control.pptx
Adbms 43 multiversion concurrency control
Transaction management transparencies
Unit 5 dbms
Advanced Database Chapter 4.pdf shnsbxlajmndm woweosmkl m,xcnkl C NOOxcx xcbnxc
Dbms voc 5 unit
Multi version Concurrency Control and its applications in Advanced database s...
CONCURRENCY CONTOL notes.pdf
Concujsjsjejejejejejejerreny control.pptx
Concurrency note.pdf
Concurrency Control
Unit 5 rdbms study_material
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
Concurrency control PPT
Ad

More from SamyakJain710491 (11)

PPTX
Bayesian Belief Network and its Applications.pptx
PPTX
Compiler Design PPT.pptx
PPTX
performance appraisal at Tech Mahindra.pptx
PPTX
Process Based Estimation.pptx
PPTX
Internet Protocol(Samyak Jain 25014).pptx
PPTX
Equivalence of DFAs and NFAs.pptx
PPTX
Binomial_Coefficient_and_World_series_problem_using_Dynamic_Programming.pptx
PPTX
Cache Coherence.pptx
PPTX
SWING.pptx
PPTX
AVL tree PPT.pptx
PPTX
Process and Thread Management in Solaris Operating System.pptx
Bayesian Belief Network and its Applications.pptx
Compiler Design PPT.pptx
performance appraisal at Tech Mahindra.pptx
Process Based Estimation.pptx
Internet Protocol(Samyak Jain 25014).pptx
Equivalence of DFAs and NFAs.pptx
Binomial_Coefficient_and_World_series_problem_using_Dynamic_Programming.pptx
Cache Coherence.pptx
SWING.pptx
AVL tree PPT.pptx
Process and Thread Management in Solaris Operating System.pptx

Recently uploaded (20)

PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
Institutional Correction lecture only . . .
PDF
Sports Quiz easy sports quiz sports quiz
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
Pre independence Education in Inndia.pdf
PPTX
Cell Types and Its function , kingdom of life
PDF
Computing-Curriculum for Schools in Ghana
PDF
RMMM.pdf make it easy to upload and study
PPTX
GDM (1) (1).pptx small presentation for students
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
Basic Mud Logging Guide for educational purpose
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
Lesson notes of climatology university.
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Abdominal Access Techniques with Prof. Dr. R K Mishra
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Institutional Correction lecture only . . .
Sports Quiz easy sports quiz sports quiz
Renaissance Architecture: A Journey from Faith to Humanism
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Final Presentation General Medicine 03-08-2024.pptx
TR - Agricultural Crops Production NC III.pdf
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Pre independence Education in Inndia.pdf
Cell Types and Its function , kingdom of life
Computing-Curriculum for Schools in Ghana
RMMM.pdf make it easy to upload and study
GDM (1) (1).pptx small presentation for students
Anesthesia in Laparoscopic Surgery in India
Basic Mud Logging Guide for educational purpose
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Module 4: Burden of Disease Tutorial Slides S2 2025
Lesson notes of climatology university.
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...

VALIDATION BASED PROTOCOL AND MULTIPLE GRANULARITY.pptx

  • 1. VALIDATION BASED PROTOCOL AND MULTIPLE GRANULARITY VALIDATION BASED PROTOCOL PRESENTED BY: KASHISH HORA SAMYAK JAIN submitted to – Anju Sharma Mam
  • 2. INTRODUCTION  Validation Based Protocol is also called Optimistic Concurrency Control Technique. This protocol is used in DBMS (Database Management System) for avoiding concurrency in transactions.  It is called optimistic because of the assumption it makes, i.e. very less interference occurs, therefore, there is no need for checking while the transaction is executed.  In this technique, no checking is done while the transaction is been executed. Until the transaction end is reached updates in the transaction are not applied directly to the database. All updates are applied to local copies of data items kept for the transaction.  At the end of transaction execution, while execution of the transaction, a validation phase checks whether any of transaction updates violate serializability. If there is no violation of serializability the transaction is committed and the database is updated; or else, the transaction is updated and then restarted.  Optimistic Concurrency Control is a three-phase protocol. The three phases for validation based protocol:
  • 3. •READ PHASE:- In this phase Ti reads all data & store them in temporary variables(local variables of Ti) After reading all the write operations are made on temporary variables instead of actual Database. •VALIDATION PHASE:-In this validation test is performed to determine whether changes in actual database can be made. •WRITE PHASE:- If Ti clear the validation test then actual changes are made to database. Validation test ensures the violation free execution of transaction. •Timestamp is used to determine when to start validation test. •Every Ti is associated with three timestamp which are:- 1.Start(Ti):- It gives time when it start execution. 2.Validation(Ti):- It gives time when Ti finishes its read phase & starts its validation phase. 3. Finish(Ti):- It gives time when Ti finished its execution or write phase. • If any transaction failed in validation test then its aborted & rollback.
  • 4. VALIDATION TEST:- To clear all the validation test by Ti then Ti must satisfy one of the following condition:- • Finish(Ti)<Start(Ti):- It means Ti is older transaction and it get enabled before Tj starts. • Finish(Ti)<Validate(Tj):- this ensures actual write by Ti & Tj will not overlap. • Validate(Ti)< Validate(Tj):- It ensures that Ti has completed read phase before Tj complete read phase. Example:-
  • 5. Advantages:- 1. Avoid Cascading-rollbacks: This validation based scheme avoid cascading rollbacks since the final write operations to the database are performed only after the transaction passes the validation phase. If the transaction fails then no updation operation is performed in the database So no dirty read will happen hence possibilities cascading-rollback would be null. 2. Avoid deadlock: Since a strict time-stamping based technique is used to maintain the specific the specific order of transactions. Hence deadlock isn’t possible in this scheme. Disadvantages: 1. Starvation: There might be a possibility of starvation for long-term transactions, due to a sequence of conflicting short-term transactions that cause the repeated sequence of restarts of the long-term transactions so on and so forth. To avoid starvation , conflicting transactions must be temporarily blocked for some time, to let the long-term transactions to finish.
  • 6. Multiple Granularity It is the size of data item allowed to lock and define a hierarchy of data granularities , where the small granularities are nested within larger ones. Fine Granularity- refers to small data item size. example - a tuple or an attribute. Course Granularity- refers to large data item size example - entire relation or a database.
  • 7. The hereachy of data item of various size can be represented in the form of a tree Fig: Granularity Hierarchy
  • 8. When a transaction locks a node in the tree explicitly , it implicitly locks all the node descendants in the same mode. • Tj must traverse from the root of the tree to record ra1 to check whether this request can be granted. • If any node in that path is locked in incompatiable mode then the lock request can not be granted.
  • 9. Intention Lock Modes  In addition to S and X lock modes, there are three additional lock modes with multiple granularity: 1. Intention shared(IS): indicates explicit locking at a lower level of tree but only with shared locks. 2. Intention exclusive(IX): indicates explicit locking at a lower level with exclusive or shared locks. 3. Shared and Intention exclusive(SIX): the subtree rooted by that node is locked explicitly in shared mode and explicit locking is being done at a lower level with exclusive mode locks.  intention locks allow a higher level node to be locked in S or X mode without having to check all descendent nodes.
  • 10. Check the compatibility of each lock with another