Relaxed Currency and Consistency: How to Say “Good Enough” in SQL

14
Consistency: How to Say “Good Enough” in SQL H. Guo, P. Larson, R. Ramakrishnan, J. Goldstein Presented by Mike Nie

description

Relaxed Currency and Consistency: How to Say “Good Enough” in SQL. H. Guo, P. Larson, R. Ramakrishnan, J. Goldstein Presented by Mike Nie. Background-1. Using asynchronous copies technique is common because they are good for: scalability - PowerPoint PPT Presentation

Transcript of Relaxed Currency and Consistency: How to Say “Good Enough” in SQL

Page 1: Relaxed Currency and Consistency: How to Say “Good Enough” in SQL

Relaxed Currency and Consistency:

How to Say “Good Enough” in SQL

H. Guo, P. Larson, R. Ramakrishnan, J. Goldstein

Presented by Mike Nie

Page 2: Relaxed Currency and Consistency: How to Say “Good Enough” in SQL

Background-1

•Using asynchronous copies technique is common because they are good for:

•scalability

•performance

•availability

Page 3: Relaxed Currency and Consistency: How to Say “Good Enough” in SQL

Background-II

•The way asynchronous copies technique works:

• Replicate data over a number of database systems

• User interact with replicas to balance the workload of the entire system

• Data update over the entire system is not in the same scope the transactions; the system will propagate the update later for the purpose of better respond time

Page 4: Relaxed Currency and Consistency: How to Say “Good Enough” in SQL

Motivation

•Currently there is NO way for user to express “freshness” in SQL.

•Database system can’t respond well because queries are not explicit, even though it can easily keep track how current its data is.

Page 5: Relaxed Currency and Consistency: How to Say “Good Enough” in SQL

Currency and Consistency

•Currency: how fresh the data is in replica database system

•Consistency: whether or not two replica tables correspond to the same snapshot

•e.g. book_copy and review_copy

Page 6: Relaxed Currency and Consistency: How to Say “Good Enough” in SQL

C & C Syntax in SQL

•A C & C Clause occurs last in SFW block and follow the same scoping rule as the Where clause

•New clause can reference tables defined in current and outer SFW blocks

Page 7: Relaxed Currency and Consistency: How to Say “Good Enough” in SQL

Single-Block Query

Page 8: Relaxed Currency and Consistency: How to Say “Good Enough” in SQL

Multi-Block Query

Page 9: Relaxed Currency and Consistency: How to Say “Good Enough” in SQL

Implementation-I•Integrate C & C in MTCache

Page 10: Relaxed Currency and Consistency: How to Say “Good Enough” in SQL

Implementation-II

•Normalizing C&C Constraints

•Transform C&C clause to a set of tuples, e.g. C = {<b1,S1>,<b2,S2>,...,<bn,Sn>}

•Compile-Time Consistency Checking

•Integrate consistency checking into SQL optimizer

Page 11: Relaxed Currency and Consistency: How to Say “Good Enough” in SQL

Implentation-III•Compile-time consistency

checking(cont.)

• e.g. checking if Reserves and Sailors belong to the same mutually consistent group.

Page 12: Relaxed Currency and Consistency: How to Say “Good Enough” in SQL

Implementation-IV• Run-time currency Checking

•whether exist a copy in locate that is satisfy currency bound

• choose plan based on cost

Page 13: Relaxed Currency and Consistency: How to Say “Good Enough” in SQL

Experiments

•Query Optimization Experiments

•Workload Distribution

•Overhead of Currency Guards

Page 14: Relaxed Currency and Consistency: How to Say “Good Enough” in SQL

Conclusion

•Given such an explicit syntax user can specify C&C constraints in SQL

•System can respond well given such an explicit requirement

•Questions and Comments