SlideShare uma empresa Scribd logo
1 de 39
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/1
Outline
• Introduction
• Background
• Distributed Database Design
• Database Integration
• Semantic Data Control
• Distributed Query Processing
• Multidatabase Query Processing
• Distributed Transaction Management
➡ Transaction Concepts and Models
➡ Distributed Concurrency Control
➡ Distributed Reliability
• Data Replication
• Parallel Database Systems
• Distributed Object DBMS
• Peer-to-Peer Data Management
• Web Data Management
• Current Issues
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/2
Concurrency Control
• The problem of synchronizing concurrent transactions such that the
consistency of the database is maintained while, at the same
time, maximum degree of concurrency is achieved.
• Anomalies:
➡ Lost updates
✦ The effects of some transactions are not reflected on the database.
➡ Inconsistent retrievals
✦ A transaction, if it reads the same data item more than once, should always read
the same value.
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/3
Execution History (or Schedule)
• An order in which the operations of a set of transactions are executed.
• A history (schedule) can be defined as a partial order over the operations
of a set of transactions.
H1={W2(x),R1(x), R3(x),W1(x),C1,W2(y),R3(y),R2(z),C2,R3(z),C3}
T1: Read(x) T2: Write(x) T3: Read(x)
Write(x) Write(y) Read(y)
Commit Read(z) Read(z)
Commit Commit
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/4
Formalization of History
A complete history over a set of transactions T={T1, …, Tn} is a partial order
Hc(T) = {∑T, ≺H} where
 ∑T = i ∑i , for i = 1, 2, …, n
 ≺H i ≺Ti
, for i = 1, 2, …, n
 For any two conflicting operations Oij, Okl ∑T, either Oij ≺H Okl or Okl ≺H Oij
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/5
Complete Schedule – Example
Given three transactions
T1: Read(x) T2: Write(x) T3: Read(x)
Write(x) Write(y) Read(y)
Commit Read(z) Read(z)
Commit Commit
A possible complete schedule is given as the DAG
C1
R3(x)R1(x) W2(x)
W1(x) W2(y) R3(y)
R3(z)R2(z)
C2 C3
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/6
A schedule is a prefix of a complete schedule such that only some of the
operations and only some of the ordering relationships are included.
T1: Read(x) T2: Write(x) T3: Read(x)
Write(x) Write(y) Read(y)
Commit Read(z) Read(z)
Commit Commit
Schedule Definition
R1(x)
C1
R3(x)R1(x) R3(x)W2(x)W2(x)
W1(x) W2(y)W2(y) R3(y)R3(y)
R3(z)R3(z) R2(z)R2(z)
C2 C3
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/7
Serial History
• All the actions of a transaction occur consecutively.
• No interleaving of transaction operations.
• If each transaction is consistent (obeys integrity rules), then the database is
guaranteed to be consistent at the end of executing a serial history.
T1: Read(x) T2: Write(x) T3: Read(x)
Write(x) Write(y) Read(y)
Commit Read(z) Read(z)
Commit Commit
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/8
Serializable History
• Transactions execute concurrently, but the net effect of the resulting
history upon the database is equivalent to some serial history.
• Equivalent with respect to what?
➡ Conflict equivalence: the relative order of execution of the conflicting
operations belonging to unaborted transactions in two histories are the same.
➡ Conflicting operations: two incompatible operations (e.g., Read and Write)
conflict if they both access the same data item.
✦ Incompatible operations of each transaction is assumed to conflict; do not change
their execution orders.
✦ If two operations from two different transactions conflict, the corresponding
transactions are also said to conflict.
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/9
Serializable History
The following are not conflict equivalent
Hs={W2(x),W2(y),R2(z),R1(x),W1(x),R3(x),R3(y),R3(z)}
H1={W2(x),R1(x), R3(x),W1(x),W2(y),R3(y),R2(z),R3(z)}
The following are conflict equivalent; therefore H2 is serializable.
Hs={W2(x),W2(y),R2(z),R1(x),W1(x),R3(x),R3(y),R3(z)}
H2={W2(x),R1(x),W1(x),R3(x),W2(y),R3(y),R2(z),R3(z)}
T1: Read(x) T2: Write(x) T3: Read(x)
Write(x) Write(y) Read(y)
Commit Read(z) Read(z)
Commit Commit
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/10
Serializability in Distributed
DBMS
• Somewhat more involved. Two histories have to be considered:
➡ local histories
➡ global history
• For global transactions (i.e., global history) to be serializable, two
conditions are necessary:
➡ Each local history should be serializable.
➡ Two conflicting operations should be in the same relative order in all of the
local histories where they appear together.
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/11
Global Non-serializability
• x stored at Site 1, y stored at Site 2
• LH1, LH2 are individually serializable (in fact serial), but the two
transactions are not globally serializable.
T1: Read(x) T2: Read(x)
x ←x-100 Read(y)
Write(x) Commit
Read(y)
y ←y+100
Write(y)
Commit
LH1={R1(x),W1(x), R2(x)}
LH2={R2(y), R1(y),W1(y)}
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/12
Concurrency Control Algorithms
• Pessimistic
➡ Two-Phase Locking-based (2PL)
✦ Centralized (primary site) 2PL
✦ Primary copy 2PL
✦ Distributed 2PL
➡ Timestamp Ordering (TO)
✦ Basic TO
✦ Multiversion TO
✦ Conservative TO
➡ Hybrid
• Optimistic
➡ Locking-based
➡ Timestamp ordering-based
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/13
Locking-Based Algorithms
• Transactions indicate their intentions by requesting locks from the
scheduler (called lock manager).
• Locks are either read lock (rl) [also called shared lock] or write lock (wl)
[also called exclusive lock]
• Read locks and write locks conflict (because Read and Write operations are
incompatible
rl wl
rl yes no
wl no no
• Locking works nicely to allow concurrent processing of transactions.
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/14
Two-Phase Locking (2PL)
 A Transaction locks an object before using it.
 When an object is locked by another transaction, the requesting
transaction must wait.
 When a transaction releases a lock, it may not request another lock.
Obtain lock
Release lock
Lock point
Phase 1 Phase 2
BEGIN END
No.oflocks
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/15
Strict 2PL
Hold locks until the end.
Obtain lock
Release lock
BEGIN END
Transaction
duration
period of
data item
use
No.oflocks
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/16
Centralized 2PL
• There is only one 2PL scheduler in the distributed system.
• Lock requests are issued to the central scheduler.
Data Processors at
participating sites Coordinating TM Central Site LM
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/17
Distributed 2PL
• 2PL schedulers are placed at each site. Each scheduler handles lock
requests for data at that site.
• A transaction may read any of the replicated copies of item x, by obtaining
a read lock on one of the copies of x. Writing into x requires obtaining
write locks for all copies of x.
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/18
Distributed 2PL Execution
Coordinating TM Participating LMs Participating DPs
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/19
Timestamp Ordering
Transaction (Ti) is assigned a globally unique timestamp ts(Ti).
Transaction manager attaches the timestamp to all operations issued by the
transaction.
Each data item is assigned a write timestamp (wts) and a read timestamp
(rts):
➡ rts(x) = largest timestamp of any read on x
➡ wts(x) = largest timestamp of any read on x
Conflicting operations are resolved by timestamp order.
Basic T/O:
for Ri(x) for Wi(x)
if ts(Ti) < wts(x) if ts(Ti) < rts(x) and ts(Ti) < wts(x)
then reject Ri(x) then reject Wi(x)
else accept Ri(x) else accept Wi(x)
rts(x) ts(Ti) wts(x) ts(Ti)
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/20
Conservative Timestamp
Ordering
• Basic timestamp ordering tries to execute an operation as soon as it
receives it
➡ progressive
➡ too many restarts since there is no delaying
• Conservative timestamping delays each operation until there is an
assurance that it will not be restarted
• Assurance?
➡ No other operation with a smaller timestamp can arrive at the scheduler
➡ Note that the delay may result in the formation of deadlocks
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/21
Multiversion Timestamp Ordering
• Do not modify the values in the database, create new values.
• A Ri(x) is translated into a read on one version of x.
➡ Find a version of x (say xv) such that ts(xv) is the largest timestamp less than
ts(Ti).
• A Wi(x) is translated into Wi(xw) and accepted if the scheduler has not yet
processed any Rj(xr) such that
ts(Ti) < ts(xr) < ts(Tj)
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/22
Optimistic Concurrency Control
Algorithms
Pessimistic execution
Optimistic execution
Validate Read Compute Write
ValidateRead Compute Write
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/23
Optimistic Concurrency Control
Algorithms
• Transaction execution model: divide into subtransactions each of which
execute at a site
➡ Tij: transaction Ti that executes at site j
• Transactions run independently at each site until they reach the end of
their read phases
• All subtransactions are assigned a timestamp at the end of their read phase
• Validation test performed during validation phase. If one fails, all rejected.
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/24
Optimistic CC Validation Test
 If all transactions Tk where ts(Tk) < ts(Tij) have completed their write
phase before Tij has started its read phase, then validation succeeds
➡ Transaction executions in serial order
Tk
R V W
R V W
Tij
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/25
Optimistic CC Validation Test
 If there is any transaction Tk such that ts(Tk)<ts(Tij) and which completes
its write phase while Tij is in its read phase, then validation succeeds if
WS(Tk) RS(Tij) = Ø
➡ Read and write phases overlap, but Tij does not read data items written
by Tk
R V W
Tk
R V W
Tij
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/26
Optimistic CC Validation Test
 If there is any transaction Tk such that ts(Tk)< ts(Tij) and which completes
its read phase before Tij completes its read phase, then validation succeeds
if WS(Tk) RS(Tij) = Ø and WS(Tk) WS(Tij) = Ø
➡ They overlap, but don't access any common data items.
R V W
Tk
R V W
Tij
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/27
Deadlock
• A transaction is deadlocked if it is blocked and will remain blocked until
there is intervention.
• Locking-based CC algorithms may cause deadlocks.
• TO-based algorithms that involve waiting may cause deadlocks.
• Wait-for graph
➡ If transaction Ti waits for another transaction Tj to release a lock on an
entity, then Ti → Tj in WFG.
Ti
Tj
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/28
Local versus Global WFG
Assume T1 and T2 run at site 1, T3 and T4 run at site 2. Also assume T3 waits
for a lock held by T4 which waits for a lock held by T1 which waits for a lock
held by T2 which, in turn, waits for a lock held by T3.
Local WFG
Global WFG
T1
Site 1 Site 2
T2
T4
T3
T1
T2
T4
T3
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/29
Deadlock Management
• Ignore
➡ Let the application programmer deal with it, or restart the system
• Prevention
➡ Guaranteeing that deadlocks can never occur in the first place. Check
transaction when it is initiated. Requires no run time support.
• Avoidance
➡ Detecting potential deadlocks in advance and taking action to insure that
deadlock will not occur. Requires run time support.
• Detection and Recovery
➡ Allowing deadlocks to form and then finding and breaking them. As in the
avoidance scheme, this requires run time support.
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/30
Deadlock Prevention
• All resources which may be needed by a transaction must be predeclared.
➡ The system must guarantee that none of the resources will be needed by an
ongoing transaction.
➡ Resources must only be reserved, but not necessarily allocated a priori
➡ Unsuitability of the scheme in database environment
➡ Suitable for systems that have no provisions for undoing processes.
• Evaluation:
– Reduced concurrency due to preallocation
– Evaluating whether an allocation is safe leads to added overhead.
– Difficult to determine (partial order)
+ No transaction rollback or restart is involved.
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/31
Deadlock Avoidance
• Transactions are not required to request resources a priori.
• Transactions are allowed to proceed unless a requested resource is
unavailable.
• In case of conflict, transactions may be allowed to wait for a fixed time
interval.
• Order either the data items or the sites and always request locks in that
order.
• More attractive than prevention in a database environment.
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/32
Deadlock Avoidance –
Wait-Die Algorithm
If Ti requests a lock on a data item which is already locked by Tj, then Ti is
permitted to wait iff ts(Ti)<ts(Tj). If ts(Ti)>ts(Tj), then Ti is aborted and
restarted with the same timestamp.
➡ if ts(Ti)<ts(Tj) then Ti waits else Ti dies
➡ non-preemptive: Ti never preempts Tj
➡ prefers younger transactions
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/33
Deadlock Avoidance –
Wound-Wait Algorithm
If Ti requests a lock on a data item which is already locked by Tj , then Ti is
permitted to wait iff ts(Ti)>ts(Tj). If ts(Ti)<ts(Tj), then Tj is aborted and the
lock is granted to Ti.
➡ if ts(Ti)<ts(Tj) then Tj is wounded else Ti waits
➡ preemptive: Ti preempts Tj if it is younger
➡ prefers older transactions
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/34
Deadlock Detection
• Transactions are allowed to wait freely.
• Wait-for graphs and cycles.
• Topologies for deadlock detection algorithms
➡ Centralized
➡ Distributed
➡ Hierarchical
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/35
Centralized Deadlock Detection
• One site is designated as the deadlock detector for the system. Each
scheduler periodically sends its local WFG to the central site which merges
them to a global WFG to determine cycles.
• How often to transmit?
➡ Too often ⇒ higher communication cost but lower delays due to undetected
deadlocks
➡ Too late ⇒ higher delays due to deadlocks, but lower communication cost
• Would be a reasonable choice if the concurrency control algorithm is also
centralized.
• Proposed for Distributed INGRES
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/36
Build a hierarchy of detectors
Hierarchical Deadlock Detection
Site 1 Site 2 Site 3 Site 4
DD21 DD22 DD23 DD24
DD11 DD14
DD0x
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/37
Distributed Deadlock Detection
• Sites cooperate in detection of deadlocks.
• One example:
➡ The local WFGs are formed at each site and passed on to other sites. Each
local WFG is modified as follows:
 Since each site receives the potential deadlock cycles from other sites, these
edges are added to the local WFGs
 The edges in the local WFG which show that local transactions are waiting
for transactions at other sites are joined with edges in the local WFGs which
show that remote transactions are waiting for local ones.
➡ Each local deadlock detector:
✦ looks for a cycle that does not involve the external edge. If it exists, there is a
local deadlock which can be handled locally.
✦ looks for a cycle involving the external edge. If it exists, it indicates a
potential global deadlock. Pass on the information to the next site.
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/38
“Relaxed” Concurrency Control
• Non-serializable histories
➡ E.g., ordered shared locks
➡ Semantics of transactions can be used
✦ Look at semantic compatibility of operations rather than simply looking at reads
and writes
• Nested distributed transactions
➡ Closed nested transactions
➡ Open nested transactions
➡ Multilevel transactions
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/39
Multilevel Transactions
Consider two transactions
T1: Withdraw(o,x) T2: Withdraw(o,y)
Deposit(p,x) Deposit(p,y)

Mais conteúdo relacionado

Mais procurados

Query optimization
Query optimizationQuery optimization
Query optimizationPooja Dixit
 
Database ,14 Parallel DBMS
Database ,14 Parallel DBMSDatabase ,14 Parallel DBMS
Database ,14 Parallel DBMSAli Usman
 
Validation based protocol
Validation based protocolValidation based protocol
Validation based protocolBBDITM LUCKNOW
 
Distributed dbms architectures
Distributed dbms architecturesDistributed dbms architectures
Distributed dbms architecturesPooja Dixit
 
Query decomposition in data base
Query decomposition in data baseQuery decomposition in data base
Query decomposition in data baseSalman Memon
 
Concurrency Control Techniques
Concurrency Control TechniquesConcurrency Control Techniques
Concurrency Control TechniquesRaj vardhan
 
Lock based protocols
Lock based protocolsLock based protocols
Lock based protocolsChethanMp7
 
Transaction management
Transaction managementTransaction management
Transaction managementrenuka_a
 
Introduction to Data Stream Processing
Introduction to Data Stream ProcessingIntroduction to Data Stream Processing
Introduction to Data Stream ProcessingSafe Software
 
Distributed database management systems
Distributed database management systemsDistributed database management systems
Distributed database management systemsDhani Ahmad
 
DISTRIBUTED DATABASE WITH RECOVERY TECHNIQUES
DISTRIBUTED DATABASE WITH RECOVERY TECHNIQUESDISTRIBUTED DATABASE WITH RECOVERY TECHNIQUES
DISTRIBUTED DATABASE WITH RECOVERY TECHNIQUESAAKANKSHA JAIN
 

Mais procurados (20)

Query optimization
Query optimizationQuery optimization
Query optimization
 
DDBMS Paper with Solution
DDBMS Paper with SolutionDDBMS Paper with Solution
DDBMS Paper with Solution
 
Distributed DBMS - Unit 9 - Distributed Deadlock & Recovery
Distributed DBMS - Unit 9 - Distributed Deadlock & RecoveryDistributed DBMS - Unit 9 - Distributed Deadlock & Recovery
Distributed DBMS - Unit 9 - Distributed Deadlock & Recovery
 
Concurrency control
Concurrency controlConcurrency control
Concurrency control
 
Database ,14 Parallel DBMS
Database ,14 Parallel DBMSDatabase ,14 Parallel DBMS
Database ,14 Parallel DBMS
 
Advanced DBMS presentation
Advanced DBMS presentationAdvanced DBMS presentation
Advanced DBMS presentation
 
Validation based protocol
Validation based protocolValidation based protocol
Validation based protocol
 
Distributed dbms architectures
Distributed dbms architecturesDistributed dbms architectures
Distributed dbms architectures
 
Query decomposition in data base
Query decomposition in data baseQuery decomposition in data base
Query decomposition in data base
 
Distributed DBMS - Unit 6 - Query Processing
Distributed DBMS - Unit 6 - Query ProcessingDistributed DBMS - Unit 6 - Query Processing
Distributed DBMS - Unit 6 - Query Processing
 
Concurrency Control Techniques
Concurrency Control TechniquesConcurrency Control Techniques
Concurrency Control Techniques
 
Distributed DBMS - Unit 1 - Introduction
Distributed DBMS - Unit 1 - IntroductionDistributed DBMS - Unit 1 - Introduction
Distributed DBMS - Unit 1 - Introduction
 
Lock based protocols
Lock based protocolsLock based protocols
Lock based protocols
 
Deadlock dbms
Deadlock dbmsDeadlock dbms
Deadlock dbms
 
Transaction management
Transaction managementTransaction management
Transaction management
 
Distributed DBMS - Unit 3 - Distributed DBMS Architecture
Distributed DBMS - Unit 3 - Distributed DBMS ArchitectureDistributed DBMS - Unit 3 - Distributed DBMS Architecture
Distributed DBMS - Unit 3 - Distributed DBMS Architecture
 
Introduction to Data Stream Processing
Introduction to Data Stream ProcessingIntroduction to Data Stream Processing
Introduction to Data Stream Processing
 
Distributed database management systems
Distributed database management systemsDistributed database management systems
Distributed database management systems
 
DISTRIBUTED DATABASE WITH RECOVERY TECHNIQUES
DISTRIBUTED DATABASE WITH RECOVERY TECHNIQUESDISTRIBUTED DATABASE WITH RECOVERY TECHNIQUES
DISTRIBUTED DATABASE WITH RECOVERY TECHNIQUES
 
Lecture 1 ddbms
Lecture 1 ddbmsLecture 1 ddbms
Lecture 1 ddbms
 

Destaque

Database ,7 query localization
Database ,7 query localizationDatabase ,7 query localization
Database ,7 query localizationAli Usman
 
Database, 3 Distribution Design
Database, 3 Distribution DesignDatabase, 3 Distribution Design
Database, 3 Distribution DesignAli Usman
 
Database , 4 Data Integration
Database , 4 Data IntegrationDatabase , 4 Data Integration
Database , 4 Data IntegrationAli Usman
 
Lock free programming - pro tips devoxx uk
Lock free programming - pro tips devoxx ukLock free programming - pro tips devoxx uk
Lock free programming - pro tips devoxx ukJean-Philippe BEMPEL
 
Modul 04 ta1_ metodologi penelitian
Modul 04 ta1_ metodologi penelitianModul 04 ta1_ metodologi penelitian
Modul 04 ta1_ metodologi penelitianFokgusta
 
Media ajarelektronik
Media ajarelektronikMedia ajarelektronik
Media ajarelektronikFokgusta
 
Processor Specifications
Processor SpecificationsProcessor Specifications
Processor SpecificationsAli Usman
 
Optimistic Algorithm and Concurrency Control Algorithm
Optimistic Algorithm and Concurrency Control AlgorithmOptimistic Algorithm and Concurrency Control Algorithm
Optimistic Algorithm and Concurrency Control AlgorithmShounak Katyayan
 
[2D7]레기온즈로 살펴보는 확장 가능한 게임서버의 구현
[2D7]레기온즈로 살펴보는 확장 가능한 게임서버의 구현[2D7]레기온즈로 살펴보는 확장 가능한 게임서버의 구현
[2D7]레기온즈로 살펴보는 확장 가능한 게임서버의 구현NAVER D2
 
Model pembelajaran yang efektif
Model pembelajaran yang efektifModel pembelajaran yang efektif
Model pembelajaran yang efektifFokgusta
 
Model pemb-2005
Model pemb-2005Model pemb-2005
Model pemb-2005Fokgusta
 
Kalimat aktifpasif-kalimat-langsung-taklangsung
Kalimat aktifpasif-kalimat-langsung-taklangsungKalimat aktifpasif-kalimat-langsung-taklangsung
Kalimat aktifpasif-kalimat-langsung-taklangsungFokgusta
 
Database , 5 Semantic
Database , 5 SemanticDatabase , 5 Semantic
Database , 5 SemanticAli Usman
 
PL/pgSQL - An Introduction on Using Imperative Programming in PostgreSQL
PL/pgSQL - An Introduction on Using Imperative Programming in PostgreSQLPL/pgSQL - An Introduction on Using Imperative Programming in PostgreSQL
PL/pgSQL - An Introduction on Using Imperative Programming in PostgreSQLReactive.IO
 
Kata kajian-dan-kata-populer
Kata kajian-dan-kata-populerKata kajian-dan-kata-populer
Kata kajian-dan-kata-populerFokgusta
 
1.studi tentang organisasi
1.studi tentang organisasi1.studi tentang organisasi
1.studi tentang organisasiFokgusta
 
Gsm (Part 1)
Gsm (Part 1)Gsm (Part 1)
Gsm (Part 1)Ali Usman
 

Destaque (20)

Concurrency control
Concurrency controlConcurrency control
Concurrency control
 
Database ,7 query localization
Database ,7 query localizationDatabase ,7 query localization
Database ,7 query localization
 
Database, 3 Distribution Design
Database, 3 Distribution DesignDatabase, 3 Distribution Design
Database, 3 Distribution Design
 
Database , 4 Data Integration
Database , 4 Data IntegrationDatabase , 4 Data Integration
Database , 4 Data Integration
 
Concurrency
ConcurrencyConcurrency
Concurrency
 
Mydbms
MydbmsMydbms
Mydbms
 
Lock free programming - pro tips devoxx uk
Lock free programming - pro tips devoxx ukLock free programming - pro tips devoxx uk
Lock free programming - pro tips devoxx uk
 
Modul 04 ta1_ metodologi penelitian
Modul 04 ta1_ metodologi penelitianModul 04 ta1_ metodologi penelitian
Modul 04 ta1_ metodologi penelitian
 
Media ajarelektronik
Media ajarelektronikMedia ajarelektronik
Media ajarelektronik
 
Processor Specifications
Processor SpecificationsProcessor Specifications
Processor Specifications
 
Optimistic Algorithm and Concurrency Control Algorithm
Optimistic Algorithm and Concurrency Control AlgorithmOptimistic Algorithm and Concurrency Control Algorithm
Optimistic Algorithm and Concurrency Control Algorithm
 
[2D7]레기온즈로 살펴보는 확장 가능한 게임서버의 구현
[2D7]레기온즈로 살펴보는 확장 가능한 게임서버의 구현[2D7]레기온즈로 살펴보는 확장 가능한 게임서버의 구현
[2D7]레기온즈로 살펴보는 확장 가능한 게임서버의 구현
 
Model pembelajaran yang efektif
Model pembelajaran yang efektifModel pembelajaran yang efektif
Model pembelajaran yang efektif
 
Model pemb-2005
Model pemb-2005Model pemb-2005
Model pemb-2005
 
Kalimat aktifpasif-kalimat-langsung-taklangsung
Kalimat aktifpasif-kalimat-langsung-taklangsungKalimat aktifpasif-kalimat-langsung-taklangsung
Kalimat aktifpasif-kalimat-langsung-taklangsung
 
Database , 5 Semantic
Database , 5 SemanticDatabase , 5 Semantic
Database , 5 Semantic
 
PL/pgSQL - An Introduction on Using Imperative Programming in PostgreSQL
PL/pgSQL - An Introduction on Using Imperative Programming in PostgreSQLPL/pgSQL - An Introduction on Using Imperative Programming in PostgreSQL
PL/pgSQL - An Introduction on Using Imperative Programming in PostgreSQL
 
Kata kajian-dan-kata-populer
Kata kajian-dan-kata-populerKata kajian-dan-kata-populer
Kata kajian-dan-kata-populer
 
1.studi tentang organisasi
1.studi tentang organisasi1.studi tentang organisasi
1.studi tentang organisasi
 
Gsm (Part 1)
Gsm (Part 1)Gsm (Part 1)
Gsm (Part 1)
 

Semelhante a Database ,11 Concurrency Control

Database ,10 Transactions
Database ,10 TransactionsDatabase ,10 Transactions
Database ,10 TransactionsAli Usman
 
UNIT-IV: Transaction Processing Concepts
UNIT-IV: Transaction Processing ConceptsUNIT-IV: Transaction Processing Concepts
UNIT-IV: Transaction Processing ConceptsRaj vardhan
 
Database , 13 Replication
Database , 13 ReplicationDatabase , 13 Replication
Database , 13 ReplicationAli Usman
 
3 concurrency controlone_v3
3 concurrency controlone_v33 concurrency controlone_v3
3 concurrency controlone_v3ashish61_scs
 
Ppt on transaction schduling in distributer real time database system(seminaar)
Ppt on transaction schduling in distributer real time database system(seminaar)Ppt on transaction schduling in distributer real time database system(seminaar)
Ppt on transaction schduling in distributer real time database system(seminaar)Royalzig Luxury Furniture
 
protocols of concurrency control
protocols of concurrency controlprotocols of concurrency control
protocols of concurrency controlMOHIT DADU
 
db unit 4 dbms protocols in transaction
db unit 4 dbms  protocols in transactiondb unit 4 dbms  protocols in transaction
db unit 4 dbms protocols in transactionKumari Naveen
 
Databases: Concurrency Control
Databases: Concurrency ControlDatabases: Concurrency Control
Databases: Concurrency ControlDamian T. Gordon
 
Database concurrency control &amp; recovery (1)
Database concurrency control &amp; recovery (1)Database concurrency control &amp; recovery (1)
Database concurrency control &amp; recovery (1)Rashid Khan
 
Transactions in dbms
Transactions in dbmsTransactions in dbms
Transactions in dbmsNancy Gulati
 
recoverability and serializability dbms
recoverability and serializability  dbmsrecoverability and serializability  dbms
recoverability and serializability dbmsKumari Naveen
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
Transaction and concurrency control
Transaction and concurrency controlTransaction and concurrency control
Transaction and concurrency controlAnil Shrestha
 
16. Concurrency Control in DBMS
16. Concurrency Control in DBMS16. Concurrency Control in DBMS
16. Concurrency Control in DBMSkoolkampus
 
Dbms sixth chapter_part-1_2011
Dbms sixth chapter_part-1_2011Dbms sixth chapter_part-1_2011
Dbms sixth chapter_part-1_2011sumit_study
 

Semelhante a Database ,11 Concurrency Control (20)

Database ,10 Transactions
Database ,10 TransactionsDatabase ,10 Transactions
Database ,10 Transactions
 
UNIT-IV: Transaction Processing Concepts
UNIT-IV: Transaction Processing ConceptsUNIT-IV: Transaction Processing Concepts
UNIT-IV: Transaction Processing Concepts
 
Database , 13 Replication
Database , 13 ReplicationDatabase , 13 Replication
Database , 13 Replication
 
Concurrent Transactions.ppt
Concurrent Transactions.pptConcurrent Transactions.ppt
Concurrent Transactions.ppt
 
3 concurrency controlone_v3
3 concurrency controlone_v33 concurrency controlone_v3
3 concurrency controlone_v3
 
24904 lecture11
24904 lecture1124904 lecture11
24904 lecture11
 
Ppt on transaction schduling in distributer real time database system(seminaar)
Ppt on transaction schduling in distributer real time database system(seminaar)Ppt on transaction schduling in distributer real time database system(seminaar)
Ppt on transaction schduling in distributer real time database system(seminaar)
 
Chapter17
Chapter17Chapter17
Chapter17
 
Lec08
Lec08Lec08
Lec08
 
protocols of concurrency control
protocols of concurrency controlprotocols of concurrency control
protocols of concurrency control
 
db unit 4 dbms protocols in transaction
db unit 4 dbms  protocols in transactiondb unit 4 dbms  protocols in transaction
db unit 4 dbms protocols in transaction
 
Databases: Concurrency Control
Databases: Concurrency ControlDatabases: Concurrency Control
Databases: Concurrency Control
 
Database concurrency control &amp; recovery (1)
Database concurrency control &amp; recovery (1)Database concurrency control &amp; recovery (1)
Database concurrency control &amp; recovery (1)
 
Transactions in dbms
Transactions in dbmsTransactions in dbms
Transactions in dbms
 
recoverability and serializability dbms
recoverability and serializability  dbmsrecoverability and serializability  dbms
recoverability and serializability dbms
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
Transaction and concurrency control
Transaction and concurrency controlTransaction and concurrency control
Transaction and concurrency control
 
m-serial.ppt
m-serial.pptm-serial.ppt
m-serial.ppt
 
16. Concurrency Control in DBMS
16. Concurrency Control in DBMS16. Concurrency Control in DBMS
16. Concurrency Control in DBMS
 
Dbms sixth chapter_part-1_2011
Dbms sixth chapter_part-1_2011Dbms sixth chapter_part-1_2011
Dbms sixth chapter_part-1_2011
 

Mais de Ali Usman

Cisco Packet Tracer Overview
Cisco Packet Tracer OverviewCisco Packet Tracer Overview
Cisco Packet Tracer OverviewAli Usman
 
Islamic Arts and Architecture
Islamic Arts and  ArchitectureIslamic Arts and  Architecture
Islamic Arts and ArchitectureAli Usman
 
Database ,18 Current Issues
Database ,18 Current IssuesDatabase ,18 Current Issues
Database ,18 Current IssuesAli Usman
 
Database , 17 Web
Database , 17 WebDatabase , 17 Web
Database , 17 WebAli Usman
 
Database ,16 P2P
Database ,16 P2P Database ,16 P2P
Database ,16 P2P Ali Usman
 
Database , 6 Query Introduction
Database , 6 Query Introduction Database , 6 Query Introduction
Database , 6 Query Introduction Ali Usman
 
Database ,2 Background
 Database ,2 Background Database ,2 Background
Database ,2 BackgroundAli Usman
 
Database , 1 Introduction
 Database , 1 Introduction Database , 1 Introduction
Database , 1 IntroductionAli Usman
 
Processor Specifications
Processor SpecificationsProcessor Specifications
Processor SpecificationsAli Usman
 
Fifty Year Of Microprocessor
Fifty Year Of MicroprocessorFifty Year Of Microprocessor
Fifty Year Of MicroprocessorAli Usman
 
Discrete Structures lecture 2
 Discrete Structures lecture 2 Discrete Structures lecture 2
Discrete Structures lecture 2Ali Usman
 
Discrete Structures. Lecture 1
 Discrete Structures. Lecture 1  Discrete Structures. Lecture 1
Discrete Structures. Lecture 1 Ali Usman
 
Muslim Contributions in Medicine-Geography-Astronomy
Muslim Contributions in Medicine-Geography-AstronomyMuslim Contributions in Medicine-Geography-Astronomy
Muslim Contributions in Medicine-Geography-AstronomyAli Usman
 
Muslim Contributions in Geography
Muslim Contributions in GeographyMuslim Contributions in Geography
Muslim Contributions in GeographyAli Usman
 
Muslim Contributions in Astronomy
Muslim Contributions in AstronomyMuslim Contributions in Astronomy
Muslim Contributions in AstronomyAli Usman
 
Ptcl modem (user manual)
Ptcl modem (user manual)Ptcl modem (user manual)
Ptcl modem (user manual)Ali Usman
 
Nimat-ul-ALLAH shah wali
Nimat-ul-ALLAH shah wali Nimat-ul-ALLAH shah wali
Nimat-ul-ALLAH shah wali Ali Usman
 
Muslim Contributions in Mathematics
Muslim Contributions in MathematicsMuslim Contributions in Mathematics
Muslim Contributions in MathematicsAli Usman
 
Osi protocols
Osi protocolsOsi protocols
Osi protocolsAli Usman
 

Mais de Ali Usman (19)

Cisco Packet Tracer Overview
Cisco Packet Tracer OverviewCisco Packet Tracer Overview
Cisco Packet Tracer Overview
 
Islamic Arts and Architecture
Islamic Arts and  ArchitectureIslamic Arts and  Architecture
Islamic Arts and Architecture
 
Database ,18 Current Issues
Database ,18 Current IssuesDatabase ,18 Current Issues
Database ,18 Current Issues
 
Database , 17 Web
Database , 17 WebDatabase , 17 Web
Database , 17 Web
 
Database ,16 P2P
Database ,16 P2P Database ,16 P2P
Database ,16 P2P
 
Database , 6 Query Introduction
Database , 6 Query Introduction Database , 6 Query Introduction
Database , 6 Query Introduction
 
Database ,2 Background
 Database ,2 Background Database ,2 Background
Database ,2 Background
 
Database , 1 Introduction
 Database , 1 Introduction Database , 1 Introduction
Database , 1 Introduction
 
Processor Specifications
Processor SpecificationsProcessor Specifications
Processor Specifications
 
Fifty Year Of Microprocessor
Fifty Year Of MicroprocessorFifty Year Of Microprocessor
Fifty Year Of Microprocessor
 
Discrete Structures lecture 2
 Discrete Structures lecture 2 Discrete Structures lecture 2
Discrete Structures lecture 2
 
Discrete Structures. Lecture 1
 Discrete Structures. Lecture 1  Discrete Structures. Lecture 1
Discrete Structures. Lecture 1
 
Muslim Contributions in Medicine-Geography-Astronomy
Muslim Contributions in Medicine-Geography-AstronomyMuslim Contributions in Medicine-Geography-Astronomy
Muslim Contributions in Medicine-Geography-Astronomy
 
Muslim Contributions in Geography
Muslim Contributions in GeographyMuslim Contributions in Geography
Muslim Contributions in Geography
 
Muslim Contributions in Astronomy
Muslim Contributions in AstronomyMuslim Contributions in Astronomy
Muslim Contributions in Astronomy
 
Ptcl modem (user manual)
Ptcl modem (user manual)Ptcl modem (user manual)
Ptcl modem (user manual)
 
Nimat-ul-ALLAH shah wali
Nimat-ul-ALLAH shah wali Nimat-ul-ALLAH shah wali
Nimat-ul-ALLAH shah wali
 
Muslim Contributions in Mathematics
Muslim Contributions in MathematicsMuslim Contributions in Mathematics
Muslim Contributions in Mathematics
 
Osi protocols
Osi protocolsOsi protocols
Osi protocols
 

Último

Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 

Último (20)

Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 

Database ,11 Concurrency Control

  • 1. Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/1 Outline • Introduction • Background • Distributed Database Design • Database Integration • Semantic Data Control • Distributed Query Processing • Multidatabase Query Processing • Distributed Transaction Management ➡ Transaction Concepts and Models ➡ Distributed Concurrency Control ➡ Distributed Reliability • Data Replication • Parallel Database Systems • Distributed Object DBMS • Peer-to-Peer Data Management • Web Data Management • Current Issues
  • 2. Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/2 Concurrency Control • The problem of synchronizing concurrent transactions such that the consistency of the database is maintained while, at the same time, maximum degree of concurrency is achieved. • Anomalies: ➡ Lost updates ✦ The effects of some transactions are not reflected on the database. ➡ Inconsistent retrievals ✦ A transaction, if it reads the same data item more than once, should always read the same value.
  • 3. Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/3 Execution History (or Schedule) • An order in which the operations of a set of transactions are executed. • A history (schedule) can be defined as a partial order over the operations of a set of transactions. H1={W2(x),R1(x), R3(x),W1(x),C1,W2(y),R3(y),R2(z),C2,R3(z),C3} T1: Read(x) T2: Write(x) T3: Read(x) Write(x) Write(y) Read(y) Commit Read(z) Read(z) Commit Commit
  • 4. Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/4 Formalization of History A complete history over a set of transactions T={T1, …, Tn} is a partial order Hc(T) = {∑T, ≺H} where  ∑T = i ∑i , for i = 1, 2, …, n  ≺H i ≺Ti , for i = 1, 2, …, n  For any two conflicting operations Oij, Okl ∑T, either Oij ≺H Okl or Okl ≺H Oij
  • 5. Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/5 Complete Schedule – Example Given three transactions T1: Read(x) T2: Write(x) T3: Read(x) Write(x) Write(y) Read(y) Commit Read(z) Read(z) Commit Commit A possible complete schedule is given as the DAG C1 R3(x)R1(x) W2(x) W1(x) W2(y) R3(y) R3(z)R2(z) C2 C3
  • 6. Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/6 A schedule is a prefix of a complete schedule such that only some of the operations and only some of the ordering relationships are included. T1: Read(x) T2: Write(x) T3: Read(x) Write(x) Write(y) Read(y) Commit Read(z) Read(z) Commit Commit Schedule Definition R1(x) C1 R3(x)R1(x) R3(x)W2(x)W2(x) W1(x) W2(y)W2(y) R3(y)R3(y) R3(z)R3(z) R2(z)R2(z) C2 C3
  • 7. Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/7 Serial History • All the actions of a transaction occur consecutively. • No interleaving of transaction operations. • If each transaction is consistent (obeys integrity rules), then the database is guaranteed to be consistent at the end of executing a serial history. T1: Read(x) T2: Write(x) T3: Read(x) Write(x) Write(y) Read(y) Commit Read(z) Read(z) Commit Commit
  • 8. Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/8 Serializable History • Transactions execute concurrently, but the net effect of the resulting history upon the database is equivalent to some serial history. • Equivalent with respect to what? ➡ Conflict equivalence: the relative order of execution of the conflicting operations belonging to unaborted transactions in two histories are the same. ➡ Conflicting operations: two incompatible operations (e.g., Read and Write) conflict if they both access the same data item. ✦ Incompatible operations of each transaction is assumed to conflict; do not change their execution orders. ✦ If two operations from two different transactions conflict, the corresponding transactions are also said to conflict.
  • 9. Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/9 Serializable History The following are not conflict equivalent Hs={W2(x),W2(y),R2(z),R1(x),W1(x),R3(x),R3(y),R3(z)} H1={W2(x),R1(x), R3(x),W1(x),W2(y),R3(y),R2(z),R3(z)} The following are conflict equivalent; therefore H2 is serializable. Hs={W2(x),W2(y),R2(z),R1(x),W1(x),R3(x),R3(y),R3(z)} H2={W2(x),R1(x),W1(x),R3(x),W2(y),R3(y),R2(z),R3(z)} T1: Read(x) T2: Write(x) T3: Read(x) Write(x) Write(y) Read(y) Commit Read(z) Read(z) Commit Commit
  • 10. Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/10 Serializability in Distributed DBMS • Somewhat more involved. Two histories have to be considered: ➡ local histories ➡ global history • For global transactions (i.e., global history) to be serializable, two conditions are necessary: ➡ Each local history should be serializable. ➡ Two conflicting operations should be in the same relative order in all of the local histories where they appear together.
  • 11. Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/11 Global Non-serializability • x stored at Site 1, y stored at Site 2 • LH1, LH2 are individually serializable (in fact serial), but the two transactions are not globally serializable. T1: Read(x) T2: Read(x) x ←x-100 Read(y) Write(x) Commit Read(y) y ←y+100 Write(y) Commit LH1={R1(x),W1(x), R2(x)} LH2={R2(y), R1(y),W1(y)}
  • 12. Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/12 Concurrency Control Algorithms • Pessimistic ➡ Two-Phase Locking-based (2PL) ✦ Centralized (primary site) 2PL ✦ Primary copy 2PL ✦ Distributed 2PL ➡ Timestamp Ordering (TO) ✦ Basic TO ✦ Multiversion TO ✦ Conservative TO ➡ Hybrid • Optimistic ➡ Locking-based ➡ Timestamp ordering-based
  • 13. Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/13 Locking-Based Algorithms • Transactions indicate their intentions by requesting locks from the scheduler (called lock manager). • Locks are either read lock (rl) [also called shared lock] or write lock (wl) [also called exclusive lock] • Read locks and write locks conflict (because Read and Write operations are incompatible rl wl rl yes no wl no no • Locking works nicely to allow concurrent processing of transactions.
  • 14. Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/14 Two-Phase Locking (2PL)  A Transaction locks an object before using it.  When an object is locked by another transaction, the requesting transaction must wait.  When a transaction releases a lock, it may not request another lock. Obtain lock Release lock Lock point Phase 1 Phase 2 BEGIN END No.oflocks
  • 15. Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/15 Strict 2PL Hold locks until the end. Obtain lock Release lock BEGIN END Transaction duration period of data item use No.oflocks
  • 16. Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/16 Centralized 2PL • There is only one 2PL scheduler in the distributed system. • Lock requests are issued to the central scheduler. Data Processors at participating sites Coordinating TM Central Site LM
  • 17. Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/17 Distributed 2PL • 2PL schedulers are placed at each site. Each scheduler handles lock requests for data at that site. • A transaction may read any of the replicated copies of item x, by obtaining a read lock on one of the copies of x. Writing into x requires obtaining write locks for all copies of x.
  • 18. Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/18 Distributed 2PL Execution Coordinating TM Participating LMs Participating DPs
  • 19. Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/19 Timestamp Ordering Transaction (Ti) is assigned a globally unique timestamp ts(Ti). Transaction manager attaches the timestamp to all operations issued by the transaction. Each data item is assigned a write timestamp (wts) and a read timestamp (rts): ➡ rts(x) = largest timestamp of any read on x ➡ wts(x) = largest timestamp of any read on x Conflicting operations are resolved by timestamp order. Basic T/O: for Ri(x) for Wi(x) if ts(Ti) < wts(x) if ts(Ti) < rts(x) and ts(Ti) < wts(x) then reject Ri(x) then reject Wi(x) else accept Ri(x) else accept Wi(x) rts(x) ts(Ti) wts(x) ts(Ti)
  • 20. Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/20 Conservative Timestamp Ordering • Basic timestamp ordering tries to execute an operation as soon as it receives it ➡ progressive ➡ too many restarts since there is no delaying • Conservative timestamping delays each operation until there is an assurance that it will not be restarted • Assurance? ➡ No other operation with a smaller timestamp can arrive at the scheduler ➡ Note that the delay may result in the formation of deadlocks
  • 21. Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/21 Multiversion Timestamp Ordering • Do not modify the values in the database, create new values. • A Ri(x) is translated into a read on one version of x. ➡ Find a version of x (say xv) such that ts(xv) is the largest timestamp less than ts(Ti). • A Wi(x) is translated into Wi(xw) and accepted if the scheduler has not yet processed any Rj(xr) such that ts(Ti) < ts(xr) < ts(Tj)
  • 22. Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/22 Optimistic Concurrency Control Algorithms Pessimistic execution Optimistic execution Validate Read Compute Write ValidateRead Compute Write
  • 23. Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/23 Optimistic Concurrency Control Algorithms • Transaction execution model: divide into subtransactions each of which execute at a site ➡ Tij: transaction Ti that executes at site j • Transactions run independently at each site until they reach the end of their read phases • All subtransactions are assigned a timestamp at the end of their read phase • Validation test performed during validation phase. If one fails, all rejected.
  • 24. Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/24 Optimistic CC Validation Test  If all transactions Tk where ts(Tk) < ts(Tij) have completed their write phase before Tij has started its read phase, then validation succeeds ➡ Transaction executions in serial order Tk R V W R V W Tij
  • 25. Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/25 Optimistic CC Validation Test  If there is any transaction Tk such that ts(Tk)<ts(Tij) and which completes its write phase while Tij is in its read phase, then validation succeeds if WS(Tk) RS(Tij) = Ø ➡ Read and write phases overlap, but Tij does not read data items written by Tk R V W Tk R V W Tij
  • 26. Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/26 Optimistic CC Validation Test  If there is any transaction Tk such that ts(Tk)< ts(Tij) and which completes its read phase before Tij completes its read phase, then validation succeeds if WS(Tk) RS(Tij) = Ø and WS(Tk) WS(Tij) = Ø ➡ They overlap, but don't access any common data items. R V W Tk R V W Tij
  • 27. Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/27 Deadlock • A transaction is deadlocked if it is blocked and will remain blocked until there is intervention. • Locking-based CC algorithms may cause deadlocks. • TO-based algorithms that involve waiting may cause deadlocks. • Wait-for graph ➡ If transaction Ti waits for another transaction Tj to release a lock on an entity, then Ti → Tj in WFG. Ti Tj
  • 28. Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/28 Local versus Global WFG Assume T1 and T2 run at site 1, T3 and T4 run at site 2. Also assume T3 waits for a lock held by T4 which waits for a lock held by T1 which waits for a lock held by T2 which, in turn, waits for a lock held by T3. Local WFG Global WFG T1 Site 1 Site 2 T2 T4 T3 T1 T2 T4 T3
  • 29. Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/29 Deadlock Management • Ignore ➡ Let the application programmer deal with it, or restart the system • Prevention ➡ Guaranteeing that deadlocks can never occur in the first place. Check transaction when it is initiated. Requires no run time support. • Avoidance ➡ Detecting potential deadlocks in advance and taking action to insure that deadlock will not occur. Requires run time support. • Detection and Recovery ➡ Allowing deadlocks to form and then finding and breaking them. As in the avoidance scheme, this requires run time support.
  • 30. Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/30 Deadlock Prevention • All resources which may be needed by a transaction must be predeclared. ➡ The system must guarantee that none of the resources will be needed by an ongoing transaction. ➡ Resources must only be reserved, but not necessarily allocated a priori ➡ Unsuitability of the scheme in database environment ➡ Suitable for systems that have no provisions for undoing processes. • Evaluation: – Reduced concurrency due to preallocation – Evaluating whether an allocation is safe leads to added overhead. – Difficult to determine (partial order) + No transaction rollback or restart is involved.
  • 31. Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/31 Deadlock Avoidance • Transactions are not required to request resources a priori. • Transactions are allowed to proceed unless a requested resource is unavailable. • In case of conflict, transactions may be allowed to wait for a fixed time interval. • Order either the data items or the sites and always request locks in that order. • More attractive than prevention in a database environment.
  • 32. Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/32 Deadlock Avoidance – Wait-Die Algorithm If Ti requests a lock on a data item which is already locked by Tj, then Ti is permitted to wait iff ts(Ti)<ts(Tj). If ts(Ti)>ts(Tj), then Ti is aborted and restarted with the same timestamp. ➡ if ts(Ti)<ts(Tj) then Ti waits else Ti dies ➡ non-preemptive: Ti never preempts Tj ➡ prefers younger transactions
  • 33. Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/33 Deadlock Avoidance – Wound-Wait Algorithm If Ti requests a lock on a data item which is already locked by Tj , then Ti is permitted to wait iff ts(Ti)>ts(Tj). If ts(Ti)<ts(Tj), then Tj is aborted and the lock is granted to Ti. ➡ if ts(Ti)<ts(Tj) then Tj is wounded else Ti waits ➡ preemptive: Ti preempts Tj if it is younger ➡ prefers older transactions
  • 34. Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/34 Deadlock Detection • Transactions are allowed to wait freely. • Wait-for graphs and cycles. • Topologies for deadlock detection algorithms ➡ Centralized ➡ Distributed ➡ Hierarchical
  • 35. Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/35 Centralized Deadlock Detection • One site is designated as the deadlock detector for the system. Each scheduler periodically sends its local WFG to the central site which merges them to a global WFG to determine cycles. • How often to transmit? ➡ Too often ⇒ higher communication cost but lower delays due to undetected deadlocks ➡ Too late ⇒ higher delays due to deadlocks, but lower communication cost • Would be a reasonable choice if the concurrency control algorithm is also centralized. • Proposed for Distributed INGRES
  • 36. Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/36 Build a hierarchy of detectors Hierarchical Deadlock Detection Site 1 Site 2 Site 3 Site 4 DD21 DD22 DD23 DD24 DD11 DD14 DD0x
  • 37. Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/37 Distributed Deadlock Detection • Sites cooperate in detection of deadlocks. • One example: ➡ The local WFGs are formed at each site and passed on to other sites. Each local WFG is modified as follows:  Since each site receives the potential deadlock cycles from other sites, these edges are added to the local WFGs  The edges in the local WFG which show that local transactions are waiting for transactions at other sites are joined with edges in the local WFGs which show that remote transactions are waiting for local ones. ➡ Each local deadlock detector: ✦ looks for a cycle that does not involve the external edge. If it exists, there is a local deadlock which can be handled locally. ✦ looks for a cycle involving the external edge. If it exists, it indicates a potential global deadlock. Pass on the information to the next site.
  • 38. Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/38 “Relaxed” Concurrency Control • Non-serializable histories ➡ E.g., ordered shared locks ➡ Semantics of transactions can be used ✦ Look at semantic compatibility of operations rather than simply looking at reads and writes • Nested distributed transactions ➡ Closed nested transactions ➡ Open nested transactions ➡ Multilevel transactions
  • 39. Distributed DBMS © M. T. Özsu & P. Valduriez Ch.11/39 Multilevel Transactions Consider two transactions T1: Withdraw(o,x) T2: Withdraw(o,y) Deposit(p,x) Deposit(p,y)