A Program Optimization for Automatic Database Result Caching
Title | A Program Optimization for Automatic Database Result Caching |
Publication Type | Conference Paper |
Year of Publication | 2017 |
Authors | Scully, Ziv, Chlipala, Adam |
Conference Name | Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages |
Publisher | ACM |
Conference Location | New York, NY, USA |
ISBN Number | 978-1-4503-4660-3 |
Keywords | database result caching, Metrics, program analysis, pubcrawl, resilience, Resiliency, Scalability, SQL, Web applications, Web Caching |
Abstract | Most popular Web applications rely on persistent databases based on languages like SQL for declarative specification of data models and the operations that read and modify them. As applications scale up in user base, they often face challenges responding quickly enough to the high volume of requests. A common aid is caching of database results in the application's memory space, taking advantage of program-specific knowledge of which caching schemes are sound and useful, embodied in handwritten modifications that make the program less maintainable. These modifications also require nontrivial reasoning about the read-write dependencies across operations. In this paper, we present a compiler optimization that automatically adds sound SQL caching to Web applications coded in the Ur/Web domain-specific functional language, with no modifications required to source code. We use a custom cache implementation that supports concurrent operations without compromising the transactional semantics of the database abstraction. Through experiments with microbenchmarks and production Ur/Web applications, we show that our optimization in many cases enables an easy doubling or more of an application's throughput, requiring nothing more than passing an extra command-line flag to the compiler. |
URL | https://dl.acm.org/citation.cfm?doid=3009837.3009891 |
DOI | 10.1145/3009837.3009891 |
Citation Key | scully_program_2017 |