Docstoc

At the Edge - Akamai

Document Sample
At the Edge - Akamai Powered By Docstoc
					     PRODUCT SPOTLIGHT

Akamai teams with WebSphere to offer                                                                                global reach, and high performance
                                                                                                                    for application users. Enterprises are
on-demand edge platform                                                                                             not limited to serving static content
                                                                                                                    from edge networks; several edge net-
                                                                                                                    works offer enhanced services. One


At the Edge
                                                                                                                    such capability is Edge Side Includes
                                                                                                                    (ESI), which is specifically designed
                                                                                                                    for dynamic content assembly.
                                                                                                                        In order to extend the enterprise
                                                                                                                    J2EE programming platform to the edge
     BY JAY PARIKH                                                                                                  network, IBM and Akamai have inte-
                                                                                                                    grated and deployed WebSphere
                             As more enterprises move their business to or enable their business on the Internet,   Application Server (WAS) version 5.0
                                                                                                                    onto the edge servers. Enterprises can
                           Web applications have come into widespread use in many enterprise application infra-     execute J2EE Web tier applications in an
                                                                                                                    on-demand WebSphere environment,
                           structures. The infrastructure to deliver these Web applications typically includes a    known as Akamai EdgeComputing
                                                                                                                    powered by WebSphere, and consume
                           wide range of technologies such as load balancers, HTTP Web servers, caching             Internet computing resources on a pay-
                                                                                                                    per-use basis.
                           servers, messaging systems, transaction-processing monitors, application servers, and        This widely distributed application
ABOUT THE AUTHOR                                                                                                    environment, shown in Figure 2, con-
 Jay Parikh is director    databases. A typical enterprise application infrastructure is shown in Figure 1.         sists of an end user typically using a
 of Engineering for                                                                                                 browser; the enterprise (origin) run-
                                   s performance and geographic          into centralized enterprise applica-       ning business logic, legacy systems,

                           A
 Akamai’s globally dis-
 tributed computing                reach requirements expand, it         tion platforms, and generally offer        and databases; and the edge servers
 service, Edge-                    becomes increasingly more diffi-      enterprises improved fault tolerance       running an embeddable WAS server
 Computing. He drives      cult to scale the Web site infrastructure.    and better scalability, through the use    that supports the J2EE Web applica-
 product direction and     IT managers must continually evaluate         of intelligent scheduling and load bal-    tion programming model.
 provides coordination     capacity plans to keep pace with the          ancing of application workloads.
 and continuity in         expected peak demand, and planning            However, for many of today’s Web           Developing Applications
 Engineering and           must consider events such as market-          applications, end users are inherently     for an Edge Platform
 across other organiza-    ing promotions, news events, and other        spread across the Internet.                    The development model remains
 tions at Akamai. In       events that inevitably create more plan-      Congestion and failures in this end-       standard J2EE for edge applications
 addition to               ning uncertainty. Errors in planning can      user environment are common and            and does not require the use of any
 EdgeComputing, Jay        result in overloads that can crash sites      because of this, centralized enterprise    proprietary APIs; it is the deployment
 has supported other       or cause unacceptably slow response           applications can become unreliable         model that changes. If your applica-
 Akamai customer-fac-      times, leading to lost revenue.               and their performance can become           tions generally follow J2EE component
 ing services, including       Pre-provisioning extra capacity as        unpredictable.                             programming best practices, adapting
 Akamai’s flagship         insurance against overload is financially         One solution for enterprises is to     the existing application for the edge
 content delivery ser-     unacceptable for most enterprises. Ideally,   use a distributed application delivery     will be easier. Akamai’s edge applica-
 vice, EdgeSuite; Edge     enterprises want the needed resources         platform at the edge of the Internet to    tion platform extends the WebSphere
 Side Includes (ESI), a    when – and only when – they are needed;       ensure optimal application perfor-         application programming platform to
 markup language for       they do not want to buy extra resources       mance and reliability. Akamai is one       enable the execution of J2EE Web tier
 dynamic assembly          that sit idle when they are not needed.       example of an on-demand edge appli-        application components – JSPs,
 and delivery of Web       “On-demand” computing provides better         cation platform. Deployed at the           servlets, tag libraries, and JavaBeans.
 applications at the       utilization of computing resources and        “edge” of the network – close to user          Development for an edge applica-
 edge; and FirstPoint,     represents a model in which they are          access points – it consists of nearly      tion platform still relies on standard
 Akamai’s global load-     brought into service as needed.               15,000 servers in over 1,100 networks      J2EE development tools and best prac-
 balancing service.                                                      around the world. Enterprises can          tices in developing applications, but
                           On-Demand                                     deploy applications to this distributed    you must architect your edge-enabled
E-MAIL                     Application Platforms                         platform in order to avoid service bot-    application as two cooperating sub-
 jay@akamai.com               Today, on-demand computing                 tlenecks and failures, and at the same     applications: an edge-side application
                           technologies have been integrated             time provide on-demand scalability,        and an enterprise-side application.



32                            www.SYS-CON.com/WebSphere                                                                 J A N U A R Y            2 0 0 4
Presentation Components                     faces. A session bean facade can be                 responses from the enterprise can
on the Edge                                 used to expose the necessary business               be cached on the edge, so content
    The presentation components are         logic as a Web service to the edge                  or data objects can be persisted on
the most common application com-            application. The edge application                   the edge across user requests to
ponents to deploy to the edge. These        makes a Web service call back to the                further reduce the load on the
components access enterprise data           enterprise to invoke the appropriate                enterprise.
via the Java Web services client            logic through a session bean facade,            •   JDBC: Akamai provides a Type 3
model. Typically, the Web application       perhaps made visible through a                      JDBC driver that allows edge appli-
will be developed using a framework         servlet running on the enterprise                   cations to tunnel JDBC queries to
based on the Model-View-Controller          application servers. The edge applica-              the enterprise via HTTP(S). If an
(MVC) architecture.                         tion can use JAX-RPC to call the Web                application has already been
    Jakarta’s Struts framework, an open     service at the enterprise via                       developed using JDBC for data
source framework for building Web           SOAP/HTTP(S). The edge application                  transaction with a database, the
applications based on the MVC pat-          platform enables an edge application                JDBC/HTTP mechanism will make
tern, is well suited for edge deploy-       to cache the results of SOAP/HTTP(S)                it easier to adapt an application for
ment. Struts provides its own               requests to optimize interactions with              the edge. The edge application can
Controller component via a servlet of       the enterprise.                                     still use JDBC and benefit from the
class ActionServlet. This servlet is con-      In addition to Web services as a                 relational data form. Further, JDBC
figured by defining mappings,               communication channel, other stan-                  query responses can be configured
ActionMappings, between the request-        dard communication protocols are                    to be cached on the edge servers.
ed URI and the class name of an Action      supported, including the following:             •   RMI: WebSphere applications run-
class. For the View, Struts can leverage    • HTTP(S): An edge application can                  ning at the edge can use RMI-IIOP
JSPs and provides a very flexible and          make HTTP(S) requests to the cen-                tunneled over HTTP(S) to commu-
powerful set of JSP tag libraries that         tral enterprise, using the                       nicate back to the enterprise. In
allow you to build the View portion of         HttpURLConnection class, for                     this configuration, a servlet runs at
an MVC application without embed-              example, to request content or                   the enterprise, intercepts the RMI
ding Java code directly into the JSP           data objects. Any content frag-                  requests from the edge, and trans-
itself. The Model component is com-            ments can be fetched and used to                 lates the requests into the appro-
monly represented by JavaBeans. These          build the end-user response. Data                priate RMI method calls to the
Model JavaBeans may be self-con-               objects such as XML files can be                 business tier. Since RMI calls are
tained or represent facades for other          fetched and then transformed                     set to be uncacheable in the edge
components such as JDBC or EJBs.               (XSLT) or parsed (JAXP) to create                application environment, it is rec-
    The View and Controller compo-             the end-user response. HTTP                      ommended that you use Web ser-
nents of a Struts application are good
candidates for distribution to the
edge network. These components
execute on the edge servers and can
interact with Model components
(EJBs) running at the enterprise.
Depending on the functionality of
your application, the extent to which
these applications can move onto the
edge application platform will vary.
The edge View and Controller compo-
nents are bundled, along with other
Java classes, into a Web application
archive (WAR) and deployed onto the          FIG. 1: A TYPICAL ENTERPRISE APPLICATION INFRASTRUCTURE
edge server network.
    Normally in an enterprise environ-       DATA ACCESS AND             Read-only access          Read/write access   Read/write access        Write access
ment the Web tier will use RMI               UPDATE FREQUENCY            Low update                Low update          High update              Low/high
(Remote Method Invocation) to com-                                       frequency                 frequency           frequency                frequency
municate with the business tier. For
example, a servlet may use RMI-IIOP          BEST PRACTICE               Local DB on edge          Web service from    If read access can       Tunnel from edge
to call an EJB. However, with J2EE                                       (Cloudscape)              edge to origin –    be cached and            to origin (Akamai
application components running in a                                                                cache at edge       preserve consistency     edge to origin
distributed WAN environment, EJBs                                                                                      needs, use Web service   protocol optimizations)
will remain running at the enterprise                                                                                  from edge to origin
and are made accessible to the edge
                                             TABLE 1: BEST PRACTICES FOR DIFFERENT DATA ACCESS REQUIREMENTS
application via Web services inter-



    J A N U A R Y             2 0 0 4                                                           www.SYS-CON.com/WebSphere                                             33
PRODUCT SPOTLIGHT



                                     vices over RMI to achieve better         •   HttpSession: Akamai supports the         query cache at the edge of the net-
                                     performance.                                 standard HttpSession interface on        work. This will enable dynamic
                                                                                  the edge application platform. The       caching of query results depending
                                  Data Access on the Edge                         platform provides replication for        on the SQL statements issued by the
                                      Any of these HTTP-based protocols           HttpSession objects across the           edge application.
                                  are useful interfaces that allow your           edge server nodes. HttpSession              Table 1 outlines suggested best
                                  applications to bridge from the edge to         objects are most commonly used           practices given the type of data access
                                  the enterprise, but it is still important       to keep per-user state information,      required by an application running on
                                  to avoid excessive communication for            but keeping them small in size is        the edge.
                                  edge-origin requests, as end-user               important for performance rea-
                                  latency and origin utilization will             sons.                                    Edge Application Examples
                                  increase. Since there is an absolute        •   HTTP cookies: An edge application            The following examples describe
                                  cost for every round-trip from the edge         can store some user-specific data        some applications modeled to run on
                                  to the enterprise, calls should be as           in user cookies or URL tokens, but       EdgeComputing and illustrate the use of
                                  effective as possible. Requests should          privacy and security concerns may        WebSphere Web services and Cloudscape
                                  be bundled, if possible, and edge               prevent the use of cookies to store      in distributed edge applications.
                                  caching should be used to store data            data in some situations.                 • Product catalog: A product catalog
                                  and other objects across requests.          •   Object caching: As previously                browsing application can run
                                      The EdgeComputing platform pro-             mentioned, an edge application               almost entirely in the edge envi-
                                  vides caching mechanisms to persist             can make requests for data or con-           ronment. Since most product cata-
                                  application data to minimize the                tent (using HTTP, Web services, or           logs consist of relatively static
                                  interaction and load on the enterprise          JDBC) and these objects can be               product data (not including inven-
                                  infrastructure on a request-by-request          stored in the edge node’s cache.             tory information), the edge appli-
                                  basis.                                                                                       cation can utilize Cloudscape as
                                  • ServletContext: Any data that can             Another powerful edge data capa-             the local DBMS. The data can be
                                      be used across users for a particu-     bility employs IBM’s 100% Pure Java              bundled into the edge WAR along
                                      lar application can be stored in the    Cloudscape DBMS to host infrequently             with the catalog-browsing presen-
                                      application’s ServletContext object.    changing, read-only data in an edge              tation components. Using this
                                                                                     database. In this model, applica-         deployment model, it is feasible
                                                                                     tion data is exported into a JAR          for the end user browsing interac-
                                                                                     file (done by the enterprise appli-       tion to be handled entirely by the
                                                                                     cation developer), and this “data-        edge application. When a user is
                                                                                     base in a JAR” file is bundled into       ready to purchase any selected
                                                                                     the edge WAR file under the stan-         items, the edge application tun-
                                                                                     dard WEB-INF/lib directory. The           nels back to the enterprise for
                                                                                     application’s data source has a           order processing.
                                                                                     fixed configuration correspon-        • Marketing promotional contest: Say
                                                                                     ding to the location of the data-         an enterprise wants to conduct a
                                                                                     base within the JAR file, and the         large-scale marketing promotion to
                                                                                     application and corresponding             give away a certain new product.
                                                                                     configuration are deployed in the         Because of the uncertainty of the
                                                                                     WAR to the edge servers.                  number of end users (contestants),
FIG. 2: A WIDELY DISTRIBUTED APPLICATION ENVIRONMENT
                                                                                      By using Cloudscape on the               an on-demand edge application is
                                                                                     edge, even the Model compo-               extremely beneficial to assuring a
                                                                              nents of an MVC application can be               successful outcome. In this scenario,
                                                                              distributed onto the edge application            the application might have “random
                                                                              platform. Edge applications can make             selection” logic to determine if an
                                                                              use of JavaBeans and JDBC as Model               end user is a winner.
                                                                              components with Cloudscape as the                    An application can be designed
                                                                              DBMS to further reduce communica-                and developed to execute this logic
                                                                              tion to the back-end enterprise sys-             on the edge, offloading the load from
                                                                              tems.                                            the enterprise. In addition, the cor-
                                                                                  One disadvantage of this model is            porate marketing team can imple-
                                                                              that any time the application data               ment various controls on how long
                                                                              changes, the application must be                 the contest runs, how many prod-
                                                                              redeployed to the edge network.                  ucts are given out, the rate at which
                                                                              Future integration development                   they are disbursed, or other controls.
                                                                              between IBM and Akamai will enable               The edge application executes the
                                                                              Cloudscape to function as a database             corresponding business logic entire-
                    FIG. 3: THE GUI EXPORT WIZARD



   34                                www.SYS-CON.com/WebSphere                                                                 J A N U A R Y              2 0 0 4
   ly on the edge and retrieves the con-                     Summary                                                       to attain higher levels of perfor-
   trol parameters from the enterprise                          IBM and Akamai have developed a                            mance, reliability, and global reach
   via Web services calls.                                   new deployment model for J2EE Web                             and ultimately achieve scalability
                                                             applications. The Akamai Edge-                                on demand. Akamai
Application Deployment                                       Computing powered by WebSphere                                EdgeComputing powered by
to the Edge Platform                                         service allows application compo-                             WebSphere helps enterprises
   Once designed, developed, and                             nents to migrate to the edge. By                              respond to a growing need for “on-
tested, the edge subapplication is                           extending the WebSphere program-                              demand” computing and will help
uploaded and provisioned on the                              ming platform to run on the Akamai                            many enterprises adapt their busi-
edge network. Akamai has developed                           edge network, enterprises are able                            ness functions to the edge.
a provisioning mechanism that is
available via two interfaces. The con-
ventional interface involves using a
browser-based GUI on the Akamai
enterprise portal. A second interface
involves uploading and provisioning
via SOAP-based Web services that can
be invoked programmatically.
   IBM and Akamai have developed a
plug-in for WebSphere Studio
Application Developer (WSAD) in the
form of a GUI export wizard, shown in
Figure 3. This plug-in securely invokes
the EdgeComputing provisioning Web
service, and it allows developers to
deploy their applications directly from
the WSAD environment. In addition to
the upload function, the plug-in is
being enhanced to provide validation
and a simulated unit edge test envi-
ronment for the WSAD environment.


 EDGE SIDE INCLUDES
       Edge Side Includes (ESI) is a simple XML-like                  FIG. 4: THE ESI LOGIC

 markup language that can be used to assemble dynamic,
 personalized Web pages at the edge of the Internet. Using ESI can dramatically improve      homepage.jsp
 the delivery of dynamic Web content. ESI content assembly is based on the fact that a       <html>
 dynamic Web page is composed of several smaller individual pieces, or fragments. Each       <body>
 of the individual fragments can have its own cacheability properties. An edge server        <h1>XYZ Homepage</h1>
 processes the ESI logic and will fetch only noncacheable or expired fragments from the      <!-- Assemble the following content on the edge -->
 origin Web site. This model of edge page assembly can significantly reduce the load on      <jsp:include page=“frag.jsp”/>
 the enterprise infrastructure, as well as the amount of data that must be transported to    </body>
 the edge.                                                                                   </html>
       IBM’s WebSphere Dynamic Caching Service component, as part of WebSphere
 Application Server, supports the ESI specification and seamlessly integrates with Akamai’s
 ESI processing capability. A page composed from a collection of servlets/JSPs (e.g., a      fragment.jsp
 portal-style page) can be assembled on the Akamai edge servers from either cached or        <h1><b>Earnings</b></h1>
 uncacheable components. JSP/servlet results can be defined as “edgeable,” using the         <p>
 WebSphere assembly tool or by directly editing the WebSphere Dynamic Caching Service        Today XYZ company reported earnings of $1.20 a
 configuration file, cachespec.xml. The ESI logic is illustrated in Figure 4.                share. Revenue growth in the 4th quarter was
       Upon receiving an end-user request, an Akamai server contacts the enterprise WAS      strong…
 server. It adds an identification HTTP request header in the form of: Surrogate-Capability:
 akam="ESI/1.0". Upon processing this header, WAS returns content containing
 esi:include tags instead of a fully built Web page. The embedded ESI tags are processed          WAS can invoke an Akamai Web services interface to force an invalidation of any
 by the Akamai edge server and the appropriate fragments are fetched (from the enter-        templates or fragments. Additionally, IBM and Akamai are developing a mechanism for
 prise or from cache) to build the response to the end user.                                 WebSphere cache configuration settings defined in the enterprise’s WebSphere Dynamic
       The following code snippets show how a main, or template page, homepage.jsp,          Caching Service cachespec.xml to be automatically set in Akamai’s customer cache con-
 could call and insert the fragment, fragment.jsp.                                           figuration metadata.



    J A N U A R Y                        2 0 0 4                                                                                www.SYS-CON.com/WebSphere                            35

				
DOCUMENT INFO