Cachematic – Automatic Invalidation in Application-Level Caching Systems

Bc9e8d8b75bf91fed108372a5f83855c?s=47 xLeitix
April 10, 2019

Cachematic – Automatic Invalidation in Application-Level Caching Systems

Presentation at ICPE 2019

Bc9e8d8b75bf91fed108372a5f83855c?s=128

xLeitix

April 10, 2019
Tweet

Transcript

  1. 1.

    Viktor Holmqvist Jonathan Nilsfors Philipp Leitner Cachematic – Automatic Invalidation

    in Application-Level Caching Systems Industry Track Presentation
  2. 6.

    Chalmers !6 Cache Invalidation When to purge / update cached

    data? • Time-Based • Explicit (company requirement)
  3. 8.

    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. 9.

    Chalmers !9 Challenges of Manual Cache Management • Easy to

    miss cacheable queries • Development / maintenance complexity • Potential for bugs
  5. 10.

    Chalmers !10 Goal Develop a library for application-level caching •

    Automated • Reusable • Minimal developer input “Cachematic”
  6. 13.

    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. 15.

    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. 16.

    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. 17.

    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. 20.

    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. 21.

    Chalmers !21 Experiment Setup Load Testing Runs 6 user profiles

    AWS using Locust (https://locust.io) 30-minute test runs
  12. 25.

    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. 26.

    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. 27.

    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