A program optimization for automatic database result caching
Author(s)Scully, Ziv; Chlipala, Adam
MetadataShow full item record
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.
DepartmentMassachusetts Institute of Technology. Department of Electrical Engineering and Computer Science
Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages - POPL 2017
Association for Computing Machinery (ACM)
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.
Author's final manuscript