Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Cachematic – Automatic Invalidation in Applicat...

xLeitix
April 10, 2019

Cachematic – Automatic Invalidation in Application-Level Caching Systems

Presentation at ICPE 2019

xLeitix

April 10, 2019
Tweet

More Decks by xLeitix

Other Decks in Research

Transcript

  1. Viktor Holmqvist Jonathan Nilsfors Philipp Leitner Cachematic – Automatic Invalidation

    in Application-Level Caching Systems Industry Track Presentation
  2. Chalmers !6 Cache Invalidation When to purge / update cached

    data? • Time-Based • Explicit (company requirement)
  3. Chalmers !8 Current State Manual Cache Management Consistent with state

    of industry, see for example Mertz and Nunes (TSE 2017) https://ieeexplore.ieee.org/stamp/stamp.jsp? tp=&arnumber=7762909
  4. Chalmers !9 Challenges of Manual Cache Management • Easy to

    miss cacheable queries • Development / maintenance complexity • Potential for bugs
  5. Chalmers !10 Goal Develop a library for application-level caching •

    Automated • Reusable • Minimal developer input “Cachematic”
  6. Chalmers !13 Application Code …. End Users Statement Parser Dependency

    Tree Hash Function Read Request Processor Write Request Processor SQL Database Key-Value Store Cachematic Code Annotations Serialization Function Cachematic Architecture
  7. Chalmers !15 If Query: if result in cache then: return

    cached val else: query DB save to val to cache Cache Management Algorithm parse DB statement process based on statement type (query or write)
  8. Chalmers !16 If Query: if result in cache then: return

    cached val else: query DB save to val to cache Cache Management Algorithm If Write: decide which tables / columns / rows are touched foreach cached result: check for invalidation (hierarchically) write update to DB parse DB statement process based on statement type (query or write)
  9. Chalmers !17 Implementation Application Code …. End Users Statement Parser

    Dependency Tree Hash Function Read Request Processor Write Request Processor SQL Database Key-Value Store Cachematic Code Annotations Serialization Function pyparsing Open Source release planned
  10. Chalmers !20 Experiment Goal • Evaluate Cachematic based on Bison’s

    production application Main RQ: • Can we improve cache hit rate / performance for read requests?
  11. Chalmers !21 Experiment Setup Load Testing Runs 6 user profiles

    AWS using Locust (https://locust.io) 30-minute test runs
  12. Chalmers !25 Lessons Learned • Can we improve cache hit

    rate / performance for read requests? Yes (by about a factor of 1.6 in our test setup)
  13. Chalmers !26 Lessons Learned • Can we improve cache hit

    rate / performance for read requests? Yes (by about a factor of 1.6 in our test setup) • But: significant overhead in write requests To some extent engineering limitation Needs to be improved for OSS release
  14. Chalmers !27 Conclusions Cachematic: Automatic application cache management for Python

    Improves cache hit rate and read performance (w.r.t. manual cache management solution) However: negative impact on write requests Although acceptable for Bison, Cachematic is not (yet) a general solution for all applications