SlideShare a Scribd company logo
1 of 20
Presented By:
MAYANK SETH
ARUN BRIJWASI
CONTENTS
Meaning of distributed database
Introduction to concurrency control
Locking based protocols
Timestamping
Distributed databases
 A distributed database is a single logical database that is
spread physically across the computer in multiple location
that are connected by data communication links.
 Distributed database is a kind of virtual database whose
components parts are physically stored in a number of
distinct real database at a number of distinct location.
CONCURRENCY
A situation in which two or more persons access the same
records simultaneously is called concurrency
Concurrency control involve the synchronization of access to
the distributed database, such that the integrity of the
database is maintained.
Concurrency control
Concurrency control can be achieved
through:
Locking protocols
Timestamping
Lock-Based Protocols
 A lock is a mechanism to control concurrent access to
a data item.
 Data items can be locked in two modes :
 Exclusive (X) mode. Data item can be both read as
well as written. X-lock is requested using lock-X
instruction.
 Shared (S) mode. Data item can only be read. S-lock
is requested using lock-S instruction.
 Lock requests are made to concurrency-control
manager. Transaction can proceed only after request is
granted.
Lock-Based Protocols (Cont.)
A transaction may be granted a lock on an item if the
requested lock is compatible with locks already held on the
item by other transactions
Any number of transactions can hold shared locks on an
item, but if any transaction holds an exclusive on the item no
other transaction may hold any lock on the item.
If a lock cannot be granted, the requesting transaction is
made to wait till all incompatible locks held by other
transactions have been released. The lock is then granted.
Lock based protocols
Lock based concurrency control
can either be :
One phase locking protocol
Two phase locking protocol
One phase locking protocol
In this method each transaction
locks an item before use and
releases the lock as soon as it has
finished using it.
Two phase locking protocol
This protocol requires that each transaction
issue lock and unlock request in 2 phases:
 First phase: a transaction only acquires all
the locks it needs and do not release any
lock. This phase is called growing phase.
Second phase: a transaction releases the
locks and cannot request any new locks. This
phase is called shrinking phase.
Various locking protocols
The various locking protocols that can be used in
distributed databases in following manner:
Single lock manager approach
Distributed lock manager approach
Primary copy
Majority protocol
Single lock manager protocol
The system maintains a single lock manager
that resides in a single chosen site—say Si .
All lock and unlock requests are made at site
Si .
When a transaction needs to lock a data
item, it sends a lock request to Si .
The lock manager determines whether
the lock can be granted immediately.
 If the lock can be granted, the lock
manager sends a message to that effect
to the site at which the lock request was
initiated.
Otherwise, the request is delayed until it
can be granted, at which time a message
is sent to the site at which the lock
request was initiated.
Distributed lock manager
The lock-manager function is distributed over
several sites.
Each site maintains a local lock manager whose
function is to administer the lock and unlock
requests for those data items that are stored in
that site.
When a transaction wishes to lock a data item Q
that is not replicated and resides at site Si , a
message is sent to the lock manager at site Si
requesting a lock (in a particular lock mode).
 If data item Q is locked in an incompatible
mode, then the request is delayed until it can
be granted.
 Once it has determined that the lock request
can be granted, the lock manager sends a
message back to the initiator indicating thatit
has granted the lock request.
Primary copy
When a system uses data replication, we can choose one
of the replicas as the primary copy.
For each data item Q, the primary copy of Q must reside in
precisely one site, which we call the primary site of Q.
When a transaction needs to lock a data item Q, it requests
a lock at the primary site of Q.
The response to the request is delayed until it can be
granted.
The primary copy enables concurrency control for
replicated data to be handled like that for unreplicated data.
Majority protocol
If data item Q is replicated in n different sites, then a
lock-request message must be sent to more than one-
half of the n sites in which Q is stored.
 Each lock manager determines whether the lock can
be granted immediately.
The response is delayed until the request can be
granted.
The transaction does not operate on Q until it has
successfully obtained a lock on a majority of the
replicas of Q.
Timestamp-Based Protocols
Each transaction is given a unique timestamp that the system
uses in deciding the serialization order.
The protocol manages concurrent execution such that the
timestamps determine the serializability order.
In order to assure such behavior, the protocol maintains for
each data Q two timestamp values:
 W-timestamp(Q) is the largest time-stamp of any transaction that
executed write(Q) successfully.
R-timestamp(Q) is the largest time-stamp of any transaction
that executed read(Q) successfully.
In generalizing the centralized scheme to a distributed
scheme is to develop a scheme for generating unique
timestamps.
There are two primary methods for generating unique
timestamps, one centralized and one distributed.
 In the centralized scheme, a single site distributes the
timestamps.
In the distributed scheme, each site generates a unique
local timestamp by using either a logical counter or the
local clock.
 We obtain the unique global timestamp by
concatenating the unique local timestamp with the site
identifier, which also must be unique.
Concurrency Control in Distributed Database.

More Related Content

What's hot

Distributed design alternatives
Distributed design alternativesDistributed design alternatives
Distributed design alternativesPooja Dixit
 
File models and file accessing models
File models and file accessing modelsFile models and file accessing models
File models and file accessing modelsishmecse13
 
Types of Load distributing algorithm in Distributed System
Types of Load distributing algorithm in Distributed SystemTypes of Load distributing algorithm in Distributed System
Types of Load distributing algorithm in Distributed SystemDHIVYADEVAKI
 
Structure of the page table
Structure of the page tableStructure of the page table
Structure of the page tableduvvuru madhuri
 
17. Recovery System in DBMS
17. Recovery System in DBMS17. Recovery System in DBMS
17. Recovery System in DBMSkoolkampus
 
Concurrency Control in Database Management System
Concurrency Control in Database Management SystemConcurrency Control in Database Management System
Concurrency Control in Database Management SystemJanki Shah
 
file sharing semantics by Umar Danjuma Maiwada
file sharing semantics by Umar Danjuma Maiwada file sharing semantics by Umar Danjuma Maiwada
file sharing semantics by Umar Danjuma Maiwada umardanjumamaiwada
 
Distributed operating system
Distributed operating systemDistributed operating system
Distributed operating systemudaya khanal
 
Deadlock in Distributed Systems
Deadlock in Distributed SystemsDeadlock in Distributed Systems
Deadlock in Distributed SystemsPritom Saha Akash
 
Load Balancing in Parallel and Distributed Database
Load Balancing in Parallel and Distributed DatabaseLoad Balancing in Parallel and Distributed Database
Load Balancing in Parallel and Distributed DatabaseMd. Shamsur Rahim
 
management of distributed transactions
management of distributed transactionsmanagement of distributed transactions
management of distributed transactionsNilu Desai
 
Distributed File Systems
Distributed File Systems Distributed File Systems
Distributed File Systems Maurvi04
 

What's hot (20)

Distributed design alternatives
Distributed design alternativesDistributed design alternatives
Distributed design alternatives
 
File models and file accessing models
File models and file accessing modelsFile models and file accessing models
File models and file accessing models
 
Types of Load distributing algorithm in Distributed System
Types of Load distributing algorithm in Distributed SystemTypes of Load distributing algorithm in Distributed System
Types of Load distributing algorithm in Distributed System
 
Distributed database
Distributed databaseDistributed database
Distributed database
 
Structure of the page table
Structure of the page tableStructure of the page table
Structure of the page table
 
17. Recovery System in DBMS
17. Recovery System in DBMS17. Recovery System in DBMS
17. Recovery System in DBMS
 
Concurrency Control in Database Management System
Concurrency Control in Database Management SystemConcurrency Control in Database Management System
Concurrency Control in Database Management System
 
file sharing semantics by Umar Danjuma Maiwada
file sharing semantics by Umar Danjuma Maiwada file sharing semantics by Umar Danjuma Maiwada
file sharing semantics by Umar Danjuma Maiwada
 
2 phase locking protocol DBMS
2 phase locking protocol DBMS2 phase locking protocol DBMS
2 phase locking protocol DBMS
 
Distributed operating system
Distributed operating systemDistributed operating system
Distributed operating system
 
Database System Architectures
Database System ArchitecturesDatabase System Architectures
Database System Architectures
 
Deadlock Prevention
Deadlock PreventionDeadlock Prevention
Deadlock Prevention
 
Deadlock in Distributed Systems
Deadlock in Distributed SystemsDeadlock in Distributed Systems
Deadlock in Distributed Systems
 
Disk structure
Disk structureDisk structure
Disk structure
 
Lec 7 query processing
Lec 7 query processingLec 7 query processing
Lec 7 query processing
 
Load Balancing in Parallel and Distributed Database
Load Balancing in Parallel and Distributed DatabaseLoad Balancing in Parallel and Distributed Database
Load Balancing in Parallel and Distributed Database
 
The CAP Theorem
The CAP Theorem The CAP Theorem
The CAP Theorem
 
Mainframe systems
Mainframe systemsMainframe systems
Mainframe systems
 
management of distributed transactions
management of distributed transactionsmanagement of distributed transactions
management of distributed transactions
 
Distributed File Systems
Distributed File Systems Distributed File Systems
Distributed File Systems
 

Similar to Concurrency Control in Distributed Database.

concurrency control.ppt
concurrency control.pptconcurrency control.ppt
concurrency control.pptBikalAdhikari4
 
Concurrency control ms neeti
Concurrency control ms neetiConcurrency control ms neeti
Concurrency control ms neetineeti arora
 
Concurrency control ms neeti
Concurrency control ms neetiConcurrency control ms neeti
Concurrency control ms neetineeti arora
 
Locking base concurrency control
  Locking base concurrency control  Locking base concurrency control
Locking base concurrency controlPrakash Poudel
 
Concurrency control PPT
Concurrency control PPTConcurrency control PPT
Concurrency control PPTShushrutGupta
 
Concurrency control
Concurrency  controlConcurrency  control
Concurrency controlJaved Khan
 
Concurrency of Issues of Distributed Advance Transaction
Concurrency of Issues of Distributed Advance TransactionConcurrency of Issues of Distributed Advance Transaction
Concurrency of Issues of Distributed Advance TransactionAbdelhafiz Khoudour
 
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 DatabasesMeghaj Mallick
 
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
 
Distributed computing
Distributed  computingDistributed  computing
Distributed computingSwetha544947
 

Similar to Concurrency Control in Distributed Database. (20)

concurrency control.ppt
concurrency control.pptconcurrency control.ppt
concurrency control.ppt
 
Vani dbms
Vani dbmsVani dbms
Vani dbms
 
Concurrency control ms neeti
Concurrency control ms neetiConcurrency control ms neeti
Concurrency control ms neeti
 
Concurrency control ms neeti
Concurrency control ms neetiConcurrency control ms neeti
Concurrency control ms neeti
 
Concurrent control
Concurrent controlConcurrent control
Concurrent control
 
UNIT II.pptx
UNIT II.pptxUNIT II.pptx
UNIT II.pptx
 
Locking base concurrency control
  Locking base concurrency control  Locking base concurrency control
Locking base concurrency control
 
Dbms
DbmsDbms
Dbms
 
Concurrency control PPT
Concurrency control PPTConcurrency control PPT
Concurrency control PPT
 
Rdbms
RdbmsRdbms
Rdbms
 
Concurrency control
Concurrency  controlConcurrency  control
Concurrency control
 
Concurrency Control
Concurrency ControlConcurrency Control
Concurrency Control
 
Concurrency of Issues of Distributed Advance Transaction
Concurrency of Issues of Distributed Advance TransactionConcurrency of Issues of Distributed Advance Transaction
Concurrency of Issues of Distributed Advance Transaction
 
Transaction management
Transaction managementTransaction management
Transaction management
 
Dbms voc 5 unit
Dbms voc 5 unitDbms voc 5 unit
Dbms voc 5 unit
 
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
 
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...
 
Distributed computing
Distributed  computingDistributed  computing
Distributed computing
 

More from Meghaj Mallick

PORTFOLIO BY USING HTML & CSS
PORTFOLIO BY USING HTML & CSSPORTFOLIO BY USING HTML & CSS
PORTFOLIO BY USING HTML & CSSMeghaj Mallick
 
Introduction to Software Testing
Introduction to Software TestingIntroduction to Software Testing
Introduction to Software TestingMeghaj Mallick
 
Introduction to System Programming
Introduction to System ProgrammingIntroduction to System Programming
Introduction to System ProgrammingMeghaj Mallick
 
Icons, Image & Multimedia
Icons, Image & MultimediaIcons, Image & Multimedia
Icons, Image & MultimediaMeghaj Mallick
 
Project Tracking & SPC
Project Tracking & SPCProject Tracking & SPC
Project Tracking & SPCMeghaj Mallick
 
Architecture and security in Vanet PPT
Architecture and security in Vanet PPTArchitecture and security in Vanet PPT
Architecture and security in Vanet PPTMeghaj Mallick
 
Design Model & User Interface Design in Software Engineering
Design Model & User Interface Design in Software EngineeringDesign Model & User Interface Design in Software Engineering
Design Model & User Interface Design in Software EngineeringMeghaj Mallick
 
Text Mining of Twitter in Data Mining
Text Mining of Twitter in Data MiningText Mining of Twitter in Data Mining
Text Mining of Twitter in Data MiningMeghaj Mallick
 
DFS & BFS in Computer Algorithm
DFS & BFS in Computer AlgorithmDFS & BFS in Computer Algorithm
DFS & BFS in Computer AlgorithmMeghaj Mallick
 
Software Development Method
Software Development MethodSoftware Development Method
Software Development MethodMeghaj Mallick
 
Secant method in Numerical & Statistical Method
Secant method in Numerical & Statistical MethodSecant method in Numerical & Statistical Method
Secant method in Numerical & Statistical MethodMeghaj Mallick
 
Motivation in Organization
Motivation in OrganizationMotivation in Organization
Motivation in OrganizationMeghaj Mallick
 
Partial-Orderings in Discrete Mathematics
 Partial-Orderings in Discrete Mathematics Partial-Orderings in Discrete Mathematics
Partial-Orderings in Discrete MathematicsMeghaj Mallick
 
Hashing In Data Structure
Hashing In Data Structure Hashing In Data Structure
Hashing In Data Structure Meghaj Mallick
 

More from Meghaj Mallick (20)

24 partial-orderings
24 partial-orderings24 partial-orderings
24 partial-orderings
 
PORTFOLIO BY USING HTML & CSS
PORTFOLIO BY USING HTML & CSSPORTFOLIO BY USING HTML & CSS
PORTFOLIO BY USING HTML & CSS
 
Introduction to Software Testing
Introduction to Software TestingIntroduction to Software Testing
Introduction to Software Testing
 
Introduction to System Programming
Introduction to System ProgrammingIntroduction to System Programming
Introduction to System Programming
 
MACRO ASSEBLER
MACRO ASSEBLERMACRO ASSEBLER
MACRO ASSEBLER
 
Icons, Image & Multimedia
Icons, Image & MultimediaIcons, Image & Multimedia
Icons, Image & Multimedia
 
Project Tracking & SPC
Project Tracking & SPCProject Tracking & SPC
Project Tracking & SPC
 
Peephole Optimization
Peephole OptimizationPeephole Optimization
Peephole Optimization
 
Routing in MANET
Routing in MANETRouting in MANET
Routing in MANET
 
Macro assembler
 Macro assembler Macro assembler
Macro assembler
 
Architecture and security in Vanet PPT
Architecture and security in Vanet PPTArchitecture and security in Vanet PPT
Architecture and security in Vanet PPT
 
Design Model & User Interface Design in Software Engineering
Design Model & User Interface Design in Software EngineeringDesign Model & User Interface Design in Software Engineering
Design Model & User Interface Design in Software Engineering
 
Text Mining of Twitter in Data Mining
Text Mining of Twitter in Data MiningText Mining of Twitter in Data Mining
Text Mining of Twitter in Data Mining
 
DFS & BFS in Computer Algorithm
DFS & BFS in Computer AlgorithmDFS & BFS in Computer Algorithm
DFS & BFS in Computer Algorithm
 
Software Development Method
Software Development MethodSoftware Development Method
Software Development Method
 
Secant method in Numerical & Statistical Method
Secant method in Numerical & Statistical MethodSecant method in Numerical & Statistical Method
Secant method in Numerical & Statistical Method
 
Motivation in Organization
Motivation in OrganizationMotivation in Organization
Motivation in Organization
 
Communication Skill
Communication SkillCommunication Skill
Communication Skill
 
Partial-Orderings in Discrete Mathematics
 Partial-Orderings in Discrete Mathematics Partial-Orderings in Discrete Mathematics
Partial-Orderings in Discrete Mathematics
 
Hashing In Data Structure
Hashing In Data Structure Hashing In Data Structure
Hashing In Data Structure
 

Recently uploaded

Philippine History cavite Mutiny Report.ppt
Philippine History cavite Mutiny Report.pptPhilippine History cavite Mutiny Report.ppt
Philippine History cavite Mutiny Report.pptssuser319dad
 
OSCamp Kubernetes 2024 | A Tester's Guide to CI_CD as an Automated Quality Co...
OSCamp Kubernetes 2024 | A Tester's Guide to CI_CD as an Automated Quality Co...OSCamp Kubernetes 2024 | A Tester's Guide to CI_CD as an Automated Quality Co...
OSCamp Kubernetes 2024 | A Tester's Guide to CI_CD as an Automated Quality Co...NETWAYS
 
Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...
Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...
Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...NETWAYS
 
Genshin Impact PPT Template by EaTemp.pptx
Genshin Impact PPT Template by EaTemp.pptxGenshin Impact PPT Template by EaTemp.pptx
Genshin Impact PPT Template by EaTemp.pptxJohnree4
 
Mathan flower ppt.pptx slide orchids ✨🌸
Mathan flower ppt.pptx slide orchids ✨🌸Mathan flower ppt.pptx slide orchids ✨🌸
Mathan flower ppt.pptx slide orchids ✨🌸mathanramanathan2005
 
Event 4 Introduction to Open Source.pptx
Event 4 Introduction to Open Source.pptxEvent 4 Introduction to Open Source.pptx
Event 4 Introduction to Open Source.pptxaryanv1753
 
LANDMARKS AND MONUMENTS IN NIGERIA.pptx
LANDMARKS  AND MONUMENTS IN NIGERIA.pptxLANDMARKS  AND MONUMENTS IN NIGERIA.pptx
LANDMARKS AND MONUMENTS IN NIGERIA.pptxBasil Achie
 
Open Source Camp Kubernetes 2024 | Monitoring Kubernetes With Icinga by Eric ...
Open Source Camp Kubernetes 2024 | Monitoring Kubernetes With Icinga by Eric ...Open Source Camp Kubernetes 2024 | Monitoring Kubernetes With Icinga by Eric ...
Open Source Camp Kubernetes 2024 | Monitoring Kubernetes With Icinga by Eric ...NETWAYS
 
CTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdf
CTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdfCTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdf
CTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdfhenrik385807
 
SBFT Tool Competition 2024 -- Python Test Case Generation Track
SBFT Tool Competition 2024 -- Python Test Case Generation TrackSBFT Tool Competition 2024 -- Python Test Case Generation Track
SBFT Tool Competition 2024 -- Python Test Case Generation TrackSebastiano Panichella
 
OSCamp Kubernetes 2024 | SRE Challenges in Monolith to Microservices Shift at...
OSCamp Kubernetes 2024 | SRE Challenges in Monolith to Microservices Shift at...OSCamp Kubernetes 2024 | SRE Challenges in Monolith to Microservices Shift at...
OSCamp Kubernetes 2024 | SRE Challenges in Monolith to Microservices Shift at...NETWAYS
 
The 3rd Intl. Workshop on NL-based Software Engineering
The 3rd Intl. Workshop on NL-based Software EngineeringThe 3rd Intl. Workshop on NL-based Software Engineering
The 3rd Intl. Workshop on NL-based Software EngineeringSebastiano Panichella
 
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...Krijn Poppe
 
The Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism PresentationThe Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism PresentationNathan Young
 
NATIONAL ANTHEMS OF AFRICA (National Anthems of Africa)
NATIONAL ANTHEMS OF AFRICA (National Anthems of Africa)NATIONAL ANTHEMS OF AFRICA (National Anthems of Africa)
NATIONAL ANTHEMS OF AFRICA (National Anthems of Africa)Basil Achie
 
Work Remotely with Confluence ACE 2.pptx
Work Remotely with Confluence ACE 2.pptxWork Remotely with Confluence ACE 2.pptx
Work Remotely with Confluence ACE 2.pptxmavinoikein
 
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdf
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdfOpen Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdf
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdfhenrik385807
 
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...henrik385807
 
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...Pooja Nehwal
 
OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...
OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...
OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...NETWAYS
 

Recently uploaded (20)

Philippine History cavite Mutiny Report.ppt
Philippine History cavite Mutiny Report.pptPhilippine History cavite Mutiny Report.ppt
Philippine History cavite Mutiny Report.ppt
 
OSCamp Kubernetes 2024 | A Tester's Guide to CI_CD as an Automated Quality Co...
OSCamp Kubernetes 2024 | A Tester's Guide to CI_CD as an Automated Quality Co...OSCamp Kubernetes 2024 | A Tester's Guide to CI_CD as an Automated Quality Co...
OSCamp Kubernetes 2024 | A Tester's Guide to CI_CD as an Automated Quality Co...
 
Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...
Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...
Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...
 
Genshin Impact PPT Template by EaTemp.pptx
Genshin Impact PPT Template by EaTemp.pptxGenshin Impact PPT Template by EaTemp.pptx
Genshin Impact PPT Template by EaTemp.pptx
 
Mathan flower ppt.pptx slide orchids ✨🌸
Mathan flower ppt.pptx slide orchids ✨🌸Mathan flower ppt.pptx slide orchids ✨🌸
Mathan flower ppt.pptx slide orchids ✨🌸
 
Event 4 Introduction to Open Source.pptx
Event 4 Introduction to Open Source.pptxEvent 4 Introduction to Open Source.pptx
Event 4 Introduction to Open Source.pptx
 
LANDMARKS AND MONUMENTS IN NIGERIA.pptx
LANDMARKS  AND MONUMENTS IN NIGERIA.pptxLANDMARKS  AND MONUMENTS IN NIGERIA.pptx
LANDMARKS AND MONUMENTS IN NIGERIA.pptx
 
Open Source Camp Kubernetes 2024 | Monitoring Kubernetes With Icinga by Eric ...
Open Source Camp Kubernetes 2024 | Monitoring Kubernetes With Icinga by Eric ...Open Source Camp Kubernetes 2024 | Monitoring Kubernetes With Icinga by Eric ...
Open Source Camp Kubernetes 2024 | Monitoring Kubernetes With Icinga by Eric ...
 
CTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdf
CTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdfCTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdf
CTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdf
 
SBFT Tool Competition 2024 -- Python Test Case Generation Track
SBFT Tool Competition 2024 -- Python Test Case Generation TrackSBFT Tool Competition 2024 -- Python Test Case Generation Track
SBFT Tool Competition 2024 -- Python Test Case Generation Track
 
OSCamp Kubernetes 2024 | SRE Challenges in Monolith to Microservices Shift at...
OSCamp Kubernetes 2024 | SRE Challenges in Monolith to Microservices Shift at...OSCamp Kubernetes 2024 | SRE Challenges in Monolith to Microservices Shift at...
OSCamp Kubernetes 2024 | SRE Challenges in Monolith to Microservices Shift at...
 
The 3rd Intl. Workshop on NL-based Software Engineering
The 3rd Intl. Workshop on NL-based Software EngineeringThe 3rd Intl. Workshop on NL-based Software Engineering
The 3rd Intl. Workshop on NL-based Software Engineering
 
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...
 
The Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism PresentationThe Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism Presentation
 
NATIONAL ANTHEMS OF AFRICA (National Anthems of Africa)
NATIONAL ANTHEMS OF AFRICA (National Anthems of Africa)NATIONAL ANTHEMS OF AFRICA (National Anthems of Africa)
NATIONAL ANTHEMS OF AFRICA (National Anthems of Africa)
 
Work Remotely with Confluence ACE 2.pptx
Work Remotely with Confluence ACE 2.pptxWork Remotely with Confluence ACE 2.pptx
Work Remotely with Confluence ACE 2.pptx
 
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdf
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdfOpen Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdf
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdf
 
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...
 
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...
 
OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...
OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...
OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...
 

Concurrency Control in Distributed Database.

  • 2. CONTENTS Meaning of distributed database Introduction to concurrency control Locking based protocols Timestamping
  • 3. Distributed databases  A distributed database is a single logical database that is spread physically across the computer in multiple location that are connected by data communication links.  Distributed database is a kind of virtual database whose components parts are physically stored in a number of distinct real database at a number of distinct location.
  • 4. CONCURRENCY A situation in which two or more persons access the same records simultaneously is called concurrency Concurrency control involve the synchronization of access to the distributed database, such that the integrity of the database is maintained.
  • 5. Concurrency control Concurrency control can be achieved through: Locking protocols Timestamping
  • 6. Lock-Based Protocols  A lock is a mechanism to control concurrent access to a data item.  Data items can be locked in two modes :  Exclusive (X) mode. Data item can be both read as well as written. X-lock is requested using lock-X instruction.  Shared (S) mode. Data item can only be read. S-lock is requested using lock-S instruction.  Lock requests are made to concurrency-control manager. Transaction can proceed only after request is granted.
  • 7. Lock-Based Protocols (Cont.) A transaction may be granted a lock on an item if the requested lock is compatible with locks already held on the item by other transactions Any number of transactions can hold shared locks on an item, but if any transaction holds an exclusive on the item no other transaction may hold any lock on the item. If a lock cannot be granted, the requesting transaction is made to wait till all incompatible locks held by other transactions have been released. The lock is then granted.
  • 8. Lock based protocols Lock based concurrency control can either be : One phase locking protocol Two phase locking protocol
  • 9. One phase locking protocol In this method each transaction locks an item before use and releases the lock as soon as it has finished using it.
  • 10. Two phase locking protocol This protocol requires that each transaction issue lock and unlock request in 2 phases:  First phase: a transaction only acquires all the locks it needs and do not release any lock. This phase is called growing phase. Second phase: a transaction releases the locks and cannot request any new locks. This phase is called shrinking phase.
  • 11. Various locking protocols The various locking protocols that can be used in distributed databases in following manner: Single lock manager approach Distributed lock manager approach Primary copy Majority protocol
  • 12. Single lock manager protocol The system maintains a single lock manager that resides in a single chosen site—say Si . All lock and unlock requests are made at site Si . When a transaction needs to lock a data item, it sends a lock request to Si .
  • 13. The lock manager determines whether the lock can be granted immediately.  If the lock can be granted, the lock manager sends a message to that effect to the site at which the lock request was initiated. Otherwise, the request is delayed until it can be granted, at which time a message is sent to the site at which the lock request was initiated.
  • 14. Distributed lock manager The lock-manager function is distributed over several sites. Each site maintains a local lock manager whose function is to administer the lock and unlock requests for those data items that are stored in that site. When a transaction wishes to lock a data item Q that is not replicated and resides at site Si , a message is sent to the lock manager at site Si requesting a lock (in a particular lock mode).
  • 15.  If data item Q is locked in an incompatible mode, then the request is delayed until it can be granted.  Once it has determined that the lock request can be granted, the lock manager sends a message back to the initiator indicating thatit has granted the lock request.
  • 16. Primary copy When a system uses data replication, we can choose one of the replicas as the primary copy. For each data item Q, the primary copy of Q must reside in precisely one site, which we call the primary site of Q. When a transaction needs to lock a data item Q, it requests a lock at the primary site of Q. The response to the request is delayed until it can be granted. The primary copy enables concurrency control for replicated data to be handled like that for unreplicated data.
  • 17. Majority protocol If data item Q is replicated in n different sites, then a lock-request message must be sent to more than one- half of the n sites in which Q is stored.  Each lock manager determines whether the lock can be granted immediately. The response is delayed until the request can be granted. The transaction does not operate on Q until it has successfully obtained a lock on a majority of the replicas of Q.
  • 18. Timestamp-Based Protocols Each transaction is given a unique timestamp that the system uses in deciding the serialization order. The protocol manages concurrent execution such that the timestamps determine the serializability order. In order to assure such behavior, the protocol maintains for each data Q two timestamp values:  W-timestamp(Q) is the largest time-stamp of any transaction that executed write(Q) successfully. R-timestamp(Q) is the largest time-stamp of any transaction that executed read(Q) successfully.
  • 19. In generalizing the centralized scheme to a distributed scheme is to develop a scheme for generating unique timestamps. There are two primary methods for generating unique timestamps, one centralized and one distributed.  In the centralized scheme, a single site distributes the timestamps. In the distributed scheme, each site generates a unique local timestamp by using either a logical counter or the local clock.  We obtain the unique global timestamp by concatenating the unique local timestamp with the site identifier, which also must be unique.