IBM Research © 2006 IBM Corporation Caching Dynamic Web Content: Designing and Analyzing an Aspect- Oriented Solution Sara Bouchenak – INRIA, France Alan.

Slides:



Advertisements
Similar presentations
Chapter 6 Server-side Programming: Java Servlets
Advertisements

Aspect Oriented Programming. AOP Contents 1 Overview 2 Terminology 3 The Problem 4 The Solution 4 Join point models 5 Implementation 6 Terminology Review.
DT228/3 Web Development WWW and Client server model.
Using JavaServer Pages Harry R. Erwin, PhD CIT304/CSE301.
Automating Bespoke Attack Ruei-Jiun Chapter 13. Outline Uses of bespoke automation ◦ Enumerating identifiers ◦ Harvesting data ◦ Web application fuzzing.
Chapter 12: Web Usage Mining - An introduction
J4www/jea Week 3 Version Slide edits: nas1 Format of lecture: Assignment context: CRUD - “update details” JSP models.
28/1/2001 Seminar in Databases in the Internet Environment Introduction to J ava S erver P ages technology by Naomi Chen.
University of British Columbia Software Practices Lab CAS Seminar 06 Fluid AJ - A Simple Fluid AOP Tool Terry Hon Gregor Kiczales.
Fast Track to ColdFusion 9. Getting Started with ColdFusion Understanding Dynamic Web Pages ColdFusion Benchmark Introducing the ColdFusion Language Introducing.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
Web Servers How do our requests for resources on the Internet get handled? Can they be located anywhere? Global?
Building Enterprise Information Portal using Oracle Portal 3
Chapter 4: Database Management. Databases Before the Use of Computers Data kept in books, ledgers, card files, folders, and file cabinets Long response.
Java Server Pages Russell Beale. What are Java Server Pages? Separates content from presentation Good to use when lots of HTML to be presented to user,
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
Feeds Computer Applications to Medicine NSF REU at University of Virginia July 27, 2006 Paul Lee.
UNIT-V The MVC architecture and Struts Framework.
Prof. Vishnuprasad Nagadevara Indian Institute of Management Bangalore
Java Server Pages B.Ramamurthy. Topics for Discussion 8/20/20152 Inheritance and Polymorphism Develop an example for inheritance and polymorphism JSP.
Overview of JSP Technology. The need of JSP With servlets, it is easy to – Read form data – Read HTTP request headers – Set HTTP status codes and response.
FALL 2012 DSCI5240 Graduate Presentation By Xxxxxxx.
About Dynamic Sites (Front End / Back End Implementations) by Janssen & Associates Affordable Website Solutions for Individuals and Small Businesses.
Introduction to Aspect Oriented Programming Presented By: Kotaiah Choudary. Ravipati M.Tech IInd Year. School of Info. Tech.
/11/2003 C-JDBC: a High Performance Database Clustering Middleware Nicolas Modrzyk
1 Accelerated Web Development Course JavaScript and Client side programming Day 2 Rich Roth On The Net
Lecturer: Prof. Piero Fraternali, Teaching Assistant: Alessandro Bozzon, Advanced Web Technologies: Struts–
Scaling Dynamic Content Applications through Data Replication - Opportunities for Compiler Optimizations Cristiana Amza UofT.
 2004 Prentice Hall, Inc. All rights reserved. 1 Segment – 6 Web Server & database.
1 Specification and Implementation of Dynamic Web Site Benchmarks Sameh Elnikety Department of Computer Science Rice University.
Aspect Oriented Programming Gülşah KARADUMAN.
Chapter 6 Server-side Programming: Java Servlets
Usenix Annual Conference, Freenix track – June 2004 – 1 : Flexible Database Clustering Middleware Emmanuel Cecchet – INRIA Julie Marguerite.
Chapter 12: Web Usage Mining - An introduction Chapter written by Bamshad Mobasher Many slides are from a tutorial given by B. Berendt, B. Mobasher, M.
Methodology: The AOP Refactoring Process Aspect-Oriented Refactoring of the Apache Cocoon Shared-Object Resource Allocation System Jeff Dalton Advisor:
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
AOP-1 Aspect Oriented Programming. AOP-2 Aspects of AOP and Related Tools Limitation of OO Separation of Concerns Aspect Oriented programming AspectJ.
TPC BENCHMARK W (Web Commerce) SeungLak Choi Dept. of Computer Science, KAIST.
Domain Driven Web Development With WebJinn Sergei Kojarski College of Computer & Information Science Northeastern University joint work with David H. Lorenz.
® IBM Software Group © 2007 IBM Corporation Best Practices for Session Management
1 Admission Control and Request Scheduling in E-Commerce Web Sites Sameh Elnikety, EPFL Erich Nahum, IBM Watson John Tracey, IBM Watson Willy Zwaenepoel,
Server-side Programming The combination of –HTML –JavaScript –DOM is sometimes referred to as Dynamic HTML (DHTML) Web pages that include scripting are.
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Program.
1 Introduction to Servlets. Topics Web Applications and the Java Server. HTTP protocol. Servlets 2.
JS (Java Servlets). Internet evolution [1] The internet Internet started of as a static content dispersal and delivery mechanism, where files residing.
Search Engine using Web Mining COMS E Web Enhanced Information Mgmt Prof. Gail Kaiser Presented By: Rupal Shah (UNI: rrs2146)
CS562 Advanced Java and Internet Application Introduction to the Computer Warehouse Web Application. Java Server Pages (JSP) Technology. By Team Alpha.
MVC WITH CODEIGNITER Presented By Bhanu Priya.
Session 1 Module 1: Introduction to Data Integrity
Database Connectivity and Server-Side Scripting Chapter 12.
UMass Lowell Computer Science Java and Distributed Computing Prof. Karen Daniels Fall, 2000 Lecture 21 Java Servlets Wed. 11/22/00 based on material.
AOSD'04, Lancaster, UK 1 Remote Pointcut - A Language Construct for Distributed AOP Muga Nishizawa (Tokyo Tech) Shigeru Chiba (Tokyo Tech) Michiaki Tatsubori.
An Architectural Evaluation of Java TPC-W Harold “Trey” Cain, Ravi Rajwar, Morris Marden, Mikko Lipasti University of Wisconsin-Madison
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
Bayu Priyambadha, S.Kom. Static content  Web Server delivers contents of a file (html) 1. Browser sends request to Web Server 3. Web Server sends HTML.
 CONACT UC:  Magnific training   
Maikel Leemans Wil M.P. van der Aalst. Process Mining in Software Systems 2 System under Study (SUS) Functional perspective Focus: User requests Functional.
A Presentation Presentation On JSP On JSP & Online Shopping Cart Online Shopping Cart.
CS 562 Advanced Java and Internet Application Computer Warehouse Web Application By Team Alpha :-  Puja Mehta (102163)  Mona Nagpure (102147)
TPC Benchmark™ W 2002 년 6 월 이상호 교수 숭실대학교 데이터베이스 연구실
Introduction to Information Systems SSD1: Introduction to Information Systems Unit 1. The World Wide Web Unit 2. Introduction to Java and Object- Oriented.
Running a Forms Developer Application
Java Servlets By: Tejashri Udavant..
Chapter 6 Server-side Programming: Java Servlets
PHP / MySQL Introduction
Design and Maintenance of Web Applications in J2EE
MSIS 655 Advanced Business Applications Programming
Admission Control and Request Scheduling in E-Commerce Web Sites
SDMX IT Tools SDMX Registry
Presentation transcript:

IBM Research © 2006 IBM Corporation Caching Dynamic Web Content: Designing and Analyzing an Aspect- Oriented Solution Sara Bouchenak – INRIA, France Alan Cox – Rice University, Houston Steven Dropsho – EPFL, Lausanne Sumit Mittal – IBM Research, India Willy Zwaenepoel – EPFL, Lausanne

© 2006 IBM Corporation Dynamic Web Caching 2 Dynamic Web Content Database server ClientWeb serverApplication server SQL req. SQL res. HTTP response HTTP request Internet Web tierBusiness tierDatabase tier Cache Motivation for Caching  Represents large portion of web requests  Stock quotes, bidding-buying status on auction site, best-sellers on bookstore  Generation places huge burden on application servers

© 2006 IBM Corporation Dynamic Web Caching 3 Caching Dynamic Web Content  Dynamic Content Not easy to Cache –Ensure consistency, invalidate cached entries due to updates Write requests can modify entries used by read requests –Caching logic inserted at different points in the application Entry and exit of requests, access to underlying database Correlation between requests and their database accesses  Most solutions rely on “manually” understanding complex application logic

© 2006 IBM Corporation Dynamic Web Caching 4 Our Contributions  Design a cache “AutoWebCache” that Ensures consistency of cached documents Insertion of caching logic transparent to application –Make use of aspect-oriented programming  Analysis of the cache Transparency of injecting caching logic Improvement in response time for test-bed applications

© 2006 IBM Corporation Dynamic Web Caching 5 Dynamic Web Caching – Solution Approach Database server ClientWeb serverApplication server SQL req. SQL res. HTTP response HTTP request Internet Caching Logic AutoWebCache Request info Database access Transparency  Capture information flow Consistency  Correlation between read and write requests Web Page Cache Cache inserts, invalidations Cache Check

© 2006 IBM Corporation Dynamic Web Caching 6 Outline  Design of AutoWebCache –Maintaining cache consistency Determine relationship between reads and updates –Cache Structure  Aspectizing Web Caching –Insertion of caching logic transparently  Evaluation –Analysis of effectiveness, transparency  Conclusion

© 2006 IBM Corporation Dynamic Web Caching 7 Maintaining Cache Consistency – Read Requests  Response to read-only requests cached  Read SQL queries recorded with cache entry …… WebPage2URI 2 WebPage1URI 1 Cached web page Index: URI (readHandlerName + readHandlerArgs) Associated Read Queries { Read Query 11, Read Query 12, ….} { Read Query 21, Read Query 22, ….}

© 2006 IBM Corporation Dynamic Web Caching 8 Maintaining Cache Consistency – Write Requests  Result not cached  Write SQL queries recorded  Intersect write SQL queries with read queries of cached pages  Invalidate if non-zero intersection WSRS WS RS No Invalidation Invalidation

© 2006 IBM Corporation Dynamic Web Caching 9 Invalidating Cache Entries WebPage3 WebPage2URI 2 WebPage1URI 1 Cached web page Index: URI (readHandlerName + readHandlerArgs) Associated Read Queries { Read Query 11, Read Query 12, ….} { Read Query 21, Read Query 22, ….} URI n Write Query { Read Query 31, Read Query 32, ….} URI 3 Remove

© 2006 IBM Corporation Dynamic Web Caching 10 Query Analysis Engine  Determines intersection between SQL queries  Three levels of granularity for intersection –Column based –Value based –Extra query based  Balance precision with complexity

© 2006 IBM Corporation Dynamic Web Caching 11 abc SELECT T.a FROM T WHERE T.b = 8 UPDATE T SET T.c = 7 WHERE T.b = 10 UPDATE T SET T.a = 12 WHERE T.b = 10 Column Based Intersection Ok Invalidate Invalidate if Column_Read = Column_Updated

© 2006 IBM Corporation Dynamic Web Caching 12 abc SELECT T.a FROM T WHERE T.b = 8UPDATE T SET T.a = 7 WHERE T.b = 10 Value Based Intersection UPDATE T SET T.a = 12 WHERE T.b = 8 Ok Invalidate Invalidate with column-based Invalidate if Rows_Read = Rows_Updated

© 2006 IBM Corporation Dynamic Web Caching 13 abc SELECT T.a FROM T WHERE T.b = 8 UPDATE T SET T.a = 3 WHERE T.c = 9 SELECT T.b FROM T WHERE T.c = 9 Extra Query Based Intersection Invalidate with value-based Ok Generate extra query to find missing values ??

© 2006 IBM Corporation Dynamic Web Caching 14 Outline  Design of AutoWebCache –Maintaining cache consistency Determine relationship between reads and updates –Cache Structure  Aspectizing Web Caching –Insertion of caching logic transparently  Evaluation –Analysis of effectiveness, transparency  Conclusion

© 2006 IBM Corporation Dynamic Web Caching 15 Dynamic Web Caching – Solution Approach Database server ClientWeb serverApplication server SQL req. SQL res. HTTP response HTTP request Internet Caching Logic AutoWebCache Request info Database access Transparency  Capture information flow Web Page Cache Cache inserts, invalidations Cache Check

© 2006 IBM Corporation Dynamic Web Caching 16 Aspect-Oriented Programming (AOP)  Modularize cross-cutting concerns - Aspects – Logging, billing, exception handling  Works on three principles –Capture the execution points of interest – Pointcuts (1) Method calls, exception points, read/write accesses –Determine what to do at these pointcuts – Advice (2) Encode cross-cutting logic (before/ after/ around) –Bind Pointcuts and Advice together – Weaving (3) AspectJ compiler for Java

© 2006 IBM Corporation Dynamic Web Caching 17 Insertion of Caching Logic Original web application Cache- enabled web application version Weaving Rules Caching library Caching library Aspect Weaving (Aspect J)

© 2006 IBM Corporation Dynamic Web Caching 18 Aspectizing Read Requests // Execute SQL queries … SQL query 1 SQL query 2 … // Generate a web document webDoc = … // Return the web document … // Execute SQL queries … SQL query 1 SQL query 2 … // Generate a web document webDoc = … // Return the web document … Original code of a read- only request handler String cachedDoc = Cache.get (uri, inputInfo); if (cachedDoc != null) return cachedDoc; // Cache hit Cache check Capturing request entry Cache.add(webDoc, uri, inputInfo, dependencyInfo); // Cache miss Cache insert Capturing request exit Capture main Collect SQL query info Collecting dependency info Capturing SQL queries

© 2006 IBM Corporation Dynamic Web Caching 19 Aspectizing Write Requests // Execute SQL queries … SQL query 1 SQL query 2 … // Return // Execute SQL queries … SQL query 1 SQL query 2 … // Return Original code of a write request handler Collecting invalidation info Collect SQL query info Capturing SQL queries // Cache consistency Cache.remove(invalidationInfo); Cache invalidation Capturing request exit Capture main

© 2006 IBM Corporation Dynamic Web Caching 20 Capturing Servlet’s main Method // Pointcut for Servlets’ main method pointcut servletMainMethodExecution(...) : execution( void HttpServlet+.doGet( HttpServletRequest, HttpServletResponse)) || execution( void HttpServlet+.doPost( HttpServletRequest, HttpServletResponse));  Pointcut captures entry and exit points of web request handlers  Cache Checks and Inserts for Read Requests  Invalidations for Update Requests

© 2006 IBM Corporation Dynamic Web Caching 21 Weaving Rules for Cache Checks and Inserts // Advice for read-only requests around(...) : servletMainMethodExecution (...) { // Pre-processing: Cache check String cachedDoc; cachedDoc =... call Cache.get of AutoWebCache if (cachedDoc != null){... return cachedDoc } // Normal execution of the request proceed(...); // Post-processing: Cache insert... call Cache.add of AutoWebCache }

© 2006 IBM Corporation Dynamic Web Caching 22 Weaving Rules for Cache Invalidations // Advice for write requests after(...) : servletMainMethodExecution (...) { // Cache invalidation... call Cache.remove of AutoWebCache }

© 2006 IBM Corporation Dynamic Web Caching 23 Weaving Rules for Collecting Consistency Information // Pointcut for SQL query calls pointcut sqlQueryCall( ) : call(ResultSet PreparedStatement.executeQuery()) || call(int PreparedStatement.executeUpdate()); // Advice for SQL query calls after( ) : sqlQueryCall ( ) {... collect consistency info...}  After each SQL query, note  Query template  Query instance values

© 2006 IBM Corporation Dynamic Web Caching 24 Transparency of AutoWebCache  Ability to Capture Information Flow –Entry and exit points of request handlers e.g. doGet(), doPost() APIs for Java Servlets –Modification to underlying data sets e.g. JDBC calls for SQL requests –Multiple sources of dynamic behavior Currently handle dynamic behavior from SQL queries Need standard interfaces for all sources

© 2006 IBM Corporation Dynamic Web Caching 25 Hidden State Problem … … Number number = getRandom ( ); Image img = getImage (number); displayImage (img); request execution  Request does not contain all information for response creation  Occurs when random nos., timers etc. used by application  Subsequent requests result in different responses  Duty of developer to declare such requests non-cacheable

© 2006 IBM Corporation Dynamic Web Caching 26 Use of Application Semantics  Aspect-orientedness relies on code syntax –Cannot capture semantic concepts  In TPC-W application –Best Seller requests allows dirty reads for 30 sec –Conforms to specification clauses and  Application semantics can be used to improve performance –Best seller cache entry time-out set for 30 sec

© 2006 IBM Corporation Dynamic Web Caching 27 Outline  Design of AutoWebCache –Maintaining cache consistency Determine relationship between reads and updates –Cache Structure  Aspectizing Web Caching –Insertion of caching logic transparently  Evaluation –Analysis of effectiveness  Conclusion

© 2006 IBM Corporation Dynamic Web Caching 28 Evaluation Environment  RUBiS –Auction site based on eBay –Browsing items, bidding, leaving comments etc. –Large number of requests that can be satisfied quickly  TPC-W –Models an on-line bookstore –Listing new products, best-sellers, shopping cart etc. –Small number of requests that are database intensive  Client Emulator –Client browser emulator generates requests –Average think time, session time conform to TPCW v1.8 specification –Cache warmed for 15 min, statistics gathered over 30 min

© 2006 IBM Corporation Dynamic Web Caching 29 Response Time for RUBiS – Bidding Mix

© 2006 IBM Corporation Dynamic Web Caching 30 Relative Benefits for different Requests in RUBiS Search Cat Search Rgn View Bids View Item View User Percent of Requests About Me Browse Cat Browse Rgn Buy Now Put Bid Put Cmt Request Type Hits Misses

© 2006 IBM Corporation Dynamic Web Caching 31 Response Time for TPC-W – Shopping Mix

© 2006 IBM Corporation Dynamic Web Caching 32 Relative Benefits for different Requests in TPC-W admin request best sellers execute search home interaction new products order display order inquiry product detail search request Percent of Requests Request Type HitsMisses Hits based on app. semantics

© 2006 IBM Corporation Dynamic Web Caching 33 Implementation of AutoWebCache Web applicationCaching libraryAOP-based caching Application # Java classes Java code size # Java classes Java code size # AspectJ files (weaving rules) Size of AspectJ code TPC-W4612K lines 134.6K lines1150 lines RUBiS255.8K lines

© 2006 IBM Corporation Dynamic Web Caching 34 Conclusion  AutoWebCache - a cache that Ensures consistency of cached documents –Query Analysis Insertion of caching logic transparent to application –Make use of aspect-oriented programming  Transparency of AutoWebCache Well-defined, standard interfaces for information flow Presence of hidden states Use of application semantics

IBM Research © 2006 IBM Corporation Questions / Comments / Suggestions !

IBM Research © 2006 IBM Corporation Thank You!!

© 2006 IBM Corporation Dynamic Web Caching 37 SQL Query Structure SELECT T.a FROM T WHERE T.b=10 UPDATE T SET T.c WHERE 20 < T.d < 35 Column(s) Updated Column(s) Selected Table Concerned Predicate Condition

© 2006 IBM Corporation Dynamic Web Caching 38 Response Time for RUBiS – Bidding Mix Number of Clients Response time (ms) No cache Hand-codedAC extra query AC value basedAC column based

© 2006 IBM Corporation Dynamic Web Caching 39 Response Time for TPCW – Shopping Mix Number of Clients Response time (ms) No cache Hand-codedAC extra query AC value basedAC column based

© 2006 IBM Corporation Dynamic Web Caching 40 Cache Structure in AutoWebCache …… WebPage2URI 2 WebPage1URI 1 Cached web page Index: URI (readHandlerName + readHandlerArgs) ReadQueryTemplate 2 ReadQueryTemplate 3 …… ReadQueryTemplate 1 pairIndex: SQL String Remove If a Write Query invalidates ReadQueryTemplate 1 with instances values1 a

© 2006 IBM Corporation Dynamic Web Caching 41 Evaluation  Analysis of AutoWebCache –Effect on performance of applications –Relation of application semantics to cache efficiency –Relative benefit of caching on different read-only requests –Usefulness of AOP techniques in implementing the caching system

© 2006 IBM Corporation Dynamic Web Caching 42 Breakdown of Response Times for Requests in RUBiS Extra time for a Miss (on top of overall response time) Overall avg. response time About Me Browse Cat Browse Rgn Buy Now Put Bid Put Cmt Search Cat Search Rgn View Bids View Item View User Request Type Response Time (ms)

© 2006 IBM Corporation Dynamic Web Caching 43 Breakdown of Response Times for Requests in TPC-W admin request best sellers execute search home interaction new products order display order inquiry product detail search request Request Type Response Time (ms) Extra time for a Miss (on top of overall response time) Overall avg. response time

© 2006 IBM Corporation Dynamic Web Caching 44 Key Aspect-Oriented Programming Concepts  “Join points” identify executable points in system –Method calls, read and write accesses, invocations  “Pointcuts” allow capturing of various join points  “Advice” specifies actions to be performed at pointcuts –Before or after the execution of a pointcut –Encode the cross-cutting logic

© 2006 IBM Corporation Dynamic Web Caching 45 Conclusion  Dynamic Content Not easy to Cache –Ensure consistency, invalidate cached entries as a result of updates  AutoWebCache – Query Analysis –Caching logic inserted at different points in the application Entry and exit of requests, access to underlying database –Most solutions rely on understanding complex application logic  AutoWebCache – Transparent insertion of caching logic using AOP  Transparency affected by Well-defined, standard interfaces for information flow Presence of hidden states Use of application semantics

© 2006 IBM Corporation Dynamic Web Caching 46 Web Caching versus Query Caching  The two are complimentary  Web caching useful when app server is bottleneck  Documents can be cached nearer to the client, distributed  Can make use of application semantics with web page caching (best seller for TPC-W)