Presentation is loading. Please wait.

Presentation is loading. Please wait.

Relaxed Currency Serializability for Middle-Tier Caching and Replication Philip A. Bernstein, Alan Fekete, Hongfei Guo, Raghu Ramakrishnan, Pradeep Tamma.

Similar presentations


Presentation on theme: "Relaxed Currency Serializability for Middle-Tier Caching and Replication Philip A. Bernstein, Alan Fekete, Hongfei Guo, Raghu Ramakrishnan, Pradeep Tamma."— Presentation transcript:

1 Relaxed Currency Serializability for Middle-Tier Caching and Replication Philip A. Bernstein, Alan Fekete, Hongfei Guo, Raghu Ramakrishnan, Pradeep Tamma Presented by Hawk Lin, 林宗立, D01922026 Gerome Wu, 吳文傑, R01922003 Date: 2014/06/03

2 Overview Introduction RC Serializability BSA model Correctness Performance model Experiments Conclusion

3 Objective Heuristic caching strategies can help for performance enhancement but not in sync with DB in time. The algorithm of concurrency control introduced by the paper using “freshness constraint” information for read operation to specify how fresh a copy must be in order to be read. Defining the model for the algorithms to ensure several of the most interesting freshness constraints.

4 Background Copies vs. freshness vs. consistent Example: One-copy serializability

5 Proof Relaxed Currency Serializability that accounts for out-of- date reads that are justified by user-specified freshness constraints. Freshness constraint: up-to-date a copy must be in order to be read. Up-to-date-ness may be relative to read-time, reader’s commit-time, or freshness of copies of other items that are read Novel concurrency control protocols accumulate constraints on the updater’s time, which can be checked at read-time or as part of commit processing. A detailed simulation study of the protocols shows that performance is similar to the weakest protocol used in practice, read-committed, which offers no freshness guarantee.

6 RC Serializability Serializability Theory –An execution is correct if and only if it is equivalent to some serial execution of the transactions. –Requires a weaker correctness property when it reads stale values. Relaxed-currency (RC) serializable –one-copy multiversion database –correct execution of the ideal system to be a serial multiversion execution

7 The physical system model Read Write Commit Abort

8 Freshness constraints B. Time-Bound and Value-Bound Constraints –B1. Time-Bound Constraints. bound(x:10) –B2. Value-Bound Constraints. bound(x:10%) D. “Drift” Constraints on multiple data items. –D1. Snapshot consistency. snapshot(S) –D2. Limited Time-Drift. drift(S, b) –D3. Limited Aggregate Value Drift. drift(S, AGG, b%, w) M. Multi-statement Constraints –session level

9 Enforcing RC serializability Enforcing RC-serializability: serializable and satisfy freshness constraints Enforcing RC-serializabiity is not trivial because constraints is not independent and hard to proof. Need prove for RC-serializability can adopt to have same behavior of multiversion system and replicated data system.

10 Baseline Synchronization Algorithm

11 Algorithms for Ensuring Freshness Algorithm BSA-FC –Property VT The valid interval of the value held in a copy xA must include the closed interval [last- modified t, valid-till t’’]. t’>t’’>t –Valid interval: half-open [last-modified t, next larger last-modified t’) –Time Bound bound(x:b): Add the constraint “ts(Ti) ≤ vt+b” –Limited Time-Drift Bound drift(S, b):Add the constraint “max(last-modified(S)) < min(valid-till(S))+b”

12 Algorithms for Ensuring Freshness Variants of BSA-FC –constraint vt+b replaced by [xA, lm, b] where lm is last-modified(xA) of the value read, vt=lm(xA) –Or using vt(xM) for last-modified(xA), if last- modified(xM)=last-modified(xA). –Two phase commit: check if modifed(xA) and valid- till(xA) be changed, if yes, update new value, if not, go to next phase.

13 Correctness Prove that BSA-FC is both correct the following in an equivalent ideal system –timestamp assignment –freshness constraint

14 Correctness(cont.) Bare-RCSR: A physical history H that is equivalent to some serial ideal history H’ RCSG: RC serialization graph

15 Correctness(cont.) Theorem 1: For any primary-copy physical history H, if RCSG(H) is acyclic then H is bare-RCSR. Theorem 2: For every physical history H produced by BSA, RCSG(H) is acyclic. Theorem 3: BSA-FC is RCSR.

16 Correctness(cont.) Combine 1&2, every physical history H produced by BSA is bare-RCSR, then a valid timestamp assignment for H is also valid for an ideal history equivalent to H

17 Correctness(cont.) Time-bound constraints: for read op. r[x], let a be the next version, if a is the last version, satisfied. If not, ts(T) < ts(a)+b must be true. by Property VT, vt <= ts(a), as ts(T) < vt+b is satisfied, ts(T) < ts(a)+b

18 Correctness(cont.) Time-drift constraint: |tx’’ – ty’| <= b need to be satisfied

19 Performance Model Single-site logical queuing model –Closed queuing model Master-cache logical queuing model –One master and multiple caches

20 Performance Model(cont.)

21

22 Experiments Single-site experiments –Comparing different protocols with respect to data and resource contention Master-cache experiments –Evaluate the performance gains due to cache RW Scalability experiments –Scale-out and scale-up Master-Cache vs Single Site –Caching configurations vs single-site configurations

23 Experiments(cont.) Strict 2PL –For read & write, obtain locks –Hold all locks until end of transaction. –Guarantees serializability and recoverable schedule. Read Committed –Only keeps write lock until the end of transaction.

24 Single-site

25

26

27 Master-cache RO-2PL: Strict 2PL at master, BSA-FC at cache, cache handles read-only Xactn. RW-2PL: cache also handles reads in read-write Xactn RO-BSAFC/RW-BSAFC: BSAFC at master

28 Master-cache(b=0)

29 Master-cache(b=5)

30 Master-cache(b=10)

31 Refresh Int. vs Currency Bound

32 Scalibility

33

34 Master-cache vs Single-site

35

36

37 Conclusion RC-serializability, which requires an execution to be equivalent to a serial execution on a multiversion database where the freshness constraints of reads are satisfied. Simulation study that shows the new algorithms perform like Read Committed for reasonable freshness levels.


Download ppt "Relaxed Currency Serializability for Middle-Tier Caching and Replication Philip A. Bernstein, Alan Fekete, Hongfei Guo, Raghu Ramakrishnan, Pradeep Tamma."

Similar presentations


Ads by Google