A program optimization for automatic database result caching
Author(s)
Scully, Ziv; Chlipala, Adam
DownloadA program optimization.pdf (428.5Kb)
OPEN_ACCESS_POLICY
Open Access Policy
Creative Commons Attribution-Noncommercial-Share Alike
Terms of use
Metadata
Show full item recordAbstract
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.
Date issued
2017-01Department
Massachusetts Institute of Technology. Department of Electrical Engineering and Computer ScienceJournal
Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages - POPL 2017
Publisher
Association for Computing Machinery (ACM)
Citation
Scully, Ziv, and Adam Chlipala. “A Program Optimization for Automatic Database Result Caching.” 44th ACM SIGPLAN Symposium on Principles of Programming Languages, Paris, France 15-21 January, 2017. ACM Press, 2017. 271–284.
Version: Author's final manuscript
ISBN
978-1-4503-4660-3