SlideShare a Scribd company logo
1 of 11
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

What's hot

17. Recovery System in DBMS
17. Recovery System in DBMS17. Recovery System in DBMS
17. Recovery System in DBMSkoolkampus
 
Timestamp based protocol
Timestamp based protocolTimestamp based protocol
Timestamp based protocolVincent Chu
 
Concurrency control
Concurrency  controlConcurrency  control
Concurrency controlJaved Khan
 
Multiversion Concurrency Control Techniques
Multiversion Concurrency Control TechniquesMultiversion Concurrency Control Techniques
Multiversion Concurrency Control TechniquesRaj vardhan
 
Transaction
TransactionTransaction
TransactionAmin Omi
 
Transactions in dbms
Transactions in dbmsTransactions in dbms
Transactions in dbmsNancy Gulati
 
Locks In Disributed Systems
Locks In Disributed SystemsLocks In Disributed Systems
Locks In Disributed Systemsmridul mishra
 
Transaction management DBMS
Transaction  management DBMSTransaction  management DBMS
Transaction management DBMSMegha Patel
 
Concurrency control!
Concurrency control!Concurrency control!
Concurrency control!Ashish K
 

What's hot (20)

17. Recovery System in DBMS
17. Recovery System in DBMS17. Recovery System in DBMS
17. Recovery System in DBMS
 
Timestamp protocols
Timestamp protocolsTimestamp protocols
Timestamp protocols
 
serializability in dbms
serializability in dbmsserializability in dbms
serializability in dbms
 
Timestamp based protocol
Timestamp based protocolTimestamp based protocol
Timestamp based protocol
 
Concurrency control
Concurrency  controlConcurrency  control
Concurrency control
 
Multiversion Concurrency Control Techniques
Multiversion Concurrency Control TechniquesMultiversion Concurrency Control Techniques
Multiversion Concurrency Control Techniques
 
2 phase locking protocol DBMS
2 phase locking protocol DBMS2 phase locking protocol DBMS
2 phase locking protocol DBMS
 
Process state in OS
Process state in OSProcess state in OS
Process state in OS
 
Queue ppt
Queue pptQueue ppt
Queue ppt
 
Python Control structures
Python Control structuresPython Control structures
Python Control structures
 
Transaction
TransactionTransaction
Transaction
 
Transactions in dbms
Transactions in dbmsTransactions in dbms
Transactions in dbms
 
Locks In Disributed Systems
Locks In Disributed SystemsLocks In Disributed Systems
Locks In Disributed Systems
 
Deadlock dbms
Deadlock dbmsDeadlock dbms
Deadlock dbms
 
Encryption ppt
Encryption pptEncryption ppt
Encryption ppt
 
Transaction management DBMS
Transaction  management DBMSTransaction  management DBMS
Transaction management DBMS
 
Concurrency control
Concurrency controlConcurrency control
Concurrency control
 
Concurrency control!
Concurrency control!Concurrency control!
Concurrency control!
 
Serializability
SerializabilitySerializability
Serializability
 
Deadlock in database
Deadlock in databaseDeadlock in database
Deadlock in database
 

Similar to VALIDATION BASED PROTOCOL AND MULTIPLE GRANULARITY.pptx

DBMS Presentation.pptx
DBMS Presentation.pptxDBMS Presentation.pptx
DBMS Presentation.pptxPravinBhargav1
 
Concurrency note.pdf
Concurrency note.pdfConcurrency note.pdf
Concurrency note.pdfBijayNag1
 
Concurrency control PPT
Concurrency control PPTConcurrency control PPT
Concurrency control PPTShushrutGupta
 
Design & Development of an Advanced Database Management System Using Multiver...
Design & Development of an Advanced Database Management System Using Multiver...Design & Development of an Advanced Database Management System Using Multiver...
Design & Development of an Advanced Database Management System Using Multiver...IOSR Journals
 
concurrencycontrol from power pint pdf a
concurrencycontrol  from power pint pdf aconcurrencycontrol  from power pint pdf a
concurrencycontrol from power pint pdf aMdAyanParwez
 
Concurrency Control & Deadlock Handling
Concurrency Control & Deadlock HandlingConcurrency Control & Deadlock Handling
Concurrency Control & Deadlock HandlingMeghaj Mallick
 
DBMS (Deadlock, deadlock prevention, 2phase locking)
DBMS (Deadlock, deadlock prevention, 2phase locking)DBMS (Deadlock, deadlock prevention, 2phase locking)
DBMS (Deadlock, deadlock prevention, 2phase locking)Gaurav Solanki
 
Concurrency Control.pptx
Concurrency Control.pptxConcurrency Control.pptx
Concurrency Control.pptxVijaySourtha
 
Unit 5 rdbms study_material
Unit 5  rdbms study_materialUnit 5  rdbms study_material
Unit 5 rdbms study_materialgayaramesh
 
Adbms 43 multiversion concurrency control
Adbms 43 multiversion concurrency controlAdbms 43 multiversion concurrency control
Adbms 43 multiversion concurrency controlVaibhav Khanna
 
Database concurrency control &amp; recovery (1)
Database concurrency control &amp; recovery (1)Database concurrency control &amp; recovery (1)
Database concurrency control &amp; recovery (1)Rashid Khan
 

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

DBMS Presentation.pptx
DBMS Presentation.pptxDBMS Presentation.pptx
DBMS Presentation.pptx
 
Concurrency control
Concurrency controlConcurrency control
Concurrency control
 
Concurrency note.pdf
Concurrency note.pdfConcurrency note.pdf
Concurrency note.pdf
 
Concurrency control PPT
Concurrency control PPTConcurrency control PPT
Concurrency control PPT
 
F017213747
F017213747F017213747
F017213747
 
F017213747
F017213747F017213747
F017213747
 
Design & Development of an Advanced Database Management System Using Multiver...
Design & Development of an Advanced Database Management System Using Multiver...Design & Development of an Advanced Database Management System Using Multiver...
Design & Development of an Advanced Database Management System Using Multiver...
 
concurrencycontrol from power pint pdf a
concurrencycontrol  from power pint pdf aconcurrencycontrol  from power pint pdf a
concurrencycontrol from power pint pdf a
 
Concurrency Control & Deadlock Handling
Concurrency Control & Deadlock HandlingConcurrency Control & Deadlock Handling
Concurrency Control & Deadlock Handling
 
DBMS (Deadlock, deadlock prevention, 2phase locking)
DBMS (Deadlock, deadlock prevention, 2phase locking)DBMS (Deadlock, deadlock prevention, 2phase locking)
DBMS (Deadlock, deadlock prevention, 2phase locking)
 
UNIT II.pptx
UNIT II.pptxUNIT II.pptx
UNIT II.pptx
 
Concurrency Control.pptx
Concurrency Control.pptxConcurrency Control.pptx
Concurrency Control.pptx
 
Unit 5 rdbms study_material
Unit 5  rdbms study_materialUnit 5  rdbms study_material
Unit 5 rdbms study_material
 
Adbms 43 multiversion concurrency control
Adbms 43 multiversion concurrency controlAdbms 43 multiversion concurrency control
Adbms 43 multiversion concurrency control
 
DBMS UNIT 4
DBMS UNIT 4DBMS UNIT 4
DBMS UNIT 4
 
Database concurrency control &amp; recovery (1)
Database concurrency control &amp; recovery (1)Database concurrency control &amp; recovery (1)
Database concurrency control &amp; recovery (1)
 
Concurrency Control
Concurrency ControlConcurrency Control
Concurrency Control
 
Concurrent control
Concurrent controlConcurrent control
Concurrent control
 
Rdbms
RdbmsRdbms
Rdbms
 
Rdbms
RdbmsRdbms
Rdbms
 

More from SamyakJain710491

Bayesian Belief Network and its Applications.pptx
Bayesian Belief Network and its Applications.pptxBayesian Belief Network and its Applications.pptx
Bayesian Belief Network and its Applications.pptxSamyakJain710491
 
performance appraisal at Tech Mahindra.pptx
performance appraisal at Tech Mahindra.pptxperformance appraisal at Tech Mahindra.pptx
performance appraisal at Tech Mahindra.pptxSamyakJain710491
 
Process Based Estimation.pptx
Process Based Estimation.pptxProcess Based Estimation.pptx
Process Based Estimation.pptxSamyakJain710491
 
Internet Protocol(Samyak Jain 25014).pptx
Internet Protocol(Samyak Jain 25014).pptxInternet Protocol(Samyak Jain 25014).pptx
Internet Protocol(Samyak Jain 25014).pptxSamyakJain710491
 
Equivalence of DFAs and NFAs.pptx
Equivalence of DFAs and NFAs.pptxEquivalence of DFAs and NFAs.pptx
Equivalence of DFAs and NFAs.pptxSamyakJain710491
 
Binomial_Coefficient_and_World_series_problem_using_Dynamic_Programming.pptx
Binomial_Coefficient_and_World_series_problem_using_Dynamic_Programming.pptxBinomial_Coefficient_and_World_series_problem_using_Dynamic_Programming.pptx
Binomial_Coefficient_and_World_series_problem_using_Dynamic_Programming.pptxSamyakJain710491
 
Process and Thread Management in Solaris Operating System.pptx
Process and Thread Management in Solaris Operating System.pptxProcess and Thread Management in Solaris Operating System.pptx
Process and Thread Management in Solaris Operating System.pptxSamyakJain710491
 

More from SamyakJain710491 (11)

Bayesian Belief Network and its Applications.pptx
Bayesian Belief Network and its Applications.pptxBayesian Belief Network and its Applications.pptx
Bayesian Belief Network and its Applications.pptx
 
Compiler Design PPT.pptx
Compiler Design PPT.pptxCompiler Design PPT.pptx
Compiler Design PPT.pptx
 
performance appraisal at Tech Mahindra.pptx
performance appraisal at Tech Mahindra.pptxperformance appraisal at Tech Mahindra.pptx
performance appraisal at Tech Mahindra.pptx
 
Process Based Estimation.pptx
Process Based Estimation.pptxProcess Based Estimation.pptx
Process Based Estimation.pptx
 
Internet Protocol(Samyak Jain 25014).pptx
Internet Protocol(Samyak Jain 25014).pptxInternet Protocol(Samyak Jain 25014).pptx
Internet Protocol(Samyak Jain 25014).pptx
 
Equivalence of DFAs and NFAs.pptx
Equivalence of DFAs and NFAs.pptxEquivalence of DFAs and NFAs.pptx
Equivalence of DFAs and NFAs.pptx
 
Binomial_Coefficient_and_World_series_problem_using_Dynamic_Programming.pptx
Binomial_Coefficient_and_World_series_problem_using_Dynamic_Programming.pptxBinomial_Coefficient_and_World_series_problem_using_Dynamic_Programming.pptx
Binomial_Coefficient_and_World_series_problem_using_Dynamic_Programming.pptx
 
Cache Coherence.pptx
Cache Coherence.pptxCache Coherence.pptx
Cache Coherence.pptx
 
SWING.pptx
SWING.pptxSWING.pptx
SWING.pptx
 
AVL tree PPT.pptx
AVL tree PPT.pptxAVL tree PPT.pptx
AVL tree PPT.pptx
 
Process and Thread Management in Solaris Operating System.pptx
Process and Thread Management in Solaris Operating System.pptxProcess and Thread Management in Solaris Operating System.pptx
Process and Thread Management in Solaris Operating System.pptx
 

Recently uploaded

Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptxPoojaSen20
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 

Recently uploaded (20)

Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 

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