Welcome!

Java IoT Authors: Elizabeth White, Pat Romanski, Yeshim Deniz, Liz McMillan, Frank Lupo

Related Topics: Java IoT

Java IoT: Article

Future Proof Your Web Application Using Clustered Cache Services

Future Proof Your Web Application Using Clustered Cache Services

Today's web developers have a lot of choices when it comes to web application platforms. Among them, Java EE has always stood out as a "scalable" solution -- it may not be the easiest platform to prototype a web site, but it protects your software investment over longer terms. For instance, Java EE is a cross platform solution supported by many vendors. That means you can choose from many hardware, software, services vendors to accommodate the current and future needs of your applications. Java is also an OO language with well designed application frameworks / libraries, and a large pool of qualified developers. That makes your application cheaper to maintain over the long term. However, when it comes to enterprise features, the single most important differentiators between Java EE and competing solutions (e.g., from Perl, PHP, .NET, to the latest hype such as Ruby On Rails), is that Java EE servers are easy to cluster. You can simply add more hardware to handle more requests, without re-coding the application.

Easy clustering allows you improve your web application performance today, and more importantly, it can future proof your applications for new Internet architectures, and even new business models. For instance, AJAX (Asynchornous JavaScript and XML) technology significantly improves the usability of web applications. But to refactor your existing web applications to use AJAX, you should anticipate several folds of increase in web requests. That is because an AJAX page make multiple HTTP requests to the server to partially update the page, as opposed to one request per page in traditional web applications. Another example is the proliferation of SOA (Service Oriented Architecture) web services. Web applications in a SOA infrastructure are used to deliver component services instead of final UIs. An application typically needs several web service calls across different domains to gather enough information for a web page. As a result, the machine-to-machine interaction in the SOA world generates much more web traffic than the browser-server interaction today. In general, as we move to Web 2.0, web sites become less document-centric and more application-like. Those future needs call for more powerful application servers, and the best way to archive that is through application server clustering.

The core technology behind a clustered Java EE solution is the distributed in-memory cache. The cache is replicated on all server nodes in the cluster. Hence it acts like a cluster-wide shared memory. You can configure the cache to automatically expire old or less used entries, save its content to the disk when the JVM shuts down, and manage read/write transactions when several different server nodes access the same data concurrently. In a database driven web application scenario, the cache manages the distributed application state and optimizes database access.

First, the cache stores all the HTTP web sessions in the application. So, all the server nodes have access to the same user sessions at any time. The HTTP load balancer can direct any user to any server node. In another the word, the HTTP session cache makes the entire cluster transparent to both web users and developers, as if it is one single application server. The transparent cache increases developer productivity since it allows us to deploy applications written for a single application server to a cluster without any changes to the Java code. The cache also has good performance since it stores data in-memory. In contrast, in a Perl/PHP/Ruby based web framework, you typically have to cluster stateless application servers and save the session state information to the database. For every web request, the application has to load the user session from the database. Hence, in those non-Java EE frameworks, a clustered deployment requires significant changes in both code and database structure from the non-clustered prototype. Under the cache-less scenario, the clustered database has to be carefully partitioned by experienced architects to allow fast access to the frequently requested user session data. In a nutshell, the distributed cache is a critical component that makes Java EE web applications easy to cluster.

Besides HTTP sessions, the distributed in-memory cache can store any transient application state information that do not need to be permanently stored in the database. Examples of such transient data include workflow processes and status, real-time server statistics or sensor readings, incomplete transactions, and unprocessed communication data. The application state cache is especially useful in SOA applications where information displayed to the end users actually come from a variety of different sources that have their own persistence mechanisms. For instance, a web application can display the current weather, traffic condition, stock price, or promotional deals. All those information come from external SOA service components and are transient in the web application. They are best managed in the in-memory cache. With a generic distributed cache, multiple Java EE application servers can be deployed in a computing grid and share computing tasks transparently to the user.

For non-transient application data that do need to be stored in the database, the cache improves the overall application performance. The cache groups multiple database update operations into a single batch for a single trip over the network. It also stores frequently read database objects and queries, and provide the application fast in-memory access to those objects. In both cases, the cache reduces the database load, and more importantly, reduces the slow round trips between the database server and the application server. The database cache is especially important in AJAX applications since the it sends in many more incremental updates to the database (i.e., an auto-saving text editor) and asks for much more frequent database reads to incrementally updates the UI (e.g., an auto-complete text field), compared with traditional document centric web applications.

Database cache is widely used in Java applications regardless whether they are clustered or not. But for clustered applications, a distributed database cache is crucial to archive the best performance. The distributed cache's content is updated when any server node updates the database. Common Java persistence frameworks (e.g., Hibernate and EJB 3.0) allow cache to be transparently plugged in underneath their abstract data access API. You do not need to make any change to your data access code in order to take advantage of the cache. You can simply configure the cache service in your Java EE container.

The transparent distributed cache makes it easy to develop and deploy Java applications in clustered environments. In fact, most Java web applications, even prototypes, are already cluster-ready. You simply need to choose a cache implementation, configure it using XML files, and load it together with your application in a Java EE container. Unfortunately, there is no standard cache API or XML configuration files in Java EE yet (JSR-107 is an effort in this direction but it seemed dormant at this moment). The good news, however, is that you have wide variety of choices for distributed and transactional cache implementations, from the open source JBoss Cache to the commercial Tangosol. Most those cache frameworks can be used in almost any Java EE application server container. Check them out and future proof your Java EE applications!

More Stories By Michael Juntao Yuan

Michael Juntao Yuan is a member of JDJ's editorial board. He is the author of three books. His latest book, "Nokia Smartphone Hacks" from O'Reilly, teaches you how to make the most out of your mobile phone. He is also the author of "Enterprise J2ME" - a best-selling book on mobile enterprise application development. Michael has a PhD from the University of Texas at Austin. He currently works for JBoss Inc. You can visit his Web site and blogs at www.MichaelYuan.com/.

Comments (1) View Comments

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


Most Recent Comments
SYS-CON Brasil News Desk 04/10/06 12:21:42 PM EDT

Today's web developers have a lot of choices when it comes to web application platforms. Among them, Java EE has always stood out as a 'scalable' solution -- it may not be the easiest platform to prototype a web site, but it protects your software investment over longer terms. For instance, Java EE is a cross platform solution supported by many vendors. That means you can choose from many hardware, software, services vendors to accommodate the current and future needs of your applications. Java is also an OO language with well designed application frameworks / libraries, and a large pool of qualified developers. That makes your application cheaper to maintain over the long term. However, when it comes to enterprise features, the single most important differentiators between Java EE and competing solutions (e.g., from Perl, PHP, .NET, to the latest hype such as Ruby On Rails), is that Java EE servers are easy to cluster. You can simply add more hardware to handle more requests, without re-coding the application.

@ThingsExpo Stories
SYS-CON Events announced today that Dasher Technologies will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Dasher Technologies, Inc. ® is a premier IT solution provider that delivers expert technical resources along with trusted account executives to architect and deliver complete IT solutions and services to help our clients execute their goals, plans and objectives. Since 1999, we'v...
Enterprises have taken advantage of IoT to achieve important revenue and cost advantages. What is less apparent is how incumbent enterprises operating at scale have, following success with IoT, built analytic, operations management and software development capabilities – ranging from autonomous vehicles to manageable robotics installations. They have embraced these capabilities as if they were Silicon Valley startups. As a result, many firms employ new business models that place enormous impor...
SYS-CON Events announced today that Massive Networks, that helps your business operate seamlessly with fast, reliable, and secure internet and network solutions, has been named "Exhibitor" of SYS-CON's 21st International Cloud Expo ®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. As a premier telecommunications provider, Massive Networks is headquartered out of Louisville, Colorado. With years of experience under their belt, their team of...
SYS-CON Events announced today that Taica will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Taica manufacturers Alpha-GEL brand silicone components and materials, which maintain outstanding performance over a wide temperature range -40C to +200C. For more information, visit http://www.taica.co.jp/english/.
SYS-CON Events announced today that TidalScale, a leading provider of systems and services, will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. TidalScale has been involved in shaping the computing landscape. They've designed, developed and deployed some of the most important and successful systems and services in the history of the computing industry - internet, Ethernet, operating s...
SYS-CON Events announced today that MIRAI Inc. will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. MIRAI Inc. are IT consultants from the public sector whose mission is to solve social issues by technology and innovation and to create a meaningful future for people.
SYS-CON Events announced today that IBM has been named “Diamond Sponsor” of SYS-CON's 21st Cloud Expo, which will take place on October 31 through November 2nd 2017 at the Santa Clara Convention Center in Santa Clara, California.
SYS-CON Events announced today that TidalScale will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. TidalScale is the leading provider of Software-Defined Servers that bring flexibility to modern data centers by right-sizing servers on the fly to fit any data set or workload. TidalScale’s award-winning inverse hypervisor technology combines multiple commodity servers (including their ass...
Join IBM November 1 at 21st Cloud Expo at the Santa Clara Convention Center in Santa Clara, CA, and learn how IBM Watson can bring cognitive services and AI to intelligent, unmanned systems. Cognitive analysis impacts today’s systems with unparalleled ability that were previously available only to manned, back-end operations. Thanks to cloud processing, IBM Watson can bring cognitive services and AI to intelligent, unmanned systems. Imagine a robot vacuum that becomes your personal assistant tha...
Widespread fragmentation is stalling the growth of the IIoT and making it difficult for partners to work together. The number of software platforms, apps, hardware and connectivity standards is creating paralysis among businesses that are afraid of being locked into a solution. EdgeX Foundry is unifying the community around a common IoT edge framework and an ecosystem of interoperable components.
As popularity of the smart home is growing and continues to go mainstream, technological factors play a greater role. The IoT protocol houses the interoperability battery consumption, security, and configuration of a smart home device, and it can be difficult for companies to choose the right kind for their product. For both DIY and professionally installed smart homes, developers need to consider each of these elements for their product to be successful in the market and current smart homes.
Infoblox delivers Actionable Network Intelligence to enterprise, government, and service provider customers around the world. They are the industry leader in DNS, DHCP, and IP address management, the category known as DDI. We empower thousands of organizations to control and secure their networks from the core-enabling them to increase efficiency and visibility, improve customer service, and meet compliance requirements.
With major technology companies and startups seriously embracing Cloud strategies, now is the perfect time to attend 21st Cloud Expo October 31 - November 2, 2017, at the Santa Clara Convention Center, CA, and June 12-14, 2018, at the Javits Center in New York City, NY, and learn what is going on, contribute to the discussions, and ensure that your enterprise is on the right path to Digital Transformation.
Most technology leaders, contemporary and from the hardware era, are reshaping their businesses to do software. They hope to capture value from emerging technologies such as IoT, SDN, and AI. Ultimately, irrespective of the vertical, it is about deriving value from independent software applications participating in an ecosystem as one comprehensive solution. In his session at @ThingsExpo, Kausik Sridhar, founder and CTO of Pulzze Systems, will discuss how given the magnitude of today's applicati...
Smart cities have the potential to change our lives at so many levels for citizens: less pollution, reduced parking obstacles, better health, education and more energy savings. Real-time data streaming and the Internet of Things (IoT) possess the power to turn this vision into a reality. However, most organizations today are building their data infrastructure to focus solely on addressing immediate business needs vs. a platform capable of quickly adapting emerging technologies to address future ...
SYS-CON Events announced today that mruby Forum will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. mruby is the lightweight implementation of the Ruby language. We introduce mruby and the mruby IoT framework that enhances development productivity. For more information, visit http://forum.mruby.org/.
Digital transformation is changing the face of business. The IDC predicts that enterprises will commit to a massive new scale of digital transformation, to stake out leadership positions in the "digital transformation economy." Accordingly, attendees at the upcoming Cloud Expo | @ThingsExpo at the Santa Clara Convention Center in Santa Clara, CA, Oct 31-Nov 2, will find fresh new content in a new track called Enterprise Cloud & Digital Transformation.
SYS-CON Events announced today that NetApp has been named “Bronze Sponsor” of SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. NetApp is the data authority for hybrid cloud. NetApp provides a full range of hybrid cloud data services that simplify management of applications and data across cloud and on-premises environments to accelerate digital transformation. Together with their partners, NetApp emp...
In a recent survey, Sumo Logic surveyed 1,500 customers who employ cloud services such as Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platform (GCP). According to the survey, a quarter of the respondents have already deployed Docker containers and nearly as many (23 percent) are employing the AWS Lambda serverless computing framework. It’s clear: serverless is here to stay. The adoption does come with some needed changes, within both application development and operations. Tha...
SYS-CON Events announced today that Avere Systems, a leading provider of enterprise storage for the hybrid cloud, will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Avere delivers a more modern architectural approach to storage that doesn't require the overprovisioning of storage capacity to achieve performance, overspending on expensive storage media for inactive data or the overbui...