Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

There are many ways to expose a Java web application to the consumer: application container (JBoss etc), servlet container (Tomcat etc), OSGi (Knopflerfish etc), self-executable WAR (Winstone etc) and so on. Are there any clear considerations where one approach should be favoured over another?

As an example, could a collection of self-executable WARs running as raw Unix processes outperform the same applications deployed within Tomcat taking into account administration and scalability concerns?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

I dont have a formalized view of considerations as such but can list some factors in making the decision:

Redeployment - Frequent redeployment causes problems in EARs with memory fragmentation so how often will we need to be releasing updates. Will these need an outage on the servers (if deployed on JBoss/Weblogic)?

Shared Resources - Access to shared resources such as JDBC etc if bundled in the same EAR. Will these cause contention and can I make changes to one without affecting the other? Usually all WARs will get affected by changes made at the EAR level.

Upgrades to servers - Deploying with Tomcat and so on requires a possible upgrade to the base web container to take advantage of new Java/server features when available. Example Tomcat 6 to 7.

Size - Downloadable size of installation package if distributing container along with application. How large should we keep it?

Control over configuration - Internal config within my app plus access to config.xml or server.xml on the underlying containers. Do we want clients to edit these? or do we bundle all these in with preferred settings?

Memory footprint - Full blown servers obviously need more Heap (Xmx) than a Winstone app

What is client already running - Existing servers in their data centre could be re-used if Weblogic or Tomcat infrastructure already in place (for example).

Cluster requirements - will an additional performance requirement require adding servers into a cluster? How good is JBoss clustering versus running on Tomcat and what is the impact on the application code in clustered environment w.r.t. caching etc ?

share|improve this answer
    
+1 for a good list. It might be worth fleshing out the differences between application servers, and servlet containers and when one is favoured over the other a little more. Upgrades to application servers are often slow to come about in enterprises due to the impact on legacy code, having a bunch of Winstone/Jetty executable WARs can mitigate this by allowing some to run on Jetty6 others on Jetty7 depending on their NIO needs for example. –  Gary Rowe Apr 12 '12 at 12:42
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.