# Difference between JBoss and Tomcat server

Which server is better between Tomcat and JBoss, but I have not found a good enough answer yet to solve my problem.

I know that Tomcat is only a servlet engine and JBoss offers many more functionalities out of the box, but what I fail to understand is why Tomcat is better to use in some situations than jboss. I read somewhere that JBoss has a pluggable architecture and if required, you can unplug features from JBoss to make it essentially a tomcat servlet container. If that is the case, then isn"t it better to do so instead of using Tomcat, in order to leave scope for plugging things back.

Another explanation I find in flavour of Tomcat is that it is lightweight, does that mean less memory requirement or does that also allows faster response. Again, I need to know that won"t jboss load components as per requirement i.e. if i am using only servlets, then won"t jboss skip the rest of the features and become lightweight automatically.

Essentially, my application does not have any Java EE features, but the "lightweight" arguments in favour of Tomcat does not sound convincing enough because of the above mentioned reasons.

How to decide whether to use Tomcat or a full stack Java EE application server:

When starting your project you should have an idea what it requires. If you're in a large enterprise environment JBoss (or any other Java EE server) might be the right choice as it provides built-in support for e.g:

1. JMS messaging for asynchronous integration
2. Web Services engine (JAX-WS and/or JAX-RS)
3. Management capabilities like JMX and a scripted administration interface
4. Advanced security, e.g. out-of-the-box integration with 3rd party directories
5. EAR file instead of "only" WAR file support
6. all the other "great" Java EE features I can't remember :-)

In my opinion Tomcat is a very good fit if it comes to web centric, user facing applications. If backend integration comes into play, a Java EE application server should be (at least) considered. Last but not least, migrating a WAR developed for Tomcat to JBoss should be a 1 day excercise.

Second, you should also take the usage inside your environment into account. In case your organization already runs say 1,000 JBoss instances, you might always go with that regardless of your concrete requirements (consider aspects like cost for operations or upskilling). Of course, this applies vice versa.

Like others have pointed out JBoss has a (more or less) full Java EE stack while Tomcat is a webcontainer only. JBoss can be configured to only serve as a webcontainer as well, it'd then just be a thin wrapper around the included tomcat webcontainer. That way you could have an almost as lightweight JBoss, which would actually just be a thin "wrapper" around Tomcat. That would be almost as lightweigth.

If you won't need any of the extras JBoss has to offer, go for the one you're most comfortable with. Which is easiest to configure and maintain for you?