ABSTRACT
Many web applications store persistent data in databases. During execution, such applications spend a significant amount of time communicating with the database for retrieval and storing of persistent data over the network. These network round trips represent a significant fraction of the overall execution time for many applications and as a result increase their latency. While there has been prior work that aims to eliminate round trips by batching queries, they are limited by 1) a requirement that developers manually identify batching opportunities, or 2) the fact that they employ static program analysis techniques that cannot exploit many opportunities for batching. In this paper, we present Sloth, a new system that extends traditional lazy evaluation to expose query batching opportunities during application execution, even across loops, branches, and method boundaries. We evaluated Sloth using over 100 benchmarks from two large-scale open-source applications, and achieved up to a 3x reduction in page load time by delaying computation.
- Hibernate fetching strategies. http://docs.jboss.org/hibernate/orm/4.3/manual/en-US/html/ch20.html.Google Scholar
- Hibernate performance issue. http://stackoverflow.com/questions/5155718/hibernate-performance.Google Scholar
- Tracker issue management system. http://itracker.sourceforge.net.Google Scholar
- JSR 152: JavaServer Pages 2.0 specification. http://jcp.org/aboutJava/communityprocess/final/jsr152.Google Scholar
- JSR 220: Enterprise JavaBeans 3.0 specification (persistence). http://jcp.org/aboutJava/communityprocess/final/jsr220.Google Scholar
- Marissa Mayer at Web 2.0. http://glinden.blogspot.com/2006/11/marissa-mayer-at-web-20.html.Google Scholar
- Network latency under Hibernate/c3p0/MySQL. http://stackoverflow.com/questions/3623188/ network-latency-under-hibernate-c3p0-mysql.Google Scholar
- OpenMRS medical record system. http://www.openmrs.org.Google Scholar
- PhoCusWright/Akamai Study on Travel Site Performance. http://connect.phocuswright.com/2010/06/phocuswrightakamai-study-on-travel-site-performance/.Google Scholar
- Round trip network latency issue with the query generated by hibernate. http://stackoverflow.com/questions/13789901/round-trip-network-latency-issue-with-the-query-generated-by-hibernate.Google Scholar
- TPC-C and TPC-W reference implementations. http://sourceforge.net/apps/mediawiki/osdldbt.Google Scholar
- What is the n+1 selects issue? http://stackoverflow.com/questions/97197/what-is-the-n1-selects-issue.Google Scholar
- I. T. Bowman and K. Salem. Optimization of query streams using semantic prefetching. In Proc. SIGMOD, pages 179--190, 2004. Google ScholarDigital Library
- M. Chavan, R. Guravannavar, K. Ramachandra, and S. Sudarshan. Program transformations for asynchronous query submission. In Proc. ICDE, pages 375--386, 2011. Google ScholarDigital Library
- A. Cheung, O. Arden, S. Madden, and A. C. Myers. Automatic partitioning of database applications. PVLDB, 5(11):1471--1482, 2012. Google ScholarDigital Library
- A. Cheung, S. Madden, and A. Solar-Lezama. Sloth: Being lazy is a virtue (when issuing database queries). CSAIL Tech Report MIT-CSAIL-TR-2014-006.Google Scholar
- G. Giannikis, G. Alonso, and D. Kossmann. SharedDB: Killing one thousand queries with one stone. PVLDB, 5(6):526--537, 2012. Google ScholarDigital Library
- R. Guravannavar and S. Sudarshan. Rewriting procedures for batched bindings. PVLDB, 1(1):1107--1123, 2008. Google ScholarDigital Library
- P. Henderson and J. H. Morris, Jr. A lazy evaluator. In Proc. POPL, pages 95--103, 1976. Google ScholarDigital Library
- P. Z. Ingerman. Thunks: a way of compiling procedure statements with some comments on procedure declarations. Comm. ACM, 4(1):55--58, 1961. Google ScholarDigital Library
- S. L. P. Jones and A. L. M. Santos. A transformation-based optimiser for haskell. Sci. Comput. Program., 32(1-3):3--47, 1998. Google ScholarDigital Library
- G. A. Kildall. A unified approach to global program optimization. In Proc. POPL, pages 194--206, 1973. Google ScholarDigital Library
- N. Nystrom, M. R. Clarkson, and A. C. Myers. Polyglot: An extensible compiler framework for Java. In Proc. CC, pages 138--152, 2003. Google ScholarDigital Library
- K. Ramachandra and S. Sudarshan. Holistic optimization by prefetching query results. In Proc. SIGMOD, pages 133--144, 2012. Google ScholarDigital Library
- S. Roy, L. Kot, and C. Koch. Quantum databases. In Proc. CIDR, 2013.Google Scholar
- T. K. Sellis. Multiple-query optimization. ACM Transactions on Database Systems, 13(1):23--52, 1988. Google ScholarDigital Library
- A. J. Smith. Sequentiality and prefetching in database systems. ACM Transactions on Database Systems, 3(3):223--247, 1978. Google ScholarDigital Library
- A. Warth. LazyJ: Seamless lazy evaluation in java. Proc. FOOL/WOOD Workshop, 2007.Google Scholar
- K. C. Yeung and P. H. J. Kelly. Optimising java RMI programs by communication restructuring. In Middleware, volume 2672 of LNCS, pages 324--343, 2003. Google ScholarDigital Library
Index Terms
- Sloth: being lazy is a virtue (when issuing database queries)
Recommendations
Sloth: Being Lazy Is a Virtue (When Issuing Database Queries)
Invited Paper from SIGMOD 2014 and Regular PapersMany web applications store persistent data in databases. During execution, such applications spend a significant amount of time communicating with the database for retrieval and storing of persistent data over the network. These network round-trips ...
Implementation of Speculative Parallelism in Functional Languages
A compile-time analysis technique is developed to derive the probability with which auser-defined function or a supercombinator requires each one of its arguments. Thisprovides a basis for identifying useful speculative parallelism in a program. ...
An implementation technique for database query languages
Structured query languages, such as those available for relational databases, are becoming increasingly desirable for all database management systems. Such languages are applicative: there is no need for an assignment or update statement. A new ...
Comments