Our team had a violent discussion whether we should put multiple WAR apps into the same JavaEE server (such as Tomcat, JBoss, Websphere).
For same JavaEE server, coz
- Share the same resources (CPU, memory, TCP Port) of the same server
- Able to share session such as enabling Single Sign On easier
- Same JVM, able to access JVM internal resources
- maintainability as managing only one server
For multiple JavaEE servers, coz
- Lower risk. When one server is down if not related to OS or hardware level failure, both WAR apps turn down too.
- Clear deployment. One app is deployed to one server. The whole thing can be packaged together as one (such as single TAR). It is easier and independent to backup and restore again without affecting another.
- Able to dedicate certain resources. If one WAR app is more important than the other, then its JavaEE server should be allocated with more heap size while another is allocated less.
- JavaEE server's overhead is not too large as hardware cost is low. No need to share the same resources.
- If two WAR apps are in the same main domains, still able to share session such as enabling Single Sign On by Cookie.
- Different WAR app should run on separated JVM to prevent from illegal accessing
- maintainability as managing only one server
I know there was a similar post at Deploying multiple web apps in same server but that was not detailed enough.
Are there more arguments to support or oppose the practice? Which practice is industrial standard? Please kindly share your opinions.