SlideShare a Scribd company logo
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 Database System
Distributed Database SystemDistributed Database System
Distributed Database SystemSulemang
 
Ordbms
OrdbmsOrdbms
Memory management
Memory managementMemory management
Memory management
cpjcollege
 
DDBMS
DDBMSDDBMS
Distribution transparency and Distributed transaction
Distribution transparency and Distributed transactionDistribution transparency and Distributed transaction
Distribution transparency and Distributed transaction
shraddha mane
 
Lec 7 query processing
Lec 7 query processingLec 7 query processing
Lec 7 query processing
Md. Mashiur Rahman
 
6.distributed shared memory
6.distributed shared memory6.distributed shared memory
6.distributed shared memory
Gd Goenka University
 
Naming in Distributed System
Naming in Distributed SystemNaming in Distributed System
Naming in Distributed System
MNM Jain Engineering College
 
Message and Stream Oriented Communication
Message and Stream Oriented CommunicationMessage and Stream Oriented Communication
Message and Stream Oriented Communication
Dilum Bandara
 
2. Distributed Systems Hardware & Software concepts
2. Distributed Systems Hardware & Software concepts2. Distributed Systems Hardware & Software concepts
2. Distributed Systems Hardware & Software concepts
Prajakta Rane
 
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 Database Management System
Concurrency Control in Database Management SystemConcurrency Control in Database Management System
Concurrency Control in Database Management System
Janki Shah
 
distributed shared memory
 distributed shared memory distributed shared memory
distributed shared memoryAshish Kumar
 
Ddb 1.6-design issues
Ddb 1.6-design issuesDdb 1.6-design issues
Ddb 1.6-design issues
Esar Qasmi
 
Communication primitives
Communication primitivesCommunication primitives
Communication primitives
Student
 
Operating system memory management
Operating system memory managementOperating system memory management
Operating system memory management
rprajat007
 
Distributed operating system(os)
Distributed operating system(os)Distributed operating system(os)
Distributed operating system(os)
Dinesh Modak
 
Concurrency control
Concurrency controlConcurrency control
Concurrency control
Subhasish Pati
 
program partitioning and scheduling IN Advanced Computer Architecture
program partitioning and scheduling  IN Advanced Computer Architectureprogram partitioning and scheduling  IN Advanced Computer Architecture
program partitioning and scheduling IN Advanced Computer Architecture
Pankaj Kumar Jain
 

What's hot (20)

Distributed Database System
Distributed Database SystemDistributed Database System
Distributed Database System
 
Ordbms
OrdbmsOrdbms
Ordbms
 
Memory management
Memory managementMemory management
Memory management
 
DDBMS
DDBMSDDBMS
DDBMS
 
Distribution transparency and Distributed transaction
Distribution transparency and Distributed transactionDistribution transparency and Distributed transaction
Distribution transparency and Distributed transaction
 
Lec 7 query processing
Lec 7 query processingLec 7 query processing
Lec 7 query processing
 
6.distributed shared memory
6.distributed shared memory6.distributed shared memory
6.distributed shared memory
 
Naming in Distributed System
Naming in Distributed SystemNaming in Distributed System
Naming in Distributed System
 
Message and Stream Oriented Communication
Message and Stream Oriented CommunicationMessage and Stream Oriented Communication
Message and Stream Oriented Communication
 
2. Distributed Systems Hardware & Software concepts
2. Distributed Systems Hardware & Software concepts2. Distributed Systems Hardware & Software concepts
2. Distributed Systems Hardware & Software concepts
 
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 Database Management System
Concurrency Control in Database Management SystemConcurrency Control in Database Management System
Concurrency Control in Database Management System
 
distributed shared memory
 distributed shared memory distributed shared memory
distributed shared memory
 
Ddb 1.6-design issues
Ddb 1.6-design issuesDdb 1.6-design issues
Ddb 1.6-design issues
 
Distributed database
Distributed databaseDistributed database
Distributed database
 
Communication primitives
Communication primitivesCommunication primitives
Communication primitives
 
Operating system memory management
Operating system memory managementOperating system memory management
Operating system memory management
 
Distributed operating system(os)
Distributed operating system(os)Distributed operating system(os)
Distributed operating system(os)
 
Concurrency control
Concurrency controlConcurrency control
Concurrency control
 
program partitioning and scheduling IN Advanced Computer Architecture
program partitioning and scheduling  IN Advanced Computer Architectureprogram partitioning and scheduling  IN Advanced Computer Architecture
program partitioning and scheduling IN Advanced Computer Architecture
 

Similar to Concurrency Control in Distributed Database.

concurrency control.ppt
concurrency control.pptconcurrency control.ppt
concurrency control.ppt
BikalAdhikari4
 
Vani dbms
Vani dbmsVani dbms
Vani dbms
SangeethaSasi1
 
Concurrency control ms neeti
Concurrency control ms neetiConcurrency control ms neeti
Concurrency control ms neeti
neeti arora
 
Concurrency control ms neeti
Concurrency control ms neetiConcurrency control ms neeti
Concurrency control ms neeti
neeti arora
 
Concurrent control
Concurrent controlConcurrent control
Concurrent control
Felix Makundi
 
UNIT II.pptx
UNIT II.pptxUNIT II.pptx
UNIT II.pptx
ssuserec53e73
 
Locking base concurrency control
  Locking base concurrency control  Locking base concurrency control
Locking base concurrency control
Prakash Poudel
 
Dbms
DbmsDbms
Concurrency control PPT
Concurrency control PPTConcurrency control PPT
Concurrency control PPT
ShushrutGupta
 
Rdbms
RdbmsRdbms
Concurrency control
Concurrency  controlConcurrency  control
Concurrency control
Javed Khan
 
Concurrency Control
Concurrency ControlConcurrency Control
Concurrency Control
Nishant Munjal
 
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
Abdelhafiz Khoudour
 
Transaction management
Transaction managementTransaction management
Transaction management
janani thirupathi
 
Dbms voc 5 unit
Dbms voc 5 unitDbms voc 5 unit
Dbms voc 5 unit
gurjotkawatra
 
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
 
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
 
Distributed computing
Distributed  computingDistributed  computing
Distributed computing
Swetha544947
 

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

24 partial-orderings
24 partial-orderings24 partial-orderings
24 partial-orderings
Meghaj Mallick
 
PORTFOLIO BY USING HTML & CSS
PORTFOLIO BY USING HTML & CSSPORTFOLIO BY USING HTML & CSS
PORTFOLIO BY USING HTML & CSS
Meghaj Mallick
 
Introduction to Software Testing
Introduction to Software TestingIntroduction to Software Testing
Introduction to Software Testing
Meghaj Mallick
 
Introduction to System Programming
Introduction to System ProgrammingIntroduction to System Programming
Introduction to System Programming
Meghaj Mallick
 
MACRO ASSEBLER
MACRO ASSEBLERMACRO ASSEBLER
MACRO ASSEBLER
Meghaj Mallick
 
Icons, Image & Multimedia
Icons, Image & MultimediaIcons, Image & Multimedia
Icons, Image & Multimedia
Meghaj Mallick
 
Project Tracking & SPC
Project Tracking & SPCProject Tracking & SPC
Project Tracking & SPC
Meghaj Mallick
 
Peephole Optimization
Peephole OptimizationPeephole Optimization
Peephole Optimization
Meghaj Mallick
 
Routing in MANET
Routing in MANETRouting in MANET
Routing in MANET
Meghaj Mallick
 
Macro assembler
 Macro assembler Macro assembler
Macro assembler
Meghaj Mallick
 
Architecture and security in Vanet PPT
Architecture and security in Vanet PPTArchitecture and security in Vanet PPT
Architecture and security in Vanet PPT
Meghaj 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 Engineering
Meghaj 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 Mining
Meghaj Mallick
 
DFS & BFS in Computer Algorithm
DFS & BFS in Computer AlgorithmDFS & BFS in Computer Algorithm
DFS & BFS in Computer Algorithm
Meghaj Mallick
 
Software Development Method
Software Development MethodSoftware Development Method
Software Development Method
Meghaj Mallick
 
Secant method in Numerical & Statistical Method
Secant method in Numerical & Statistical MethodSecant method in Numerical & Statistical Method
Secant method in Numerical & Statistical Method
Meghaj Mallick
 
Motivation in Organization
Motivation in OrganizationMotivation in Organization
Motivation in Organization
Meghaj Mallick
 
Communication Skill
Communication SkillCommunication Skill
Communication Skill
Meghaj Mallick
 
Partial-Orderings in Discrete Mathematics
 Partial-Orderings in Discrete Mathematics Partial-Orderings in Discrete Mathematics
Partial-Orderings in Discrete Mathematics
Meghaj 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

Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...
Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...
Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...
OECD Directorate for Financial and Enterprise Affairs
 
Media as a Mind Controlling Strategy In Old and Modern Era
Media as a Mind Controlling Strategy In Old and Modern EraMedia as a Mind Controlling Strategy In Old and Modern Era
Media as a Mind Controlling Strategy In Old and Modern Era
faizulhassanfaiz1670
 
Sharpen existing tools or get a new toolbox? Contemporary cluster initiatives...
Sharpen existing tools or get a new toolbox? Contemporary cluster initiatives...Sharpen existing tools or get a new toolbox? Contemporary cluster initiatives...
Sharpen existing tools or get a new toolbox? Contemporary cluster initiatives...
Orkestra
 
Announcement of 18th IEEE International Conference on Software Testing, Verif...
Announcement of 18th IEEE International Conference on Software Testing, Verif...Announcement of 18th IEEE International Conference on Software Testing, Verif...
Announcement of 18th IEEE International Conference on Software Testing, Verif...
Sebastiano Panichella
 
Bonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdf
Bonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdfBonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdf
Bonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdf
khadija278284
 
0x01 - Newton's Third Law: Static vs. Dynamic Abusers
0x01 - Newton's Third Law:  Static vs. Dynamic Abusers0x01 - Newton's Third Law:  Static vs. Dynamic Abusers
0x01 - Newton's Third Law: Static vs. Dynamic Abusers
OWASP Beja
 
Acorn Recovery: Restore IT infra within minutes
Acorn Recovery: Restore IT infra within minutesAcorn Recovery: Restore IT infra within minutes
Acorn Recovery: Restore IT infra within minutes
IP ServerOne
 
Bitcoin Lightning wallet and tic-tac-toe game XOXO
Bitcoin Lightning wallet and tic-tac-toe game XOXOBitcoin Lightning wallet and tic-tac-toe game XOXO
Bitcoin Lightning wallet and tic-tac-toe game XOXO
Matjaž Lipuš
 
Supercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdf
Supercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdfSupercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdf
Supercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdf
Access Innovations, Inc.
 
María Carolina Martínez - eCommerce Day Colombia 2024
María Carolina Martínez - eCommerce Day Colombia 2024María Carolina Martínez - eCommerce Day Colombia 2024
María Carolina Martínez - eCommerce Day Colombia 2024
eCommerce Institute
 
Doctoral Symposium at the 17th IEEE International Conference on Software Test...
Doctoral Symposium at the 17th IEEE International Conference on Software Test...Doctoral Symposium at the 17th IEEE International Conference on Software Test...
Doctoral Symposium at the 17th IEEE International Conference on Software Test...
Sebastiano Panichella
 
Eureka, I found it! - Special Libraries Association 2021 Presentation
Eureka, I found it! - Special Libraries Association 2021 PresentationEureka, I found it! - Special Libraries Association 2021 Presentation
Eureka, I found it! - Special Libraries Association 2021 Presentation
Access Innovations, Inc.
 
Obesity causes and management and associated medical conditions
Obesity causes and management and associated medical conditionsObesity causes and management and associated medical conditions
Obesity causes and management and associated medical conditions
Faculty of Medicine And Health Sciences
 
International Workshop on Artificial Intelligence in Software Testing
International Workshop on Artificial Intelligence in Software TestingInternational Workshop on Artificial Intelligence in Software Testing
International Workshop on Artificial Intelligence in Software Testing
Sebastiano Panichella
 
Getting started with Amazon Bedrock Studio and Control Tower
Getting started with Amazon Bedrock Studio and Control TowerGetting started with Amazon Bedrock Studio and Control Tower
Getting started with Amazon Bedrock Studio and Control Tower
Vladimir Samoylov
 
somanykidsbutsofewfathers-140705000023-phpapp02.pptx
somanykidsbutsofewfathers-140705000023-phpapp02.pptxsomanykidsbutsofewfathers-140705000023-phpapp02.pptx
somanykidsbutsofewfathers-140705000023-phpapp02.pptx
Howard Spence
 

Recently uploaded (16)

Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...
Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...
Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...
 
Media as a Mind Controlling Strategy In Old and Modern Era
Media as a Mind Controlling Strategy In Old and Modern EraMedia as a Mind Controlling Strategy In Old and Modern Era
Media as a Mind Controlling Strategy In Old and Modern Era
 
Sharpen existing tools or get a new toolbox? Contemporary cluster initiatives...
Sharpen existing tools or get a new toolbox? Contemporary cluster initiatives...Sharpen existing tools or get a new toolbox? Contemporary cluster initiatives...
Sharpen existing tools or get a new toolbox? Contemporary cluster initiatives...
 
Announcement of 18th IEEE International Conference on Software Testing, Verif...
Announcement of 18th IEEE International Conference on Software Testing, Verif...Announcement of 18th IEEE International Conference on Software Testing, Verif...
Announcement of 18th IEEE International Conference on Software Testing, Verif...
 
Bonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdf
Bonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdfBonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdf
Bonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdf
 
0x01 - Newton's Third Law: Static vs. Dynamic Abusers
0x01 - Newton's Third Law:  Static vs. Dynamic Abusers0x01 - Newton's Third Law:  Static vs. Dynamic Abusers
0x01 - Newton's Third Law: Static vs. Dynamic Abusers
 
Acorn Recovery: Restore IT infra within minutes
Acorn Recovery: Restore IT infra within minutesAcorn Recovery: Restore IT infra within minutes
Acorn Recovery: Restore IT infra within minutes
 
Bitcoin Lightning wallet and tic-tac-toe game XOXO
Bitcoin Lightning wallet and tic-tac-toe game XOXOBitcoin Lightning wallet and tic-tac-toe game XOXO
Bitcoin Lightning wallet and tic-tac-toe game XOXO
 
Supercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdf
Supercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdfSupercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdf
Supercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdf
 
María Carolina Martínez - eCommerce Day Colombia 2024
María Carolina Martínez - eCommerce Day Colombia 2024María Carolina Martínez - eCommerce Day Colombia 2024
María Carolina Martínez - eCommerce Day Colombia 2024
 
Doctoral Symposium at the 17th IEEE International Conference on Software Test...
Doctoral Symposium at the 17th IEEE International Conference on Software Test...Doctoral Symposium at the 17th IEEE International Conference on Software Test...
Doctoral Symposium at the 17th IEEE International Conference on Software Test...
 
Eureka, I found it! - Special Libraries Association 2021 Presentation
Eureka, I found it! - Special Libraries Association 2021 PresentationEureka, I found it! - Special Libraries Association 2021 Presentation
Eureka, I found it! - Special Libraries Association 2021 Presentation
 
Obesity causes and management and associated medical conditions
Obesity causes and management and associated medical conditionsObesity causes and management and associated medical conditions
Obesity causes and management and associated medical conditions
 
International Workshop on Artificial Intelligence in Software Testing
International Workshop on Artificial Intelligence in Software TestingInternational Workshop on Artificial Intelligence in Software Testing
International Workshop on Artificial Intelligence in Software Testing
 
Getting started with Amazon Bedrock Studio and Control Tower
Getting started with Amazon Bedrock Studio and Control TowerGetting started with Amazon Bedrock Studio and Control Tower
Getting started with Amazon Bedrock Studio and Control Tower
 
somanykidsbutsofewfathers-140705000023-phpapp02.pptx
somanykidsbutsofewfathers-140705000023-phpapp02.pptxsomanykidsbutsofewfathers-140705000023-phpapp02.pptx
somanykidsbutsofewfathers-140705000023-phpapp02.pptx
 

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.