Abstract
Caching is an important technique in scaling storage for high-traffic web applications. Usually, building caching mechanisms involves significant effort from the application developer to maintain and invalidate data in the cache. In this work we present CacheGenie, a caching middleware which makes it easy for web application developers to use caching mechanisms in their applications. CacheGenie provides high-level caching abstractions for common query patterns in web applications based on Object-RelationalMapping (ORM) frameworks. Using these abstractions, the developer does not have to worry about managing the cache (e.g., insertion and deletion) or maintaining consistency (e.g., invalidation or updates) when writing application code.
We design and implement CacheGenie in the popular Django web application framework, with PostgreSQL as the database backend and memcached as the caching layer. To automatically invalidate or update cached data, we use triggers inside the database. CacheGenie requires no modifications to PostgreSQL or memcached. To evaluate our prototype, we port several Pinax web applications to use our caching abstractions. Our results show that it takes little effort for application developers to use CacheGenie, and that CacheGenie improves throughput by 2-2.5× for read-mostly workloads in Pinax.
Chapter PDF
Similar content being viewed by others
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
References
Amiri, K., Park, S., Tewari, R.: DBProxy: A dynamic data cache for Web applications. In: Proc. of the ICDE, Bangalore, India (2003)
Benevenuto, F., Rodrigues, T., Cha, M., Almeida, V.: Characterizing user behavior in online social networks. In: Proc. of the IMC, Chicago, IL (2009)
Bornhövd, C., Altinel, M., Mohan, C., Pirahesh, H., Reinwald, B.: Adaptive database caching with DBCache. IEEE Data Eng. Bull. 27(2), 11–18 (2004)
Bouchenak, S., Cox, A., Dropsho, S., Mittal, S., Zwaenepoel, W.: Caching Dynamic Web Content: Designing and Analysing an Aspect-Oriented Solution. In: van Steen, M., Henning, M. (eds.) Middleware 2006. LNCS, vol. 4290, pp. 1–21. Springer, Heidelberg (2006)
Challenger, J., Iyengar, A., Dantzig, P.: A scalable system for consistently caching dynamic Web data. In: Proc. of the INFOCOM, New York, NY (1999)
Degenaro, L., Iyengar, A., Lipkind, I., Rouvellou, I.: A Middleware System Which Intelligently Caches Query Results. In: Coulson, G., Sventek, J. (eds.) Middleware 2000. LNCS, vol. 1795, pp. 24–44. Springer, Heidelberg (2000)
Django Software Foundation. Django, http://www.djangoproject.com/
Fitzpatrick, B., et al.: Memcached, http://memcached.org
Garrod, C., Manjhi, A., Ailamaki, A., Maggs, B., Mowry, T., Olston, C., Tomasic, A.: Scalable query result caching for Web applications. In: Proc. of the VLDB, Auckland, New Zealand (August 2008)
Gupta, A., Mumick, I.S.: Maintenance of materialized views: Problems, techniques, and applications. IEEE Data Engineering Bulletin 18, 3–18 (1995)
Hansson, D.H., et al.: Ruby on Rails, http://rubyonrails.org/
Hibernate Developers. Hibernate, http://hibernate.org/
Johnson, R.: Facebook outage, http://www.facebook.com/notes/facebook-engineering/more-details-on-todays-outage/431441338919
Jónsson, B.T.: Application-oriented buffering and caching techniques. PhD thesis, University of Maryland, College Park, MD (1999)
Kallen, N.: Cache Money, http://github.com/nkallen/cache-money
Labrinidis, A., Roussopoulos, N.: WebView materialization. In: Proc. of the SIGMOD, Dallas, TX (2000)
Labrinidis, A., Luo, Q., Xu, J., Xue, W.: Caching and materialization for Web databases. Foundations and Trends in Databases 2(3), 169–266 (2010)
Larson, P.-Å., Goldstein, J., Zhou, J.: MTCache: Transparent mid-tier database caching in SQL server. In: Proc. of the ICDE, Boston, MA (2004)
Liu, C., Cao, P.: Maintaining strong cache consistency in the World-Wide Web. In: Proc. of the ICDCS, Baltimore, MD (1997)
Luo, Q., Krishnamurthy, S., Mohan, C., Pirahesh, H., Woo, H., Lindsay, B.G., Naughton, J.F.: Middle-tier database caching for e-Business. In: Proc. of the SIGMOD, Madison, WI (2002)
Nelson, M.N., Welch, B.B., Ousterhout, J.K.: Caching in the Sprite network file system. ACM Trans. Comput. Syst. 6(1), 134–154 (1988)
Perez-Sorrosal, F., Patiño-Martinez, M., Jimenez-Peris, R., Kemme, B.: Consistent and Scalable Cache Replication for Multi-tier J2EE Applications. In: Cerqueira, R., Pasquale, F. (eds.) Middleware 2007. LNCS, vol. 4834, pp. 328–347. Springer, Heidelberg (2007)
Perez-Sorrosal, F., Jimenez-Peris, R., Patiño-Martinez, M., Kemme, B.: Elastic SI-Cache: Consistent and scalable caching in multi-tier architectures. VLDB Journal (2011)
Ports, D.R.K., Clements, A.T., Zhang, I., Madden, S., Liskov, B.: Transactional consistency and automatic management in an application data cache. In: Proc. of the OSDI, Vancouver, BC, Canada (2010)
Sivasubramanian, S., Pierre, G., van Steen, M., Alonso, G.: GlobeCBC: Content-blind result caching for dynamic Web applications. Technical Report IR-CS-022, Vrije Universiteit, Amsterdam, Netherlands (June 2006), http://www.globule.org/publi/GCBRCDWA_ircs022.html
Tauber, J., et al.: Pinax, http://pinaxproject.com/
The TimesTen Team. Mid-tier caching: The TimesTen approach. In: Proc. of the SIGMOD, Madison, WI (2002)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2011 IFIP International Federation for Information Processing
About this paper
Cite this paper
Gupta, P., Zeldovich, N., Madden, S. (2011). A Trigger-Based Middleware Cache for ORMs. In: Kon, F., Kermarrec, AM. (eds) Middleware 2011. Middleware 2011. Lecture Notes in Computer Science, vol 7049. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-25821-3_17
Download citation
DOI: https://doi.org/10.1007/978-3-642-25821-3_17
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-25820-6
Online ISBN: 978-3-642-25821-3
eBook Packages: Computer ScienceComputer Science (R0)