Outline Distributed DBMS Introduction Background Distributed DBMS Architecture
Outline Distributed DBMS Introduction Background Distributed DBMS Architecture Distributed Database Design Distributed Query Processing Distributed Transaction Management Transaction Concepts and Models Distributed Concurrency Control Distributed Reliability Building Distributed Database Systems (RAID) Mobile Database Systems Privacy, Trust, and Authentication Peer to Peer Systems © 1998 M. Tamer Özsu & Patrick Valduriez Page 10 -12. 1
Useful References H. T. Kung and John T. Robinson, On Optimistic Methods for Concurrency Control, ACM Trans. Database Systems, 6(2), 1981. B. Bhargava, Concurrency Control in Database Systems, IEEE Trans on Knowledge and Data Engineering, 11(1), Jan. -Feb. 1999 Distributed DBMS © 1998 M. Tamer Özsu & Patrick Valduriez Page 10 -12. 2
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 © 1998 M. Tamer Özsu & Patrick Valduriez Page 10 -12. 3
Optimistic Concurrency Control Processing Start Integrity Control & Local Validation Read, Compute, And Write Local Success Semi-Commit On Initiating Site Fail Commit, Global Write Finish Success Integrity Control & Global Validation Fail Distributed DBMS © 1998 M. Tamer Özsu & Patrick Valduriez Page 10 -12. 4
Transaction Types on a Site Committed Transactions Validating Transactions Semi-Committed Transactions Still Reading/Computing Distributed DBMS © 1998 M. Tamer Özsu & Patrick Valduriez Page 10 -12. 5
Exmaple of Locking vs Optimistic TJ Ti S(Ri) S(RJ) S(Wi) S(WJ) S(Ri) S(WJ) ø AND Locking Ri R J W i W J (Ri) < (WJ) T i → TJ Optimistic Ri R J W i W J Ri R J W i Distributed DBMS © 1998 M. Tamer Özsu & Patrick Valduriez Page 10 -12. 6
Example: R 1 R 2 R 3 Rn. . . W 1 W 2 W 3 Wn Locking: This history not allowed W 2 is blocked by R 1 T 2 cannot finish before T 1 What if T 1 is a log trans. and T 2 is a small trans. ? T 1 blocks T 2; can block T 3 … Tn if Optimistic [Kung] Ti (i = 2, …, n) commit. Wi saved for validn R 1 validated with Wi, T 1 aborted switch to Distributed DBMS © 1998 M. Tamer Özsu & Patrick Valduriez Page 10 -12. 7
Optimistic Validation (first modification) Try this or this switch Ti’s can commit, Wi and Ri saved from validation W 1 validates with Wi and Ri T 1 aborted if validation fails (second modification) Switch R 1 to the right after W 2, W 3…Wn Switch W 1 to the left before Rn, Rn-1…R 2 If R 1 and W 1 are adjacent, T 1 is successful Distributed DBMS © 1998 M. Tamer Özsu & Patrick Valduriez Page 10 -12. 8
Probability that two transactions do not share an object Lower bound on this problem Maximum problem that two transactions will share an object BS M 5 100 . 0576 10 500 . 0025 20 1000 . 113 Distributed DBMS Probability of conflict © 1998 M. Tamer Özsu & Patrick Valduriez Probability of cycle = 0(PC 2) small Page 10 -12. 9
Concurrency/Multiprogramming level is low Example: I/O = . 005 seconds CPU = . 0001 seconds Trans size = 5 Time to execute trans. = . 0255 seconds For another trans. to meet this trans. in the system Arrival rate > Distributed DBMS or > 40 per second © 1998 M. Tamer Özsu & Patrick Valduriez Page 10 -12. 10
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 Tij Distributed DBMS R © 1998 M. Tamer Özsu & Patrick Valduriez V W Page 10 -12. 11
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 Tk R V W Tij Distributed DBMS R © 1998 M. Tamer Özsu & Patrick Valduriez V W Page 10 -12. 12
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 Tk Tij Distributed DBMS V R W V © 1998 M. Tamer Özsu & Patrick Valduriez W Page 10 -12. 13
- Slides: 13