CS848 Paper Presentaonkmsalem/courses/CS848W10/...CS848 Paper Presentaon Scalable Query Result...

39
CS848 Paper Presenta.on Scalable Query Result Caching for Web Applica9ons Garrod, Manjhi, Ailamaki, Maggs, Mowry, Olston, Tomasic PVLDB 2008 Presented by Rehan Rauf David R. Cheriton School of Computer Science University of Waterloo 18 th January 2010 1

Transcript of CS848 Paper Presentaonkmsalem/courses/CS848W10/...CS848 Paper Presentaon Scalable Query Result...

Page 1: CS848 Paper Presentaonkmsalem/courses/CS848W10/...CS848 Paper Presentaon Scalable Query Result Caching for Web Applicaons Garrod, Manjhi, Ailamaki, Maggs, Mowry, Olston, Tomasic PVLDB

CS848 Paper Presenta.on Scalable Query Result Caching for 

Web Applica9ons 

 Garrod, Manjhi, Ailamaki, Maggs, Mowry, Olston, Tomasic 

PVLDB 2008 

Presented by Rehan Rauf 

David R. Cheriton School of Computer Science University of Waterloo 

18th January 2010 

Page 2: CS848 Paper Presentaonkmsalem/courses/CS848W10/...CS848 Paper Presentaon Scalable Query Result Caching for Web Applicaons Garrod, Manjhi, Ailamaki, Maggs, Mowry, Olston, Tomasic PVLDB

Problem 

•  Central database server becomes a boQle‐neck in Content Distributed Networks 

•  Replica.on of database among mul.ple servers removes boQle‐neck but … •  requires low latency consistency which conflicts with low latency between    user and server •  does not scale linearly with cost. 

•  Tradi.onal proxy‐cache based solu.ons remove boQle‐neck but … •  inefficiently maintain consistency •  scalability is limited by low cache hit‐rate  

Page 3: CS848 Paper Presentaonkmsalem/courses/CS848W10/...CS848 Paper Presentaon Scalable Query Result Caching for Web Applicaons Garrod, Manjhi, Ailamaki, Maggs, Mowry, Olston, Tomasic PVLDB

High‐level Architecture of Ferdinand 

Proxy Server 

Proxy Server 

Proxy Server 

Proxy Server 

DHT Overlay 

Publish/ Subscribe 

Central Server 

Page 4: CS848 Paper Presentaonkmsalem/courses/CS848W10/...CS848 Paper Presentaon Scalable Query Result Caching for Web Applicaons Garrod, Manjhi, Ailamaki, Maggs, Mowry, Olston, Tomasic PVLDB

Ferdinand Proxy Server 

Page 5: CS848 Paper Presentaonkmsalem/courses/CS848W10/...CS848 Paper Presentaon Scalable Query Result Caching for Web Applicaons Garrod, Manjhi, Ailamaki, Maggs, Mowry, Olston, Tomasic PVLDB

Opera.ons 

Each query has a master proxy server 

Proxy Server Master Proxy 

Server 

Central Server 

Page 6: CS848 Paper Presentaonkmsalem/courses/CS848W10/...CS848 Paper Presentaon Scalable Query Result Caching for Web Applicaons Garrod, Manjhi, Ailamaki, Maggs, Mowry, Olston, Tomasic PVLDB

Opera.ons 

Proxy Server Master Proxy 

Server 

Central Server 

Page 7: CS848 Paper Presentaonkmsalem/courses/CS848W10/...CS848 Paper Presentaon Scalable Query Result Caching for Web Applicaons Garrod, Manjhi, Ailamaki, Maggs, Mowry, Olston, Tomasic PVLDB

Opera.ons 

Proxy Server Master Proxy 

Server 

Central Server 

Page 8: CS848 Paper Presentaonkmsalem/courses/CS848W10/...CS848 Paper Presentaon Scalable Query Result Caching for Web Applicaons Garrod, Manjhi, Ailamaki, Maggs, Mowry, Olston, Tomasic PVLDB

Opera.ons 

Proxy Server Master Proxy 

Server 

Central Server 

Page 9: CS848 Paper Presentaonkmsalem/courses/CS848W10/...CS848 Paper Presentaon Scalable Query Result Caching for Web Applicaons Garrod, Manjhi, Ailamaki, Maggs, Mowry, Olston, Tomasic PVLDB

Opera.ons 

Proxy Server Master Proxy 

Server 

Central Server 

Page 10: CS848 Paper Presentaonkmsalem/courses/CS848W10/...CS848 Paper Presentaon Scalable Query Result Caching for Web Applicaons Garrod, Manjhi, Ailamaki, Maggs, Mowry, Olston, Tomasic PVLDB

Opera.ons 

Proxy Server Master Proxy 

Server 

Central Server 

10 

Page 11: CS848 Paper Presentaonkmsalem/courses/CS848W10/...CS848 Paper Presentaon Scalable Query Result Caching for Web Applicaons Garrod, Manjhi, Ailamaki, Maggs, Mowry, Olston, Tomasic PVLDB

Opera.ons 

Proxy Server Master Proxy 

Server 

Central Server 

Proxy Server 

11 

Page 12: CS848 Paper Presentaonkmsalem/courses/CS848W10/...CS848 Paper Presentaon Scalable Query Result Caching for Web Applicaons Garrod, Manjhi, Ailamaki, Maggs, Mowry, Olston, Tomasic PVLDB

Opera.ons 

Proxy Server Master Proxy 

Server 

Central Server 

Proxy Server 

Update no.fica.on 

12 

Page 13: CS848 Paper Presentaonkmsalem/courses/CS848W10/...CS848 Paper Presentaon Scalable Query Result Caching for Web Applicaons Garrod, Manjhi, Ailamaki, Maggs, Mowry, Olston, Tomasic PVLDB

Proxy Server Cache 

•  When  proxy server receives update no.fica.on, the consistency module invalidates the query result. 

•  Even if results can be processed using previously cached results, it is not done  

13 

Page 14: CS848 Paper Presentaonkmsalem/courses/CS848W10/...CS848 Paper Presentaon Scalable Query Result Caching for Web Applicaons Garrod, Manjhi, Ailamaki, Maggs, Mowry, Olston, Tomasic PVLDB

Advantages/ Disadvantages 

•  Advantages •  High cache hit rate. •  More work offloaded from the backend server 

• Disadvantage •  Latency cost of an over all cache miss is greater 

14 

Page 15: CS848 Paper Presentaonkmsalem/courses/CS848W10/...CS848 Paper Presentaon Scalable Query Result Caching for Web Applicaons Garrod, Manjhi, Ailamaki, Maggs, Mowry, Olston, Tomasic PVLDB

Consistency Management 

•  Any proxy caching a par.cular query must be no.fied when an update affects the result of that query. 

•  Query Update Mul.cast Associa.on (QUMA) is used to ensure this requirement. 

15 

Page 16: CS848 Paper Presentaonkmsalem/courses/CS848W10/...CS848 Paper Presentaon Scalable Query Result Caching for Web Applicaons Garrod, Manjhi, Ailamaki, Maggs, Mowry, Olston, Tomasic PVLDB

QUMA Solu.on 

•  Mul.cast groups are created.  •  Offline analysis of applica.on’s template database queries is performed. •  Independence analysis is done to determine independence of query‐update pairs. 

•  Goals •  Any update no.fica.on published to a group should affect each query subscribed to that group •  Related queries should be clustered into same mul.cast group to reduce number of no.fica.ons. 

•  Each cached query subscribes to appropriate mul.cast groups.  •  Updates are published to these groups and hence reach the appropriate proxy server. 

16 

Page 17: CS848 Paper Presentaonkmsalem/courses/CS848W10/...CS848 Paper Presentaon Scalable Query Result Caching for Web Applicaons Garrod, Manjhi, Ailamaki, Maggs, Mowry, Olston, Tomasic PVLDB

QUMA Example 

17 

Page 18: CS848 Paper Presentaonkmsalem/courses/CS848W10/...CS848 Paper Presentaon Scalable Query Result Caching for Web Applicaons Garrod, Manjhi, Ailamaki, Maggs, Mowry, Olston, Tomasic PVLDB

QUMA Solu.on 

•  Selec.on predicates are only prac.cal when they are equality based. •  The process is not automated yet. 

18 

Page 19: CS848 Paper Presentaonkmsalem/courses/CS848W10/...CS848 Paper Presentaon Scalable Query Result Caching for Web Applicaons Garrod, Manjhi, Ailamaki, Maggs, Mowry, Olston, Tomasic PVLDB

Consistency Management 

•  For each mul.cast group, there is a master mul.cast group. •  used for communica.on with master proxies. 

19 

Page 20: CS848 Paper Presentaonkmsalem/courses/CS848W10/...CS848 Paper Presentaon Scalable Query Result Caching for Web Applicaons Garrod, Manjhi, Ailamaki, Maggs, Mowry, Olston, Tomasic PVLDB

Cache Miss 

Proxy Server 

20 

Page 21: CS848 Paper Presentaonkmsalem/courses/CS848W10/...CS848 Paper Presentaon Scalable Query Result Caching for Web Applicaons Garrod, Manjhi, Ailamaki, Maggs, Mowry, Olston, Tomasic PVLDB

Cache Miss 

Proxy Server 

subscribe 

21 

Page 22: CS848 Paper Presentaonkmsalem/courses/CS848W10/...CS848 Paper Presentaon Scalable Query Result Caching for Web Applicaons Garrod, Manjhi, Ailamaki, Maggs, Mowry, Olston, Tomasic PVLDB

Cache Miss 

Proxy Server 

Master Proxy 

22 

Page 23: CS848 Paper Presentaonkmsalem/courses/CS848W10/...CS848 Paper Presentaon Scalable Query Result Caching for Web Applicaons Garrod, Manjhi, Ailamaki, Maggs, Mowry, Olston, Tomasic PVLDB

Cache Miss 

Proxy Server 

Master Proxy 

23 

Page 24: CS848 Paper Presentaonkmsalem/courses/CS848W10/...CS848 Paper Presentaon Scalable Query Result Caching for Web Applicaons Garrod, Manjhi, Ailamaki, Maggs, Mowry, Olston, Tomasic PVLDB

Cache Miss 

Proxy Server 

Master Proxy 

MG 

MG 

MG 

24 

Page 25: CS848 Paper Presentaonkmsalem/courses/CS848W10/...CS848 Paper Presentaon Scalable Query Result Caching for Web Applicaons Garrod, Manjhi, Ailamaki, Maggs, Mowry, Olston, Tomasic PVLDB

Cache Miss 

Proxy Server 

Master Proxy 

MG 

MG 

MG 

Central Server 

25 

Page 26: CS848 Paper Presentaonkmsalem/courses/CS848W10/...CS848 Paper Presentaon Scalable Query Result Caching for Web Applicaons Garrod, Manjhi, Ailamaki, Maggs, Mowry, Olston, Tomasic PVLDB

Update 

Proxy Server 

Master Proxy 

Central Server 

26 

Page 27: CS848 Paper Presentaonkmsalem/courses/CS848W10/...CS848 Paper Presentaon Scalable Query Result Caching for Web Applicaons Garrod, Manjhi, Ailamaki, Maggs, Mowry, Olston, Tomasic PVLDB

Update 

Proxy Server 

Master Proxy 

MG 

MG 

MG 

Central Server 

27 

Page 28: CS848 Paper Presentaonkmsalem/courses/CS848W10/...CS848 Paper Presentaon Scalable Query Result Caching for Web Applicaons Garrod, Manjhi, Ailamaki, Maggs, Mowry, Olston, Tomasic PVLDB

Update 

Proxy Server 

Master Proxy 

MG 

MG 

MG 

Central Server 

28 

Page 29: CS848 Paper Presentaonkmsalem/courses/CS848W10/...CS848 Paper Presentaon Scalable Query Result Caching for Web Applicaons Garrod, Manjhi, Ailamaki, Maggs, Mowry, Olston, Tomasic PVLDB

Update 

Proxy Server 

Master Proxy 

MG 

MG 

MG 

Central Server 

29 

Page 30: CS848 Paper Presentaonkmsalem/courses/CS848W10/...CS848 Paper Presentaon Scalable Query Result Caching for Web Applicaons Garrod, Manjhi, Ailamaki, Maggs, Mowry, Olston, Tomasic PVLDB

Update 

Proxy Server 

Master Proxy 

MG 

MG 

MG 

Central Server 

Proxy Server 

Proxy Server 

30 

Page 31: CS848 Paper Presentaonkmsalem/courses/CS848W10/...CS848 Paper Presentaon Scalable Query Result Caching for Web Applicaons Garrod, Manjhi, Ailamaki, Maggs, Mowry, Olston, Tomasic PVLDB

Consistency Management 

•  Ensures that query cache remains coherent with the central DB but.. •  Guarantees full consistency only for single statement transac.ons. 

•  Requires a reliable publish/subscribe system. 

•  Requires serializability guarantees from central database    

31 

Page 32: CS848 Paper Presentaonkmsalem/courses/CS848W10/...CS848 Paper Presentaon Scalable Query Result Caching for Web Applicaons Garrod, Manjhi, Ailamaki, Maggs, Mowry, Olston, Tomasic PVLDB

Implementa.on 

•  JDBC Driver •  Proxy runs Apache tomcat as sta.c cache •  Pastry overlay as DHT ( is based on PRR tree)  •  Scribe for publish scribe 

•  does not guarantee reliable delivery. •  Ferdinand cache map is stored in MySQL4 •  Backend database is MYSQL4 

32 

Page 33: CS848 Paper Presentaonkmsalem/courses/CS848W10/...CS848 Paper Presentaon Scalable Query Result Caching for Web Applicaons Garrod, Manjhi, Ailamaki, Maggs, Mowry, Olston, Tomasic PVLDB

Evalua.on 

•  Performance comparison with  several alterna.ve approaches. 

•  Performance of DHT based coopera.ve caching in varying network latency scenarios. 

•  Publish/subscribe vs simple broadcast‐based system 

33 

Page 34: CS848 Paper Presentaonkmsalem/courses/CS848W10/...CS848 Paper Presentaon Scalable Query Result Caching for Web Applicaons Garrod, Manjhi, Ailamaki, Maggs, Mowry, Olston, Tomasic PVLDB

Evalua.on 

•  Emulab testbed •  Proxy ran on 3 GHz  Intel Pen.um Xeon, 1GB ram, 10,000 RPM SCSI disk. •  Benchmark clients on 850 MHz client servers. •  Benchmark 

•  TPC‐W bookstore •  RUBiS auc.on •  RUBBos bulle.n board 

• Conforms to TPC‐W model of emulated browsers 

34 

Page 35: CS848 Paper Presentaonkmsalem/courses/CS848W10/...CS848 Paper Presentaon Scalable Query Result Caching for Web Applicaons Garrod, Manjhi, Ailamaki, Maggs, Mowry, Olston, Tomasic PVLDB

Evalua.on: Comparison to other approaches 

35 

Page 36: CS848 Paper Presentaonkmsalem/courses/CS848W10/...CS848 Paper Presentaon Scalable Query Result Caching for Web Applicaons Garrod, Manjhi, Ailamaki, Maggs, Mowry, Olston, Tomasic PVLDB

Evalua.on: Cache Miss Rate 

36 

Page 37: CS848 Paper Presentaonkmsalem/courses/CS848W10/...CS848 Paper Presentaon Scalable Query Result Caching for Web Applicaons Garrod, Manjhi, Ailamaki, Maggs, Mowry, Olston, Tomasic PVLDB

Evalua.on: Throughput as a func.on of latency 

37 

Page 38: CS848 Paper Presentaonkmsalem/courses/CS848W10/...CS848 Paper Presentaon Scalable Query Result Caching for Web Applicaons Garrod, Manjhi, Ailamaki, Maggs, Mowry, Olston, Tomasic PVLDB

Evalua.on: Throughput compared to broadcast‐based consistency   

38 

Page 39: CS848 Paper Presentaonkmsalem/courses/CS848W10/...CS848 Paper Presentaon Scalable Query Result Caching for Web Applicaons Garrod, Manjhi, Ailamaki, Maggs, Mowry, Olston, Tomasic PVLDB

39 

Closing Observa.ons 

•  No Scalability evalua.on shown. 

•  Not suitable for update intensive applica.on.  

•  Requires offline analysis of database requests. 

•  Failure Scenarios need to be deal with.  

•  No consistency for mul. statement transac.ons.