skip to main content
10.1145/2588555.2593672acmconferencesArticle/Chapter ViewAbstractPublication PagesmodConference Proceedingsconference-collections
research-article

Sloth: being lazy is a virtue (when issuing database queries)

Published:18 June 2014Publication History

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.

References

  1. Hibernate fetching strategies. http://docs.jboss.org/hibernate/orm/4.3/manual/en-US/html/ch20.html.Google ScholarGoogle Scholar
  2. Hibernate performance issue. http://stackoverflow.com/questions/5155718/hibernate-performance.Google ScholarGoogle Scholar
  3. Tracker issue management system. http://itracker.sourceforge.net.Google ScholarGoogle Scholar
  4. JSR 152: JavaServer Pages 2.0 specification. http://jcp.org/aboutJava/communityprocess/final/jsr152.Google ScholarGoogle Scholar
  5. JSR 220: Enterprise JavaBeans 3.0 specification (persistence). http://jcp.org/aboutJava/communityprocess/final/jsr220.Google ScholarGoogle Scholar
  6. Marissa Mayer at Web 2.0. http://glinden.blogspot.com/2006/11/marissa-mayer-at-web-20.html.Google ScholarGoogle Scholar
  7. Network latency under Hibernate/c3p0/MySQL. http://stackoverflow.com/questions/3623188/ network-latency-under-hibernate-c3p0-mysql.Google ScholarGoogle Scholar
  8. OpenMRS medical record system. http://www.openmrs.org.Google ScholarGoogle Scholar
  9. PhoCusWright/Akamai Study on Travel Site Performance. http://connect.phocuswright.com/2010/06/phocuswrightakamai-study-on-travel-site-performance/.Google ScholarGoogle Scholar
  10. 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 ScholarGoogle Scholar
  11. TPC-C and TPC-W reference implementations. http://sourceforge.net/apps/mediawiki/osdldbt.Google ScholarGoogle Scholar
  12. What is the n+1 selects issue? http://stackoverflow.com/questions/97197/what-is-the-n1-selects-issue.Google ScholarGoogle Scholar
  13. I. T. Bowman and K. Salem. Optimization of query streams using semantic prefetching. In Proc. SIGMOD, pages 179--190, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. M. Chavan, R. Guravannavar, K. Ramachandra, and S. Sudarshan. Program transformations for asynchronous query submission. In Proc. ICDE, pages 375--386, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. A. Cheung, O. Arden, S. Madden, and A. C. Myers. Automatic partitioning of database applications. PVLDB, 5(11):1471--1482, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. 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 ScholarGoogle Scholar
  17. G. Giannikis, G. Alonso, and D. Kossmann. SharedDB: Killing one thousand queries with one stone. PVLDB, 5(6):526--537, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. R. Guravannavar and S. Sudarshan. Rewriting procedures for batched bindings. PVLDB, 1(1):1107--1123, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. P. Henderson and J. H. Morris, Jr. A lazy evaluator. In Proc. POPL, pages 95--103, 1976. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. P. Z. Ingerman. Thunks: a way of compiling procedure statements with some comments on procedure declarations. Comm. ACM, 4(1):55--58, 1961. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  22. G. A. Kildall. A unified approach to global program optimization. In Proc. POPL, pages 194--206, 1973. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. N. Nystrom, M. R. Clarkson, and A. C. Myers. Polyglot: An extensible compiler framework for Java. In Proc. CC, pages 138--152, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. K. Ramachandra and S. Sudarshan. Holistic optimization by prefetching query results. In Proc. SIGMOD, pages 133--144, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. S. Roy, L. Kot, and C. Koch. Quantum databases. In Proc. CIDR, 2013.Google ScholarGoogle Scholar
  26. T. K. Sellis. Multiple-query optimization. ACM Transactions on Database Systems, 13(1):23--52, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. A. J. Smith. Sequentiality and prefetching in database systems. ACM Transactions on Database Systems, 3(3):223--247, 1978. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. A. Warth. LazyJ: Seamless lazy evaluation in java. Proc. FOOL/WOOD Workshop, 2007.Google ScholarGoogle Scholar
  29. 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 ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Sloth: being lazy is a virtue (when issuing database queries)

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in
        • Published in

          cover image ACM Conferences
          SIGMOD '14: Proceedings of the 2014 ACM SIGMOD International Conference on Management of Data
          June 2014
          1645 pages
          ISBN:9781450323765
          DOI:10.1145/2588555

          Copyright © 2014 ACM

          Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 18 June 2014

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • research-article

          Acceptance Rates

          SIGMOD '14 Paper Acceptance Rate107of421submissions,25%Overall Acceptance Rate785of4,003submissions,20%

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader