Concurrency Control and Reliable Commit Protocol in Distributed Database Systems
Concurrency Control and Reliable Commit Protocol in Distributed Database Systems
Autonomy(A): controller
– 0: right integration, 1:semiautonomous system, 2:
isolation
Heterogeneity(H):
– 0:homogenous, 1: heterogeneous
Distribution(D): data arrangement
– 0:no distribution, 1:client/server arch., 2:peer-to-
peer
Issues in DDBMS
Pessimistic
– Two-phase locking protocol (Mutex)
– Timestamp ordering protocol
– Hybrid
Optimistic
– Locking based
– Timestamp ordering based
Two-phase locking
Distributed 2PL
Centralized 2PL
Locking and Timestamp Ordering
2PL is simple and guarantees serializability but the lock
ing may damage the throughput of the system, and ma
y cause dead-lock.
Timestamp Ordering (TO) protocols don’t attempt to m
aintain serializability of by mutual exclusion so that it w
on’t cause dead-lock
TO rule: Given two conflicting operations Oij and Okl, be
longs to Ti and Tk (Tk is younger), the former operation i
s executed before the latter if and only if ts(Ti) < ts(Tk)
Basic TO Algorithm
Transaction (Ti) is assigned a globally unique timestamp ts(Ti)
Transaction managers attach the timestamp to all operations i
ssued by the transaction
Each data item is assigned a write timestamp and a read time
stamp:
– rts(x), wts(x)
For Rt(x) for Wt(x)
– If ts(Tt) < wts(x) if ts(Tt) < rts(x) and ts(Tt) < wts(x)
– then reject Rt(x) then reject Wt(x)
– else accept Rt(x) else accept Wt(x)
– rts(x) <- ts(Tt) wts(x) <- ts(Tt)
Basic TO Algorithm (2) cont.