Business in the internet fast lane means companies must constantly improve customer experience with new features, usability improvements, performance improvements and even bug fixes. New versions of applications must come out fairly frequently to maintain a competitive edge. Application upgrades, while necessary, can be really expensive. On one hand, downtime is opportunity lost to do new business and can damage customer satisfaction if the outages are too often or too long. On the other hand, to avoid downtime properly can require additional hardware, load balancers and time for web operations teams to maintain more systems. 

Parallel deployment, a new feature donated to the Apache Tomcat community at large by <a href=">VMware's SpringSource tc Server engineering</a>, helps system administrators deploy application upgrades gracefully without interrupting user experience. Mark Thomas, Apache Tomcat 7 release manager and VMware SpringSource engineer, posted an article today describing how to leverage the parallel deployment in Tomcat 7:

Parallel deployment is a function of the Context Container. The Context element represents a web application, which in turn specifies the context path to a particular Web Application Archive (WAR) file that is the application logic. Parallel deployment allows you to deploy multiple versions of a web application with the same context path concurrently. When choosing what version of the application for any given request, Tomcat will:

  1. Route new requests to the latest version, so new sessions go to the new application.
  2. If session information is in the request, check the session manager for a matching version, so existing sessions will go to the original application for the request.
  3. If session information is in the request, but the corresponding application is no longer present, it will route to the latest version.

This new capability allows companies to use the same hardware or cloud instances and phase out sessions of the old application naturally, causing no application downtime and a seamless experience for the application users. Additionally, the feature works across clustered Tomcat 7 servers as well. By using the FarmWarDeployer within Tomcat 7, admins can deploy a WAR file across an entire cluster simultaneously and all servers within the cluster will route new sessions as appropriate to the new application version while preserving the experience of the previous application for users with active sessions.