SlideShare a Scribd company logo
A Research
On
“Lock base concurrency control”
For Partial Fulfillment of the Requirements for the Degree of
Master of Computer Information System Awarded by
Pokhara University
Date: 24 July 2019
Table of Contents
1. Introduction.............................................................................................................................. 1
2. Locking Based Algorithms ...................................................................................................... 2
3. Lock-Based Protocols Example............................................................................................... 4
4. Lock Based protocols .............................................................................................................. 5
5. 2PL for DDBMS...................................................................................................................... 6
5.1 Centralized 2PL..................................................................................................................... 6
5.2 Primary copy 2PL ................................................................................................................. 6
5.3 Distributed 2PL..................................................................................................................... 7
6. Communication structure of the distributed 2PL..................................................................... 8
7. Conclusion............................................................................................................................... 9
8. References.............................................................................................................................. 10
Abstract
The lock base concurrency control is a well-accepted method to handle database transaction at
execution time. When the multiple users try to access data at exactly the same time lock-based
concurrency control manipulation and lock the database execution and provide effective data to
the user. Without the concurrency control, there might be a problem with performance in a
database transaction. Multiple frameworks based database concurrency control is the most
important element for proper functioning
1
1. Introduction
A lock is a variable related with an information thing that depicts a status of information thing as
for conceivable activity that can be connected to it. They synchronize the entrance by
simultaneous exchanges to the database things. It is required in this convention that every one of
the information things must be gotten to in a fundamentally unrelated way. Give me a chance to
acquaint you with two regular locks which are utilized and some wording followed in this
convention. A lock is a data variable which is associated with a data item. This lock signifies that
operations that can be performed on the data item. Locks help synchronize access to the database
items by concurrent transactions. All lock requests are made to the concurrency-control manager.
Transactions proceed only once the lock request is granted.
2
2. Locking Based Algorithms
Locking-based concurrency algorithms ensure that data items shared by conflicting operations
are accessed in a mutually exclusive way. This is accomplished by associating a “lock” with each
such data item.
Terminology Use in this protocol
Shared Lock (S): also known as Read-only lock. As the name suggests it can be shared between
transactions because while holding this lock the transaction does not have the permission to
update data on the data item. S-lock is requested using lock-S instruction.
Exclusive Lock (X): Data item can be both read as well as written. This is Exclusive and cannot
be held simultaneously on the same data item. X-lock is requested using lock-X instruction.
 Two types of locks (lock modes)
o Read lock (rl) – also called shared lock
o Write lock (wl) – also called exclusive lock
 Compatibility matrix of locks
rl
i
(x) wl
i
(x) rl
j
(x) Compatible not compatible wl
j
(x) Not compatible not compatible
 General locking algorithm
1. Before using a data item x, transaction requests lock for x from the lock manager
3
2. If x is already locked and the existing lock is incompatible with the requested
lock, the Transaction is delayed
3. Otherwise, the lock is granted.
4
3. Lock-Based Protocols Example
Transaction performing locking:
T2: lock-S (A);
Read (A);
Unlock (A);
Lock-S (B);
Read (B);
Unlock (B);
Display (A+B)
 Locking as above is not sufficient to guarantee serializability — if A and B get updated
in-between the read of A and B, the displayed sum would be wrong.
 A locking protocol is a set of rules followed by all transactions while requesting and
releasing locks. Locking protocols restrict the set of possible schedules
5
4. Lock Based protocols
4.1 Two-phase locking protocol (2PL)
Each transaction is executed in two phases
 Growing phase:
-Transaction may obtain locks
-Transaction may not release locks
 Shrinking phase: the transaction releases locks
- Transaction may release locks
- Transaction may not obtain locks
4.1.1 Properties of the 2PL protocol
Generates conflict-serializable schedules – But schedules may cause cascading aborts
If a transaction aborts after it releases a lock, it may cause other transactions that have accessed
the unlocked data item to abort as well.
 Strict 2PL locking protocol
 Holds the locks till the end of the transaction – Cascading aborts are avoided
6
5. 2PL for DDBMS
Various extensions of the 2PL to DDBMS
5.1 Centralized 2PL
A single site is responsible for the lock management, i.e., one lock manager for the whole
DDBMS – Lock requests are issued to the lock manager – Coordinating transaction manager
(TM at site where the transaction is initiated) can make all locking requests on behalf of local
transaction managers.
• Advantage:
Easy to implement
• Disadvantages:
Bottlenecks and lower reliability
Replica control protocol is additionally needed if data are replicated.
5.2 Primary copy 2PL
– Several lock managers are distributed to a number of sites
– Each lock manager is responsible for managing the locks for a set of data items
– For replicated data items, one copy is chosen as primary copy, others are slave copies
– Only the primary copy of a data item that is updated needs to be write-locked
– Once primary copy has been updated, the change is propagated to the slaves
• Advantages
– Lower communication costs and better performance than the centralized 2PL
• Disadvantages
– Deadlock handling is more complex
7
5.3 Distributed 2PL
– Lock managers are distributed to all sites
– Each lock manager responsible for locks for data at that site
– If data is not replicated, it is equivalent to primary copy 2PL
– If data is replicated, the Read-One-Write-All (ROWA) replica control protocol is
Implemented ∗ Read(x): Any copy of a replicated item x can be read by obtaining a read lock on
The copy ∗ Write(x): All copies of x must be write-locked before x can be updated
• Disadvantages
– Deadlock handling more complex
– Communication costs higher than primary copy 2PL
8
6. Communication structure of the distributed 2PL
The coordinating TM sends the lock request to the lock managers of all participating Sites.
– The LMs pass the operations to the data processors
– The end of the operation is signaled to the coordinating TM
Fig: Communication structure of the distributed 2PL
9
7. Conclusion
Concurrency orders the operations of transactions such that two properties are achieved: the
database is always in a consistent state and the maximum concurrencies of operations are
achieved. Concurrency Control is a problem that arises when multiple processes are involved in
any part of the system. In most commercial systems, the most popular mechanism for
concurrency control is two-phase locking.
10
8. References
 Principles of distributed Database System
M. Tamer Ozsu (Book)
 www.codex.cs.yale.edu

More Related Content

What's hot

Database , 8 Query Optimization
Database , 8 Query OptimizationDatabase , 8 Query Optimization
Database , 8 Query OptimizationAli Usman
 
Deadlock detection and recovery by saad symbian
Deadlock detection and recovery by saad symbianDeadlock detection and recovery by saad symbian
Deadlock detection and recovery by saad symbian
saad symbian
 
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
 
Concurrency Control in Distributed Database.
Concurrency Control in Distributed Database.Concurrency Control in Distributed Database.
Concurrency Control in Distributed Database.
Meghaj Mallick
 
Data decomposition techniques
Data decomposition techniquesData decomposition techniques
Data decomposition techniques
Mohamed Ramadan
 
Dead Lock in operating system
Dead Lock in operating systemDead Lock in operating system
Dead Lock in operating system
Ali Haider
 
Parallel Algorithm Models
Parallel Algorithm ModelsParallel Algorithm Models
Parallel Algorithm Models
Martin Coronel
 
Deadlock in database
Deadlock in databaseDeadlock in database
Deadlock in database
Tayyab Hussain
 
Database , 12 Reliability
Database , 12 ReliabilityDatabase , 12 Reliability
Database , 12 ReliabilityAli Usman
 
Concurrency Control Techniques
Concurrency Control TechniquesConcurrency Control Techniques
Concurrency Control Techniques
Raj vardhan
 
DISTRIBUTED DATABASE WITH RECOVERY TECHNIQUES
DISTRIBUTED DATABASE WITH RECOVERY TECHNIQUESDISTRIBUTED DATABASE WITH RECOVERY TECHNIQUES
DISTRIBUTED DATABASE WITH RECOVERY TECHNIQUES
AAKANKSHA JAIN
 
Lec 7 query processing
Lec 7 query processingLec 7 query processing
Lec 7 query processing
Md. Mashiur Rahman
 
Features of Hadoop
Features of HadoopFeatures of Hadoop
Features of Hadoop
Dr. C.V. Suresh Babu
 
Mutual Exclusion using Peterson's Algorithm
Mutual Exclusion using Peterson's AlgorithmMutual Exclusion using Peterson's Algorithm
Mutual Exclusion using Peterson's AlgorithmSouvik Roy
 
Presentation on Elementary data structures
Presentation on Elementary data structuresPresentation on Elementary data structures
Presentation on Elementary data structures
Kuber Chandra
 
2 phase locking protocol DBMS
2 phase locking protocol DBMS2 phase locking protocol DBMS
2 phase locking protocol DBMS
Dhananjaysinh Jhala
 
Instruction level parallelism
Instruction level parallelismInstruction level parallelism
Instruction level parallelism
deviyasharwin
 
parallel Questions & answers
parallel Questions & answersparallel Questions & answers
parallel Questions & answers
Md. Mashiur Rahman
 
Deadlock Prevention
Deadlock PreventionDeadlock Prevention
Deadlock Prevention
prachi mewara
 

What's hot (20)

Database , 8 Query Optimization
Database , 8 Query OptimizationDatabase , 8 Query Optimization
Database , 8 Query Optimization
 
Deadlock detection and recovery by saad symbian
Deadlock detection and recovery by saad symbianDeadlock detection and recovery by saad symbian
Deadlock detection and recovery by saad symbian
 
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 ...
 
Concurrency Control in Distributed Database.
Concurrency Control in Distributed Database.Concurrency Control in Distributed Database.
Concurrency Control in Distributed Database.
 
Data decomposition techniques
Data decomposition techniquesData decomposition techniques
Data decomposition techniques
 
Dead Lock in operating system
Dead Lock in operating systemDead Lock in operating system
Dead Lock in operating system
 
Parallel Algorithm Models
Parallel Algorithm ModelsParallel Algorithm Models
Parallel Algorithm Models
 
Deadlock in database
Deadlock in databaseDeadlock in database
Deadlock in database
 
Database , 12 Reliability
Database , 12 ReliabilityDatabase , 12 Reliability
Database , 12 Reliability
 
Concurrency Control Techniques
Concurrency Control TechniquesConcurrency Control Techniques
Concurrency Control Techniques
 
DISTRIBUTED DATABASE WITH RECOVERY TECHNIQUES
DISTRIBUTED DATABASE WITH RECOVERY TECHNIQUESDISTRIBUTED DATABASE WITH RECOVERY TECHNIQUES
DISTRIBUTED DATABASE WITH RECOVERY TECHNIQUES
 
Lec 7 query processing
Lec 7 query processingLec 7 query processing
Lec 7 query processing
 
Database System Architectures
Database System ArchitecturesDatabase System Architectures
Database System Architectures
 
Features of Hadoop
Features of HadoopFeatures of Hadoop
Features of Hadoop
 
Mutual Exclusion using Peterson's Algorithm
Mutual Exclusion using Peterson's AlgorithmMutual Exclusion using Peterson's Algorithm
Mutual Exclusion using Peterson's Algorithm
 
Presentation on Elementary data structures
Presentation on Elementary data structuresPresentation on Elementary data structures
Presentation on Elementary data structures
 
2 phase locking protocol DBMS
2 phase locking protocol DBMS2 phase locking protocol DBMS
2 phase locking protocol DBMS
 
Instruction level parallelism
Instruction level parallelismInstruction level parallelism
Instruction level parallelism
 
parallel Questions & answers
parallel Questions & answersparallel Questions & answers
parallel Questions & answers
 
Deadlock Prevention
Deadlock PreventionDeadlock Prevention
Deadlock Prevention
 

Similar to Locking base concurrency control

Vani dbms
Vani dbmsVani dbms
Vani dbms
SangeethaSasi1
 
UNIT II.pptx
UNIT II.pptxUNIT II.pptx
UNIT II.pptx
ssuserec53e73
 
concurrency control.ppt
concurrency control.pptconcurrency control.ppt
concurrency control.ppt
BikalAdhikari4
 
Overview of Concurrency Control & Recovery in Distributed Databases
Overview of Concurrency Control & Recovery in Distributed DatabasesOverview of Concurrency Control & Recovery in Distributed Databases
Overview of Concurrency Control & Recovery in Distributed Databases
Meghaj Mallick
 
Linux kernel development_ch9-10_20120410
Linux kernel development_ch9-10_20120410Linux kernel development_ch9-10_20120410
Linux kernel development_ch9-10_20120410huangachou
 
Linux kernel development chapter 10
Linux kernel development chapter 10Linux kernel development chapter 10
Linux kernel development chapter 10huangachou
 
Dbms voc 5 unit
Dbms voc 5 unitDbms voc 5 unit
Dbms voc 5 unit
gurjotkawatra
 
Concurrent control
Concurrent controlConcurrent control
Concurrent control
Felix Makundi
 
Dbms
DbmsDbms
F017213747
F017213747F017213747
F017213747
IOSR Journals
 
F017213747
F017213747F017213747
F017213747
IOSR Journals
 
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
 
7 concurrency controltwo
7 concurrency controltwo7 concurrency controltwo
7 concurrency controltwo
ashish61_scs
 
7 concurrency controltwo
7 concurrency controltwo7 concurrency controltwo
7 concurrency controltwo
ashish61_scs
 
Concurrency Control
Concurrency ControlConcurrency Control
Concurrency Control
Nishant Munjal
 
Concurrency Control in Distributed Systems.pptx
Concurrency Control in Distributed Systems.pptxConcurrency Control in Distributed Systems.pptx
Concurrency Control in Distributed Systems.pptx
MArshad35
 
Journey to Blockchain Scalability: A Close Look at Complete Scaling Solutions...
Journey to Blockchain Scalability: A Close Look at Complete Scaling Solutions...Journey to Blockchain Scalability: A Close Look at Complete Scaling Solutions...
Journey to Blockchain Scalability: A Close Look at Complete Scaling Solutions...
Zeeve
 
Real Time Operating Systems
Real Time Operating SystemsReal Time Operating Systems
Real Time Operating Systems
Murtadha Alsabbagh
 
seminarembedded-150504150805-conversion-gate02.pdf
seminarembedded-150504150805-conversion-gate02.pdfseminarembedded-150504150805-conversion-gate02.pdf
seminarembedded-150504150805-conversion-gate02.pdf
karunyamittapally
 
Mba ebooks ! Edhole
Mba ebooks ! EdholeMba ebooks ! Edhole
Mba ebooks ! Edhole
Edhole.com
 

Similar to Locking base concurrency control (20)

Vani dbms
Vani dbmsVani dbms
Vani dbms
 
UNIT II.pptx
UNIT II.pptxUNIT II.pptx
UNIT II.pptx
 
concurrency control.ppt
concurrency control.pptconcurrency control.ppt
concurrency control.ppt
 
Overview of Concurrency Control & Recovery in Distributed Databases
Overview of Concurrency Control & Recovery in Distributed DatabasesOverview of Concurrency Control & Recovery in Distributed Databases
Overview of Concurrency Control & Recovery in Distributed Databases
 
Linux kernel development_ch9-10_20120410
Linux kernel development_ch9-10_20120410Linux kernel development_ch9-10_20120410
Linux kernel development_ch9-10_20120410
 
Linux kernel development chapter 10
Linux kernel development chapter 10Linux kernel development chapter 10
Linux kernel development chapter 10
 
Dbms voc 5 unit
Dbms voc 5 unitDbms voc 5 unit
Dbms voc 5 unit
 
Concurrent control
Concurrent controlConcurrent control
Concurrent control
 
Dbms
DbmsDbms
Dbms
 
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...
 
7 concurrency controltwo
7 concurrency controltwo7 concurrency controltwo
7 concurrency controltwo
 
7 concurrency controltwo
7 concurrency controltwo7 concurrency controltwo
7 concurrency controltwo
 
Concurrency Control
Concurrency ControlConcurrency Control
Concurrency Control
 
Concurrency Control in Distributed Systems.pptx
Concurrency Control in Distributed Systems.pptxConcurrency Control in Distributed Systems.pptx
Concurrency Control in Distributed Systems.pptx
 
Journey to Blockchain Scalability: A Close Look at Complete Scaling Solutions...
Journey to Blockchain Scalability: A Close Look at Complete Scaling Solutions...Journey to Blockchain Scalability: A Close Look at Complete Scaling Solutions...
Journey to Blockchain Scalability: A Close Look at Complete Scaling Solutions...
 
Real Time Operating Systems
Real Time Operating SystemsReal Time Operating Systems
Real Time Operating Systems
 
seminarembedded-150504150805-conversion-gate02.pdf
seminarembedded-150504150805-conversion-gate02.pdfseminarembedded-150504150805-conversion-gate02.pdf
seminarembedded-150504150805-conversion-gate02.pdf
 
Mba ebooks ! Edhole
Mba ebooks ! EdholeMba ebooks ! Edhole
Mba ebooks ! Edhole
 

More from Prakash Poudel

Web applications vulnerabilities and threats
Web applications vulnerabilities and threatsWeb applications vulnerabilities and threats
Web applications vulnerabilities and threats
Prakash Poudel
 
Earliest Due Date Algorithm for Task scheduling for cloud computing
Earliest Due Date  Algorithm for Task scheduling for cloud computingEarliest Due Date  Algorithm for Task scheduling for cloud computing
Earliest Due Date Algorithm for Task scheduling for cloud computing
Prakash Poudel
 
Recent and-future-trends spm
Recent and-future-trends spmRecent and-future-trends spm
Recent and-future-trends spm
Prakash Poudel
 
Cocomo ( cot constrictive model) and capability maturity model
Cocomo ( cot constrictive model) and capability maturity modelCocomo ( cot constrictive model) and capability maturity model
Cocomo ( cot constrictive model) and capability maturity model
Prakash Poudel
 
Microprocessor
Microprocessor Microprocessor
Microprocessor
Prakash Poudel
 
Maximum power transfer theorem
Maximum power transfer theoremMaximum power transfer theorem
Maximum power transfer theorem
Prakash Poudel
 
Linux technology
Linux technologyLinux technology
Linux technology
Prakash Poudel
 
Java PU solution
Java PU solution Java PU solution
Java PU solution
Prakash Poudel
 
System administration
System administrationSystem administration
System administration
Prakash Poudel
 
Telephone call-simulation
Telephone call-simulationTelephone call-simulation
Telephone call-simulation
Prakash Poudel
 
General Online Health Information System Proposed Application
General Online Health Information System Proposed ApplicationGeneral Online Health Information System Proposed Application
General Online Health Information System Proposed Application
Prakash Poudel
 
Nepal Doorsanchar Company Limited Internship Experience
Nepal Doorsanchar Company Limited Internship Experience Nepal Doorsanchar Company Limited Internship Experience
Nepal Doorsanchar Company Limited Internship Experience
Prakash Poudel
 
SQL & PLSQL
SQL & PLSQLSQL & PLSQL
SQL & PLSQL
Prakash Poudel
 
Software engineering
Software engineeringSoftware engineering
Software engineering
Prakash Poudel
 
Multimedia Technology in computer
Multimedia Technology in computerMultimedia Technology in computer
Multimedia Technology in computer
Prakash Poudel
 
File permission in linux
File permission in linuxFile permission in linux
File permission in linux
Prakash Poudel
 
organization Management
organization Managementorganization Management
organization Management
Prakash Poudel
 
Organization Management Concept
Organization Management Concept Organization Management Concept
Organization Management Concept
Prakash Poudel
 
Java Programming concept
Java Programming concept Java Programming concept
Java Programming concept
Prakash Poudel
 

More from Prakash Poudel (20)

Web applications vulnerabilities and threats
Web applications vulnerabilities and threatsWeb applications vulnerabilities and threats
Web applications vulnerabilities and threats
 
Earliest Due Date Algorithm for Task scheduling for cloud computing
Earliest Due Date  Algorithm for Task scheduling for cloud computingEarliest Due Date  Algorithm for Task scheduling for cloud computing
Earliest Due Date Algorithm for Task scheduling for cloud computing
 
Recent and-future-trends spm
Recent and-future-trends spmRecent and-future-trends spm
Recent and-future-trends spm
 
Cocomo ( cot constrictive model) and capability maturity model
Cocomo ( cot constrictive model) and capability maturity modelCocomo ( cot constrictive model) and capability maturity model
Cocomo ( cot constrictive model) and capability maturity model
 
Microprocessor
Microprocessor Microprocessor
Microprocessor
 
Maximum power transfer theorem
Maximum power transfer theoremMaximum power transfer theorem
Maximum power transfer theorem
 
Linux technology
Linux technologyLinux technology
Linux technology
 
Java PU solution
Java PU solution Java PU solution
Java PU solution
 
System administration
System administrationSystem administration
System administration
 
Telephone call-simulation
Telephone call-simulationTelephone call-simulation
Telephone call-simulation
 
General Online Health Information System Proposed Application
General Online Health Information System Proposed ApplicationGeneral Online Health Information System Proposed Application
General Online Health Information System Proposed Application
 
Nepal Doorsanchar Company Limited Internship Experience
Nepal Doorsanchar Company Limited Internship Experience Nepal Doorsanchar Company Limited Internship Experience
Nepal Doorsanchar Company Limited Internship Experience
 
SQL & PLSQL
SQL & PLSQLSQL & PLSQL
SQL & PLSQL
 
Software engineering
Software engineeringSoftware engineering
Software engineering
 
Multimedia Technology in computer
Multimedia Technology in computerMultimedia Technology in computer
Multimedia Technology in computer
 
File permission in linux
File permission in linuxFile permission in linux
File permission in linux
 
organization Management
organization Managementorganization Management
organization Management
 
Organization Management Concept
Organization Management Concept Organization Management Concept
Organization Management Concept
 
Java Programming concept
Java Programming concept Java Programming concept
Java Programming concept
 
Letest
LetestLetest
Letest
 

Recently uploaded

AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
WENKENLI1
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
gestioneergodomus
 
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
ssuser7dcef0
 
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTSHeap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Soumen Santra
 
Technical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prismsTechnical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prisms
heavyhaig
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
SUTEJAS
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdfTutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
aqil azizi
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)
ClaraZara1
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
dxobcob
 
PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
anoopmanoharan2
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
Victor Morales
 
Swimming pool mechanical components design.pptx
Swimming pool  mechanical components design.pptxSwimming pool  mechanical components design.pptx
Swimming pool mechanical components design.pptx
yokeleetan1
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 

Recently uploaded (20)

AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
 
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
 
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTSHeap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
 
Technical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prismsTechnical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prisms
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdfTutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
 
PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
 
Swimming pool mechanical components design.pptx
Swimming pool  mechanical components design.pptxSwimming pool  mechanical components design.pptx
Swimming pool mechanical components design.pptx
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 

Locking base concurrency control

  • 1. A Research On “Lock base concurrency control” For Partial Fulfillment of the Requirements for the Degree of Master of Computer Information System Awarded by Pokhara University Date: 24 July 2019
  • 2. Table of Contents 1. Introduction.............................................................................................................................. 1 2. Locking Based Algorithms ...................................................................................................... 2 3. Lock-Based Protocols Example............................................................................................... 4 4. Lock Based protocols .............................................................................................................. 5 5. 2PL for DDBMS...................................................................................................................... 6 5.1 Centralized 2PL..................................................................................................................... 6 5.2 Primary copy 2PL ................................................................................................................. 6 5.3 Distributed 2PL..................................................................................................................... 7 6. Communication structure of the distributed 2PL..................................................................... 8 7. Conclusion............................................................................................................................... 9 8. References.............................................................................................................................. 10
  • 3. Abstract The lock base concurrency control is a well-accepted method to handle database transaction at execution time. When the multiple users try to access data at exactly the same time lock-based concurrency control manipulation and lock the database execution and provide effective data to the user. Without the concurrency control, there might be a problem with performance in a database transaction. Multiple frameworks based database concurrency control is the most important element for proper functioning
  • 4. 1 1. Introduction A lock is a variable related with an information thing that depicts a status of information thing as for conceivable activity that can be connected to it. They synchronize the entrance by simultaneous exchanges to the database things. It is required in this convention that every one of the information things must be gotten to in a fundamentally unrelated way. Give me a chance to acquaint you with two regular locks which are utilized and some wording followed in this convention. A lock is a data variable which is associated with a data item. This lock signifies that operations that can be performed on the data item. Locks help synchronize access to the database items by concurrent transactions. All lock requests are made to the concurrency-control manager. Transactions proceed only once the lock request is granted.
  • 5. 2 2. Locking Based Algorithms Locking-based concurrency algorithms ensure that data items shared by conflicting operations are accessed in a mutually exclusive way. This is accomplished by associating a “lock” with each such data item. Terminology Use in this protocol Shared Lock (S): also known as Read-only lock. As the name suggests it can be shared between transactions because while holding this lock the transaction does not have the permission to update data on the data item. S-lock is requested using lock-S instruction. Exclusive Lock (X): Data item can be both read as well as written. This is Exclusive and cannot be held simultaneously on the same data item. X-lock is requested using lock-X instruction.  Two types of locks (lock modes) o Read lock (rl) – also called shared lock o Write lock (wl) – also called exclusive lock  Compatibility matrix of locks rl i (x) wl i (x) rl j (x) Compatible not compatible wl j (x) Not compatible not compatible  General locking algorithm 1. Before using a data item x, transaction requests lock for x from the lock manager
  • 6. 3 2. If x is already locked and the existing lock is incompatible with the requested lock, the Transaction is delayed 3. Otherwise, the lock is granted.
  • 7. 4 3. Lock-Based Protocols Example Transaction performing locking: T2: lock-S (A); Read (A); Unlock (A); Lock-S (B); Read (B); Unlock (B); Display (A+B)  Locking as above is not sufficient to guarantee serializability — if A and B get updated in-between the read of A and B, the displayed sum would be wrong.  A locking protocol is a set of rules followed by all transactions while requesting and releasing locks. Locking protocols restrict the set of possible schedules
  • 8. 5 4. Lock Based protocols 4.1 Two-phase locking protocol (2PL) Each transaction is executed in two phases  Growing phase: -Transaction may obtain locks -Transaction may not release locks  Shrinking phase: the transaction releases locks - Transaction may release locks - Transaction may not obtain locks 4.1.1 Properties of the 2PL protocol Generates conflict-serializable schedules – But schedules may cause cascading aborts If a transaction aborts after it releases a lock, it may cause other transactions that have accessed the unlocked data item to abort as well.  Strict 2PL locking protocol  Holds the locks till the end of the transaction – Cascading aborts are avoided
  • 9. 6 5. 2PL for DDBMS Various extensions of the 2PL to DDBMS 5.1 Centralized 2PL A single site is responsible for the lock management, i.e., one lock manager for the whole DDBMS – Lock requests are issued to the lock manager – Coordinating transaction manager (TM at site where the transaction is initiated) can make all locking requests on behalf of local transaction managers. • Advantage: Easy to implement • Disadvantages: Bottlenecks and lower reliability Replica control protocol is additionally needed if data are replicated. 5.2 Primary copy 2PL – Several lock managers are distributed to a number of sites – Each lock manager is responsible for managing the locks for a set of data items – For replicated data items, one copy is chosen as primary copy, others are slave copies – Only the primary copy of a data item that is updated needs to be write-locked – Once primary copy has been updated, the change is propagated to the slaves • Advantages – Lower communication costs and better performance than the centralized 2PL • Disadvantages – Deadlock handling is more complex
  • 10. 7 5.3 Distributed 2PL – Lock managers are distributed to all sites – Each lock manager responsible for locks for data at that site – If data is not replicated, it is equivalent to primary copy 2PL – If data is replicated, the Read-One-Write-All (ROWA) replica control protocol is Implemented ∗ Read(x): Any copy of a replicated item x can be read by obtaining a read lock on The copy ∗ Write(x): All copies of x must be write-locked before x can be updated • Disadvantages – Deadlock handling more complex – Communication costs higher than primary copy 2PL
  • 11. 8 6. Communication structure of the distributed 2PL The coordinating TM sends the lock request to the lock managers of all participating Sites. – The LMs pass the operations to the data processors – The end of the operation is signaled to the coordinating TM Fig: Communication structure of the distributed 2PL
  • 12. 9 7. Conclusion Concurrency orders the operations of transactions such that two properties are achieved: the database is always in a consistent state and the maximum concurrencies of operations are achieved. Concurrency Control is a problem that arises when multiple processes are involved in any part of the system. In most commercial systems, the most popular mechanism for concurrency control is two-phase locking.
  • 13. 10 8. References  Principles of distributed Database System M. Tamer Ozsu (Book)  www.codex.cs.yale.edu