|By Catherine Diep, Gennaro Cuomo||
|February 3, 2003 12:00 AM EST||
Server-side caching techniques have long been used to improve Internet performance of Web applications. In general, caching improves response time and reduces system load. Most techniques cache static content, which is data that changes rarely, if at all, such as graphics and text files. While the solutions for caching static content have resulted in excellent performance for some Web applications, they have little or no value in enhancing the performance of Web applications with dynamically generated pages.
For years, IBM Research has developed and refined technologies that enable the caching of dynamic content. These technologies were implemented, deployed, and verified at various high-volume sporting event sites such as the 1998 Winter Olympic Games in Nagano. The success of the sports sites demonstrated the feasibility and significance of caching dynamic content and confirmed the scalability and reliability of the caching technologies. Based on these proven and scalable caching technologies, IBM developed a dynamic content caching solution for Java 2 Enterprise Edition (J2EE) applications running on WebSphere Application Server Version 5.0. In this article we introduce WebSphere dynamic caching services.
WebSphere Application Server (WAS) offers a built-in dynamic caching service for serving dynamic content and caching data. The WebSphere development team often refers to this service simply as dynacache. There is no time-consuming installation and integration work needed to activate dynacache. The cache is enabled/disabled declaratively using simple XML configuration files or using the WAS Administrative User Interface; these methods not only allow caching to be brought up quickly and easily, but also provide great flexibility and control at runtime. Also, you can define your existing caches, such as the caching component of WebSphere Edge Server or IBM HTTP Server, as external caches and use them in conjunction with dynacache.
This article introduces the presentation-level caching features of dynacache. These features are:
Caching Dynamic Content
The key issues for caching dynamic content involve determining what should be cached, where caching should take place, and how to invalidate cached data.
What Should Be Cached?
Content or data that is changing and that at the same time must be stable over a long enough time for meaningful reuse to occur is a candidate for dynamic content caching . If access is frequent, such as with pricing information of a popular stock, then even a short period of stability may be of enough benefit to warrant the caching of dynamic content.
All dynamic Web pages consist of smaller and simpler page fragments. Some fragments are static (such as headers and footers), while others are dynamic (such as fragments containing stock quotes or sports scores). Breaking a page into fragments or components makes effective caching possible for any page, even a highly dynamic page. The goal of creating fragments or components is to maximize fragment reusability and cache utilization.
For example, Figure 1 shows that a page can be broken down into fragments based on reusability and cacheability. Some fragments - headers, footers, and navigation bars, for example - are reusable by all users who visit this site. Other fragments, such as watch lists and news, are not typically cacheable at the presentation level because of the personalized content being displayed. While some presentation fragments may not be reusable across a large set of users, the raw data contained within may very well be cacheable.
Caching can involve a final formatted whole page (such as HTML or XML), a final formatted fragment, or a piece of unformatted raw data. Each, in its own way, contributes to the ultimate benefit of caching dynamic content. Dynacache offers features that enable dynamic content to be cached at various granularities, namely whole pages, fragments, and raw data.
Where Should Caching Take Place?
Theoretically, caching of dynamic content should take place as close to the user as possible. In reality, other factors such as security and user-specific data may influence the choice for the best place to cache dynamic content.
Web application design can play an important role in determining where dynamic data is cached. One example is personalized pages. Although personalized, these pages may contain user-specific, nonuser-specific, locale-sensitive, secure, or nonsecurity-sensitive dynamic data. To maximize the benefit of caching dynamic content, these types of data should be fragmented as finely as possible so they can be cached independently at different locations. For example, the nonuser-specific, nonsecurity-sensitive fragments or components are generally useful to many users, and thus can be cached in a more public space and closer to users. The security-sensitive data should be cached behind the enterprise firewall.
In a multitier e-business environment, dynacache can be activated at the business logic and/or presentation layer. It can also control external caches on servers, such as IBM WebSphere Edge Server and IBM HTTP Server. When external caching is enabled, the cache matches pages with their universal resource identifiers (URIs) and exports matching pages to the external cache. The contents can then be served from the external cache instead of the application server, which saves resources and improves performance. Additionally, dynacache's replication and invalidation support extends the cost-effectiveness of caching dynamic content by enabling cache sharing and cache replication in an environment containing multiple tiers and servers. Finally, WAS's edge of network caching support expands the application caches into the network.
How Are Caches Invalidated?
The biggest challenge when caching dynamic content is to guarantee the freshness, consistency, and accuracy of the content. This requires efficient and comprehensive mechanisms for identifying and updating pages/fragments/data that are no longer valid, a process called invalidation.
Dynacache provides invalidation techniques that are rules-based, time-based, group-based, and programmatic. It can also invalidate the remote caches that were configured as its external caches. Dynacache uses a facility called the Data Replication Service, which is a JMS-based facility, to replicate cached data and propagate invalidate events within a WebSphere cluster.
Dynamic Cache Service Architecture
Figure 2 illustrates the architecture of dynacache. Dynacache operates within WebSphere's JVM to provide generalized Java object caching for use by various consumers. In order to minimize memory consumption, the caching service utilizes a modified LRU (least recently used) eviction policy for cached entries. As a service, dynacache can be configured, tuned, and monitored through WebSphere's systems management interfaces.
In its simplest form, dynacache can be thought of as a highly functional Hashtable. One of its primary purposes is to store (put) and retrieve (get) Java objects from memory. As the various caching entry-points interact with the object store, dynacache manages the entries by controlling growth by running replacement or eviction algorithms. Entries in the cache are managed by a policy based on the class of entry (e.g., servlet/JSP, EJB, command, etc.). The policy is expressed as an XML file called cachespec.xml. The policy defines both global and class-specific characteristics of the cache. For example, cache size, replication policy, and disk offload configurations are globally defined for an instance of dynacache. However, much of the policy data is class specific, describing the rules by which Cache IDs are generated. Cache policies can be written to control servlet/JSP, command bean, and Web services response caching.
Dynacache provides a disk overflow capability, known as Hash Table on Disk (HTOD), that is an optimized file store for serialized Java objects. The HTOD takes the form of a single logical disk file (which can expand to multiple physical 1GB files). Leveraging dynacache and HTOD allows for robust and centralized memory management and provides the potential to leverage networked file systems via NAS (network attached storage) and SANs (storage area networks) for high availability.
To support caching done outside of the J2EE application space, the caching service can cooperate with external caches through its external cache adapter to actively trigger invalidations of cached Web content to registered adapters, which include the WebSphere HTTP Plugin, IBM HTTP Server, and its FRCA (Fast Response Cache Accelerator) cache, and the WebSphere Edge Server now shipped as part of WebSphere Application Server Network Deployment.
Servlet/JSP Result Cache
The servlet/JSP result cache intercepts calls to a servlet's service method, and checks whether the invocation can be served from a cache. If the servlet cannot be served from cache, it is invoked to generate the output that will be cached. The resulting cache entry contains the output; the side effects of the invocation, for example, calls to other servlets or JSP files; and the metadata about the entry, including timeout and entry priority information
Servlet/JSP result cache caching can be based on:
- Request parameters and attributes
- The URI used to invoke the servlet or JSP
- Session information
- Other options, including cookies
Alternatively, the cache entries generated by the servlet/JSP result cache can be pushed to external caches, such as the cache component of WebSphere Edge Server or IBM HTTP Server. For J2EE applications that have high read/write ratios, the servlet/JSP result cache creates an opportunity for significant gains in server response time, throughput, and scalability. Moreover, since the servlet/JSP result cache is nonintrusive and is enabled declaratively, currently deployed and running servlets/JSPs can be configured to take advantage of dynamic content caching without changing any code.
The Command Cache
The command cache is used to cache dynamic data that requires back-end data retrieval, such as back-end database JDBC calls. The command cache forms a good synergy with the servlet/JSP result cache because in some cases even caching the most granular, final-formatted fragment is not sufficient. For example, a personalized page may contain a stock watch-list fragment (see Figure 4). This fragment consists of two sets of information: the watch list, which is highly personalized, and the corresponding stock symbol pricing information, which is generalized information and usable by many users.
Suppose the stock list is the customer's stock portfolio, which is highly sensitive and is stored at the back-end server. In this case it is not effective to cache the final formatted fragment. Since the stock quotes are highly volatile, this fragment will be regenerated repeatedly. The net result is that every time this fragment is reconstructed, it is necessary to retrieve the stock list from the source. A better approach is to use the command cache to cache the stock list and avoid fetching the list continually from the back-end database.
To use the command cache, user applications need to write to the WebSphere Command Framework API. The WebSphere Command Framework is based on the Command Design Pattern widely used in Java programming paradigms. Typically, these applications use "setters" to set the command's input states, one or more "execute" methods, and "getters" to retrieve the results. The results can be either formatted or raw data.
The command cache intercepts the "execute" method call of a command written for the command cache and checks whether the command object can be served from the cache. If the command object does not exist in the cache, the logic in the execute method is performed and the resulting object is cached.
The caching behavior of the command cache is defined declaratively with the XML cache policy file, which describes whether and how a command should be cached. The command cache can be used at the presentation and/or business logic layer in multitier environments.
The command cache is easy to use. For existing applications that follow a Model-View-Control (MVC) design pattern, the command cache can be implemented with minimal impact to existing code.
Replication support further extends the value of caching in an e-business application. With this support, caches can be shared (central cache) or replicated (local cache) among servers. Replication can be enabled and configured declaratively with XML cache policy files. Cache policy also defines the cache entries or groups that should be shared or replicated.
Replication support uses a built-in high-performance standards-based JMS messaging system as its underlying engine for data replication.
Figure 5 shows an example of three servers configured to have their local caches replicated with each other. The messaging broker can be the built-in JMS broker belonging to one of the three servers. In this case, the broker is the built-in JMS broker at server one. A request for data (1) hits server one (or any of the three servers). If the requested data is not in the cache, the data is fetched from the back-end server (2). Resulting data from the back-end server (3) is cached at server one and then returned to the requester (4). When the cache of server one detects the cache update request, it publishes a message (a) regarding the change to the messaging broker. Whatever change occurred at server one is automatically replicated to server two (b) and server three (c).
The difference between caching static and dynamic content is the requirement for proactive and effective invalidation mechanisms, such as event-based invalidation, to ensure the freshness of content. Time-based invalidation alone is no longer adequate for dynamic cache invalidation.
Dynacache provides rules-based, time-based, and group-based invalidation techniques. The WebSphere Application Server Enterprise Edition, version 5, offers access to programmatic cache and invalidation techniques. Invalidation policies can be defined with XML cache policy files. Invalidation policies allow triggering events to invalidate cache entries without the need to write explicit code. More complex invalidation scenarios may require code that invokes the invalidation API.
The responsibility for synchronizing the dynamic cache of external caches with the application server is shared by both systems. For example, a public Web page dynamically created and cached at the application server using the servlet/JSP result cache can be exported by the application server and cached by the edge server's Caching Proxy. The Caching Proxy can then serve the application's execution results repeatedly to many different users until notified that the page is invalid. Content in the Caching Proxy's servlet response cache is valid until the proxy server removes an entry because the cache is congested, the default timeout set by the Caching Proxy's configuration file expires, or the Caching Proxy receives an invalidate message directing it to purge the content from its cache. Invalidate messages originate at the application server that owns the content and are propagated to each configured Caching Proxy.
Edge of Network Caching Support
Dynacache can use IBM HTTP Server's high-speed cache, referred to as the Fast Response Cache Accelerator, as its external cache, to cache whole pages and fragments.
The Edge Components of WebSphere Application Server Network Deployment v5.0 can also be configured as the application server's external cache for whole-page caching. In such cases, dynacache can be enabled to match pages with their universal resource identifiers (URIs) and export matching pages to the external cache. The contents can then be served from the external cache instead of the application server to significantly save resources and improve performance.
Figure 6 shows an example of exporting a dynamically cached page from the application server to the cache component of the edge server. More information about caching dynamic content at the edge of the network can be found in the white paper, "WebSphere Edge Services Architecture Guide to Edge Applications" (www-3.ibm.com/software/webservers/ edgeserver/doc/Guide_to_Edge_Apps_2.pdf).
With dynacache's external cache control, distributed-fragment caching, and assembly support, dynamic content can be exported, cached, and assembled at the most optimal location, closer to the end user. More important, the WebSphere Application Server can maintain control of the external cache through its invalidation support to ensure the freshness of cached content. As a result, WebSphere Application Server is equipped to create and serve highly dynamic Web pages without jeopardizing page performance and user experiences.
In Table 1, you can see which caching technique and cache distribution technique are most useful for each type of Web content.
WebSphere Application Server provides a variety of graphical user interface tools to help configure and monitor the dynamic content cache.
Application Assembly Tool
The Application Assembly Tool (AAT) is used to package application code components into the needed modules, which comply with the J2EE specification for deployment onto the application server. AAT can also be used to configure the cache policy associated with the application for caching.
Cache Monitor Servlet
The Cache Monitor Servlet is provided as an installable Enterprise Archive file that can be installed and used for monitoring cache statistics.
As more e-business sites seek to retain customers by serving personalized content, they face potential server-side bottlenecks, slow response time, and increasing infrastructure costs. The dynacache service employed by WebSphere can solve these critical challenges. Caching dynamic content that requires back-end requests or CPU-intensive computations can reduce server-side bottlenecks and maximize system resources, thus boosting performance and reducing infrastructure cost.
Dynacache users can benefit from using the available comprehensive functions to cache their dynamic content. The servlet/JSP result cache and the command cache make possible the caching of dynamic content at various levels of granularity for the highest possible number of cache hits. The replication and invalidation support facilitates caches to be shared, replicated, and synchronized in multitier or multiserver environments. The edge of network caching support, with its external caches and fragment support, generates a virtual extension of application server caches into the network.
Using dynacache can improve throughput and performance. As expected, improvements vary depending on how dynamic the data is, how well the pages are designed (fragmented) for maximum cache hits, and how costly it is to fetch and construct the content. Nevertheless, considerable benefits can be realized. Furthermore, the success of the IBM sports sites confirms the scalability and reliability of these underlying technologies in a truly high-volume environment.
|wesnur 11/25/09 05:10:00 AM EST|
Hi Catherine , Gennaro
I have read your article thoroughly; it is in deed very informative one. There is no second thought that Dynamic Caching is the ultimate solution of the issues like Scalability, Reliability and Performance. But you haven’t talked about the topologies which can be used for dynamic caching. I wanted to request if you could please read this article and give you opinion about the topologies as well Benefits of using NCache Dynamic Clustering Capabilities.
Wearable technology was dominant at this year’s International Consumer Electronics Show (CES) , and MWC was no exception to this trend. New versions of favorites, such as the Samsung Gear (three new products were released: the Gear 2, the Gear 2 Neo and the Gear Fit), shared the limelight with new wearables like Pebble Time Steel (the new premium version of the company’s previously released smartwatch) and the LG Watch Urbane. The most dramatic difference at MWC was an emphasis on presenting wearables as fashion accessories and moving away from the original clunky technology associated with t...
Apr. 1, 2015 12:00 PM EDT Reads: 1,629
The 17th International Cloud Expo has announced that its Call for Papers is open. 17th International Cloud Expo, to be held November 3-5, 2015, at the Santa Clara Convention Center in Santa Clara, CA, brings together Cloud Computing, APM, APIs, Microservices, Security, Big Data, Internet of Things, DevOps and WebRTC to one location. With cloud computing driving a higher percentage of enterprise IT budgets every year, it becomes increasingly important to plant your flag in this fast-expanding business opportunity. Submit your speaking proposal today!
Apr. 1, 2015 12:00 PM EDT Reads: 352
The world's leading Cloud event, Cloud Expo has launched Microservices Journal on the SYS-CON.com portal, featuring over 19,000 original articles, news stories, features, and blog entries. DevOps Journal is focused on this critical enterprise IT topic in the world of cloud computing. Microservices Journal offers top articles, news stories, and blog posts from the world's well-known experts and guarantees better exposure for its authors than any other publication. Follow new article posts on Twitter at @MicroservicesE
Apr. 1, 2015 12:00 PM EDT Reads: 1,594
After making a doctor’s appointment via your mobile device, you receive a calendar invite. The day of your appointment, you get a reminder with the doctor’s location and contact information. As you enter the doctor’s exam room, the medical team is equipped with the latest tablet containing your medical history – he or she makes real time updates to your medical file. At the end of your visit, you receive an electronic prescription to your preferred pharmacy and can schedule your next appointment.
Apr. 1, 2015 12:00 PM EDT Reads: 1,047
As Marc Andreessen says software is eating the world. Everything is rapidly moving toward being software-defined – from our phones and cars through our washing machines to the datacenter. However, there are larger challenges when implementing software defined on a larger scale - when building software defined infrastructure. In his session at 16th Cloud Expo, Boyan Ivanov, CEO of StorPool, will provide some practical insights on what, how and why when implementing "software-defined" in the datacenter.
Apr. 1, 2015 11:46 AM EDT Reads: 385
While not quite mainstream yet, WebRTC is starting to gain ground with Carriers, Enterprises and Independent Software Vendors (ISV’s) alike. WebRTC makes it easy for developers to add audio and video communications into their applications by using Web browsers as their platform. But like any market, every customer engagement has unique requirements, as well as constraints. And of course, one size does not fit all. In her session at WebRTC Summit, Dr. Natasha Tamaskar, Vice President, Head of Cloud and Mobile Strategy at GENBAND, will explore what is needed to take a real time communications ...
Apr. 1, 2015 11:00 AM EDT Reads: 642
SYS-CON Events announced today the IoT Bootcamp – Jumpstart Your IoT Strategy, being held June 9–10, 2015, in conjunction with 16th Cloud Expo and Internet of @ThingsExpo at the Javits Center in New York City. This is your chance to jumpstart your IoT strategy. Combined with real-world scenarios and use cases, the IoT Bootcamp is not just based on presentations but includes hands-on demos and walkthroughs. We will introduce you to a variety of Do-It-Yourself IoT platforms including Arduino, Raspberry Pi, BeagleBone, Spark and Intel Edison. You will also get an overview of cloud technologies s...
Apr. 1, 2015 11:00 AM EDT Reads: 2,272
Internet of Things (IoT) will be a hybrid ecosystem of diverse devices and sensors collaborating with operational and enterprise systems to create the next big application. In their session at @ThingsExpo, Bramh Gupta, founder and CEO of robomq.io, and Fred Yatzeck, principal architect leading product development at robomq.io, will discuss how choosing the right middleware and integration strategy from the get-go will enable IoT solution developers to adapt and grow with the industry, while at the same time reduce Time to Market (TTM) by using plug and play capabilities offered by a robust I...
Apr. 1, 2015 10:00 AM EDT Reads: 734
Containers and microservices have become topics of intense interest throughout the cloud developer and enterprise IT communities. Accordingly, attendees at the upcoming 16th Cloud Expo at the Javits Center in New York June 9-11 will find fresh new content in a new track called PaaS | Containers & Microservices Containers are not being considered for the first time by the cloud community, but a current era of re-consideration has pushed them to the top of the cloud agenda. With the launch of Docker's initial release in March of 2013, interest was revved up several notches. Then late last...
Apr. 1, 2015 09:15 AM EDT Reads: 2,320
The WebRTC Summit 2015 New York, to be held June 9-11, 2015, at the Javits Center in New York, NY, announces that its Call for Papers is open. Topics include all aspects of improving IT delivery by eliminating waste through automated business models leveraging cloud technologies. WebRTC Summit is co-located with 16th International Cloud Expo, @ThingsExpo, Big Data Expo, and DevOps Summit.
Apr. 1, 2015 09:00 AM EDT Reads: 1,751
SYS-CON Events announced today that Litmus Automation will exhibit at SYS-CON's 16th International Cloud Expo®, which will take place on June 9-11, 2015, at the Javits Center in New York City, NY. Litmus Automation’s vision is to provide a solution for companies that are in a rush to embrace the disruptive Internet of Things technology and leverage it for real business challenges. Litmus Automation simplifies the complexity of connected devices applications with Loop, a secure and scalable cloud platform.
Apr. 1, 2015 09:00 AM EDT Reads: 745
SOA Software has changed its name to Akana. With roots in Web Services and SOA Governance, Akana has established itself as a leader in API Management and is expanding into cloud integration as an alternative to the traditional heavyweight enterprise service bus (ESB). The company recently announced that it achieved more than 90% year-over-year growth. As Akana, the company now addresses the evolution and diversification of SOA, unifying security, management, and DevOps across SOA, APIs, microservices, and more.
Apr. 1, 2015 08:30 AM EDT Reads: 2,127
SYS-CON Events announced today that robomq.io will exhibit at SYS-CON's @ThingsExpo, which will take place on June 9-11, 2015, at the Javits Center in New York City, NY. robomq.io is an interoperable and composable platform that connects any device to any application. It helps systems integrators and the solution providers build new and innovative products and service for industries requiring monitoring or intelligence from devices and sensors.
Mar. 31, 2015 06:00 PM EDT Reads: 1,607
SYS-CON Events announced today that Solgenia will exhibit at SYS-CON's 16th International Cloud Expo®, which will take place on June 9-11, 2015, at the Javits Center in New York City, NY, and the 17th International Cloud Expo®, which will take place on November 3–5, 2015, at the Santa Clara Convention Center in Santa Clara, CA. Solgenia is the global market leader in Cloud Collaboration and Cloud Infrastructure software solutions. Designed to “Bridge the Gap” between Personal and Professional Social, Mobile and Cloud user experiences, our solutions help large and medium-sized organizations dr...
Mar. 31, 2015 03:00 PM EDT Reads: 3,086
The list of ‘new paradigm’ technologies that now surrounds us appears to be at an all time high. From cloud computing and Big Data analytics to Bring Your Own Device (BYOD) and the Internet of Things (IoT), today we have to deal with what the industry likes to call ‘paradigm shifts’ at every level of IT. This is disruption; of course, we understand that – change is almost always disruptive.
Mar. 30, 2015 04:00 PM EDT Reads: 1,204
SYS-CON Events announced today that SafeLogic has been named “Bag Sponsor” of SYS-CON's 16th International Cloud Expo® New York, which will take place June 9-11, 2015, at the Javits Center in New York City, NY. SafeLogic provides security products for applications in mobile and server/appliance environments. SafeLogic’s flagship product CryptoComply is a FIPS 140-2 validated cryptographic engine designed to secure data on servers, workstations, appliances, mobile devices, and in the Cloud.
Mar. 30, 2015 11:00 AM EDT Reads: 1,563
GENBAND has announced that SageNet is leveraging the Nuvia platform to deliver Unified Communications as a Service (UCaaS) to its large base of retail and enterprise customers. Nuvia’s cloud-based solution provides SageNet’s customers with a full suite of business communications and collaboration tools. Two large national SageNet retail customers have recently signed up to deploy the Nuvia platform and the company will continue to sell the service to new and existing customers. Nuvia’s capabilities include HD voice, video, multimedia messaging, mobility, conferencing, Web collaboration, deskt...
Mar. 30, 2015 01:00 AM EDT Reads: 1,540
SYS-CON Media announced today that @WebRTCSummit Blog, the largest WebRTC resource in the world, has been launched. @WebRTCSummit Blog offers top articles, news stories, and blog posts from the world's well-known experts and guarantees better exposure for its authors than any other publication. @WebRTCSummit Blog can be bookmarked ▸ Here @WebRTCSummit conference site can be bookmarked ▸ Here
Mar. 29, 2015 10:00 PM EDT Reads: 1,890
SYS-CON Events announced today that Cisco, the worldwide leader in IT that transforms how people connect, communicate and collaborate, has been named “Gold Sponsor” of SYS-CON's 16th International Cloud Expo®, which will take place on June 9-11, 2015, at the Javits Center in New York City, NY. Cisco makes amazing things happen by connecting the unconnected. Cisco has shaped the future of the Internet by becoming the worldwide leader in transforming how people connect, communicate and collaborate. Cisco and our partners are building the platform for the Internet of Everything by connecting the...
Mar. 29, 2015 07:00 PM EDT Reads: 5,301
Temasys has announced senior management additions to its team. Joining are David Holloway as Vice President of Commercial and Nadine Yap as Vice President of Product. Over the past 12 months Temasys has doubled in size as it adds new customers and expands the development of its Skylink platform. Skylink leads the charge to move WebRTC, traditionally seen as a desktop, browser based technology, to become a ubiquitous web communications technology on web and mobile, as well as Internet of Things compatible devices.
Mar. 29, 2015 06:00 PM EDT Reads: 1,903