SlideShare a Scribd company logo
4
Most read
5
Most read
6
Most read
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 (20)

PPTX
Distributed dbms architectures
Pooja Dixit
 
PPTX
Server system architecture
Faiza Hafeez
 
PPTX
DISTRIBUTED DATABASE WITH RECOVERY TECHNIQUES
AAKANKSHA JAIN
 
PPTX
Distributed DBMS - Unit 6 - Query Processing
Gyanmanjari Institute Of Technology
 
PPTX
Query processing in Distributed Database System
Meghaj Mallick
 
PPTX
Fragmentation and types of fragmentation in Distributed Database
Abhilasha Lahigude
 
PPT
Clock synchronization in distributed system
Sunita Sahu
 
PPTX
Database , 8 Query Optimization
Ali Usman
 
PPTX
Distributed concurrency control
Binte fatima
 
PPTX
Inter Process Communication
Adeel Rasheed
 
PPTX
Graph coloring using backtracking
shashidharPapishetty
 
PPTX
Validation based protocol
BBDITM LUCKNOW
 
PPTX
INTER PROCESS COMMUNICATION (IPC).pptx
LECO9
 
PPTX
Message and Stream Oriented Communication
Dilum Bandara
 
PDF
Distributed Coordination-Based Systems
Ahmed Magdy Ezzeldin, MSc.
 
PDF
Distributed deadlock
Md. Mahedi Mahfuj
 
PPTX
Transport layer
reshmadayma
 
PPT
Query Decomposition and data localization
Hafiz faiz
 
PPTX
Process management os concept
priyadeosarkar91
 
PPTX
File Management in Operating System
Janki Shah
 
Distributed dbms architectures
Pooja Dixit
 
Server system architecture
Faiza Hafeez
 
DISTRIBUTED DATABASE WITH RECOVERY TECHNIQUES
AAKANKSHA JAIN
 
Distributed DBMS - Unit 6 - Query Processing
Gyanmanjari Institute Of Technology
 
Query processing in Distributed Database System
Meghaj Mallick
 
Fragmentation and types of fragmentation in Distributed Database
Abhilasha Lahigude
 
Clock synchronization in distributed system
Sunita Sahu
 
Database , 8 Query Optimization
Ali Usman
 
Distributed concurrency control
Binte fatima
 
Inter Process Communication
Adeel Rasheed
 
Graph coloring using backtracking
shashidharPapishetty
 
Validation based protocol
BBDITM LUCKNOW
 
INTER PROCESS COMMUNICATION (IPC).pptx
LECO9
 
Message and Stream Oriented Communication
Dilum Bandara
 
Distributed Coordination-Based Systems
Ahmed Magdy Ezzeldin, MSc.
 
Distributed deadlock
Md. Mahedi Mahfuj
 
Transport layer
reshmadayma
 
Query Decomposition and data localization
Hafiz faiz
 
Process management os concept
priyadeosarkar91
 
File Management in Operating System
Janki Shah
 

Similar to Concurrency Control in Distributed Database. (20)

PPT
concurrency control.ppt
BikalAdhikari4
 
PPTX
Vani dbms
SangeethaSasi1
 
PPT
Concurrency control ms neeti
neeti arora
 
PPT
Concurrency control ms neeti
neeti arora
 
PPTX
Concurrent control
Felix Makundi
 
PDF
Advanced Database Chapter 4.pdf shnsbxlajmndm woweosmkl m,xcnkl C NOOxcx xcbnxc
alemunuruhak9
 
DOCX
Locking base concurrency control
Prakash Poudel
 
PPTX
Dbms
kasthurimukila
 
PPTX
Concurrency control PPT
ShushrutGupta
 
PPTX
Concurrency control
Javed Khan
 
PPTX
Concurrency Control
Nishant Munjal
 
PPTX
Concurrency of Issues of Distributed Advance Transaction
Abdelhafiz Khoudour
 
PPTX
Transaction management
janani thirupathi
 
DOCX
Dbms voc 5 unit
gurjotkawatra
 
PPTX
Overview of Concurrency Control & Recovery in Distributed Databases
Meghaj Mallick
 
PDF
F017213747
IOSR Journals
 
PDF
Design & Development of an Advanced Database Management System Using Multiver...
IOSR Journals
 
PDF
F017213747
IOSR Journals
 
PPT
Concurrency Control power point presentations.ppt
luffy0monkey11
 
concurrency control.ppt
BikalAdhikari4
 
Vani dbms
SangeethaSasi1
 
Concurrency control ms neeti
neeti arora
 
Concurrency control ms neeti
neeti arora
 
Concurrent control
Felix Makundi
 
Advanced Database Chapter 4.pdf shnsbxlajmndm woweosmkl m,xcnkl C NOOxcx xcbnxc
alemunuruhak9
 
Locking base concurrency control
Prakash Poudel
 
Concurrency control PPT
ShushrutGupta
 
Concurrency control
Javed Khan
 
Concurrency Control
Nishant Munjal
 
Concurrency of Issues of Distributed Advance Transaction
Abdelhafiz Khoudour
 
Transaction management
janani thirupathi
 
Dbms voc 5 unit
gurjotkawatra
 
Overview of Concurrency Control & Recovery in Distributed Databases
Meghaj Mallick
 
F017213747
IOSR Journals
 
Design & Development of an Advanced Database Management System Using Multiver...
IOSR Journals
 
F017213747
IOSR Journals
 
Concurrency Control power point presentations.ppt
luffy0monkey11
 
Ad

More from Meghaj Mallick (20)

PPT
24 partial-orderings
Meghaj Mallick
 
PPTX
PORTFOLIO BY USING HTML & CSS
Meghaj Mallick
 
PPTX
Introduction to Software Testing
Meghaj Mallick
 
PPTX
Introduction to System Programming
Meghaj Mallick
 
PPTX
MACRO ASSEBLER
Meghaj Mallick
 
PPTX
Icons, Image & Multimedia
Meghaj Mallick
 
PPTX
Project Tracking & SPC
Meghaj Mallick
 
PPTX
Peephole Optimization
Meghaj Mallick
 
PPTX
Routing in MANET
Meghaj Mallick
 
PPTX
Macro assembler
Meghaj Mallick
 
PPTX
Architecture and security in Vanet PPT
Meghaj Mallick
 
PPTX
Design Model & User Interface Design in Software Engineering
Meghaj Mallick
 
PPTX
Text Mining of Twitter in Data Mining
Meghaj Mallick
 
PPTX
DFS & BFS in Computer Algorithm
Meghaj Mallick
 
PPTX
Software Development Method
Meghaj Mallick
 
PPTX
Secant method in Numerical & Statistical Method
Meghaj Mallick
 
PPTX
Motivation in Organization
Meghaj Mallick
 
PPTX
Communication Skill
Meghaj Mallick
 
PPT
Partial-Orderings in Discrete Mathematics
Meghaj Mallick
 
PPTX
Hashing In Data Structure
Meghaj Mallick
 
24 partial-orderings
Meghaj Mallick
 
PORTFOLIO BY USING HTML & CSS
Meghaj Mallick
 
Introduction to Software Testing
Meghaj Mallick
 
Introduction to System Programming
Meghaj Mallick
 
MACRO ASSEBLER
Meghaj Mallick
 
Icons, Image & Multimedia
Meghaj Mallick
 
Project Tracking & SPC
Meghaj Mallick
 
Peephole Optimization
Meghaj Mallick
 
Routing in MANET
Meghaj Mallick
 
Macro assembler
Meghaj Mallick
 
Architecture and security in Vanet PPT
Meghaj Mallick
 
Design Model & User Interface Design in Software Engineering
Meghaj Mallick
 
Text Mining of Twitter in Data Mining
Meghaj Mallick
 
DFS & BFS in Computer Algorithm
Meghaj Mallick
 
Software Development Method
Meghaj Mallick
 
Secant method in Numerical & Statistical Method
Meghaj Mallick
 
Motivation in Organization
Meghaj Mallick
 
Communication Skill
Meghaj Mallick
 
Partial-Orderings in Discrete Mathematics
Meghaj Mallick
 
Hashing In Data Structure
Meghaj Mallick
 
Ad

Recently uploaded (17)

PDF
The Origin - A Simple Presentation on any project
RishabhDwivedi43
 
PPTX
Inspired by VeinSense: Supercharge Your Hackathon with Agentic AI
ShubhamSharma2528
 
PPTX
AI presentation for everyone in every fields
dodinhkhai1
 
PPTX
STURGEON BAY WI AG PPT JULY 6 2025.pptx
FamilyWorshipCenterD
 
PDF
Buy Verified Payoneer Accounts — The Ultimate Guide for 2025 (Rank #1 on Goog...
Buy Verified Cash App Accounts
 
PDF
From Draft to DSN - How to Get your Paper In [DSN 2025 Doctoral Forum Keynote]
vschiavoni
 
PPTX
presentation on legal and regulatory action
raoharsh4122001
 
PPTX
Great-Books. Powerpoint presentation. files
tamayocrisgie
 
PPTX
some leadership theories MBA management.pptx
rkseo19
 
PDF
Buy Verified Coinbase Accounts — The Ultimate Guide for 2025 (Rank #1 on Goog...
Buy Verified Cash App Accounts
 
PDF
The Impact of Game Live Streaming on In-Game Purchases of Chinese Young Game ...
Shibaura Institute of Technology
 
PPTX
Presentationexpressions You are student leader and have just come from a stud...
BENSTARBEATZ
 
PPTX
Pastor Bob Stewart Acts 21 07 09 2025.pptx
FamilyWorshipCenterD
 
PPTX
BARRIERS TO EFFECTIVE COMMUNICATION.pptx
shraddham25
 
PDF
Leveraging the Power of Jira Dashboard.pdf
siddharthshukla742740
 
PDF
The Family Secret (essence of loveliness)
Favour Biodun
 
PPTX
2025-07-06 Abraham 06 (shared slides).pptx
Dale Wells
 
The Origin - A Simple Presentation on any project
RishabhDwivedi43
 
Inspired by VeinSense: Supercharge Your Hackathon with Agentic AI
ShubhamSharma2528
 
AI presentation for everyone in every fields
dodinhkhai1
 
STURGEON BAY WI AG PPT JULY 6 2025.pptx
FamilyWorshipCenterD
 
Buy Verified Payoneer Accounts — The Ultimate Guide for 2025 (Rank #1 on Goog...
Buy Verified Cash App Accounts
 
From Draft to DSN - How to Get your Paper In [DSN 2025 Doctoral Forum Keynote]
vschiavoni
 
presentation on legal and regulatory action
raoharsh4122001
 
Great-Books. Powerpoint presentation. files
tamayocrisgie
 
some leadership theories MBA management.pptx
rkseo19
 
Buy Verified Coinbase Accounts — The Ultimate Guide for 2025 (Rank #1 on Goog...
Buy Verified Cash App Accounts
 
The Impact of Game Live Streaming on In-Game Purchases of Chinese Young Game ...
Shibaura Institute of Technology
 
Presentationexpressions You are student leader and have just come from a stud...
BENSTARBEATZ
 
Pastor Bob Stewart Acts 21 07 09 2025.pptx
FamilyWorshipCenterD
 
BARRIERS TO EFFECTIVE COMMUNICATION.pptx
shraddham25
 
Leveraging the Power of Jira Dashboard.pdf
siddharthshukla742740
 
The Family Secret (essence of loveliness)
Favour Biodun
 
2025-07-06 Abraham 06 (shared slides).pptx
Dale Wells
 

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.