JBoss vs. Tomcat: Choosing A Java Application Server

Jboss vs TomcatPicking between the various Java application servers can be a challenge for developers who are new to developing online Java apps and Java-based sites. The big three are Tomcat, Glassfish, and JBoss. All of them are excellent platforms upon which develop and deploy applications, but they have different strengths. Making the wrong choice can result in more work than necessary, so we’re going to cut through the confusion with a quick guide to which application server will best suit your needs.

In 2013, JBoss received a name change and is now known as WildFly, but the old name is still widely used, especially by those using the older versions, so, we’ll stick to calling it JBoss for the moment.

What is JBoss?

Developed by JBoss – a subsidiary of Red Hat Inc. – the JBoss Application server acts as an open-source alternative to solutions such as IBM WebSphere and SAP NetWeaver. It chiefly relies upon Sun Microsystems’ Enterprise JavaBeans API for functionality. Like most systems developed on EJB, it is designed to allow developers to focus primarily on the business architecture of the server, rather than getting bogged down in unnecessary programming and coding to connect the different working parts.

In addition to providing JBoss and all its associated middleware free of charge, Red hat operates a Developer Program that allows subscribers to gain direct access to exclusive content and product-focused forums. This program, too, is available free of charge, and exists primarily to drive JBoss development and foster a positive developer community. Developers are encouraged to participate on the official boards, contributing code and reporting issues wherever they crop up.

Lightweight and cloud-friendly, JBoss is powerful enough for use in enterprise, and features a middleware portfolio to help accelerate application development, deployment, performance, data integration, and automation. The JBoss website features extensive developer materials, training courses, and informational documents for both new and veteran devs.

What is Tomcat?

Often referred to as “Apache Tomcat,” Tomcat is not technically an application server at all – a fact which generates some confusion amongst first-timers, as ‘application server’ and ‘web server’ are all too often used interchangeably.

Rather, Tomcat is more of a web server and web container. This does not mean it lacks functionality, mind you. An open-source implementation of the Java Servlet, JavaServer Pages, Java Expression Language, and Java WebSocket Technologies, it is intended as a platform for powering large-scale, mission-critical web applications. It is used by major enterprises across several industries and verticals, including development, finance, healthcare, government, ecommerce, retail, and marketing.

As with JBoss, Tomcat’s core developers strongly encourage community participation in the evolution of their platform. They host an extensive development community, with thorough documentation and an active support forum. Apache also maintains a mailing list with updates, tips and tricks, and information on Tomcat.

The Major Differences Between JBoss and Tomcat

Both JBoss and Tomcat are Java servlet application servers, but JBoss is a whole lot more. The substantial difference between the two is that JBoss provides a full Java Enterprise Edition (JEE) stack, including Enterprise JavaBeans and many other technologies that are useful for developers working on enterprise Java applications. Tomcat is much more limited. One way to think of it is that JBoss is a JEE stack that includes a servlet container and web server, whereas Tomcat, for the most part, is a servlet container and web server.

That said, it can also run enterprise applications, a fact which causes no small amount of confusion.

“Many application developers do not focus much on the infrastructure on which their code runs,” writes Manu PK of The Java Zone. “When it comes to web applications, the difference between web servers and application servers [is a common confusion]…Typically, we get confused when [we see that] Tomcat [has] the ability to run enterprise applications.”

When To Choose JBoss

JBoss is the best choice for applications where developers need full access to the functionality that the Java Enterprise Edition provides and are happy with the default implementations of that functionality that ship with it. If you don’t need the full range of JEE features, then choosing JBoss will add a lot of complexity to deployment and resource overhead that will go unused. For example, the JBoss installation files are around an order of magnitude larger than Tomcat’s.

When To Choose Tomcat

Tomcat is a Java servlet container and web server, and, because it doesn’t come with an implementation of the full JEE stack, it is significantly lighter weight out of the box. For developers who don’t need the full JEE stack that has two main advantages.

  • Significantly less complexity and resource use.
  • Modularity.

There are numerous providers of add-ons that work with Tomcat. Developers can choose the specific implementations they want to use to add extra functionality. For example, Tomcat can’t natively host Enterprise JavaBeans. However, if users need Enterprise JavaBeans (EJB) functionality like the persistence and transaction processing that the EJB container model provides, but want to avoid the problems inherent in the main implementation, there are many lightweight alternatives, including the Spring Framework and OpenEJB

Developers of complex Java enterprise applications should choose JBoss (or GlassFish), while those who don’t need the full JEE stack are better off with Tomcat plus any extensions they need.

Matthew Davis is a technical writer and Linux geek for Future Hosting.

Dedicated Server Special

Take advantage of our Double RAM offer on the E3-1230v2 4 x 3.30GHz+HT server! Only $134.95 per month. Managed and Unmanaged options available at checkout.

GET STARTED
  • Mahabali Gowda

    very Useful info I got… Thanks matthew.. Please do update some JEE topic quick look ups..

  • Gianluca

    JBoss web subsystem is the same “Tomcat”. JBoss installation is huge (compared to Tomcat) but with a smart slimming (disabling unused subsystems) it’s as light as Tomcat.
    Even for management, while in JBoss you have an usable Web Dashboard and a powerful CLI, with tomcat you must manually edit an xml file.
    With JBoss you can manage very large installations (with or without JEE) and clusters on a single point with domain mode.
    In my personal opinion Tomcat suites better on embedded and very simple applications with no enterprise requirements.

    • Rohi

      I’m working on a big (global size) e commerce platform, and a year ago moved the main “monolith” from an old weblogic to Tomcat 8. I can safely say that tomcat is suitable for huge and complex applications (our was spring based BTW)

      • Gianluca

        I’m managing (alone) a very large installed base with about 400 VMs with 700 application servers and tens of applications and more than half of them are mission critical working both in business hours and h24 with HA features.

        Very complex applications could be delivered also with a jetty but on an enterprise “complexity” usually means clusters of nodes (many nodes) and a distributed business logic.

        • Rohi

          I’m glad for you, but does it prove your point that Tomcat is not suitable for enterprise apps?

          • Gianluca

            I never said that Tomcat **is not suitable** for the enterprise, I just said that Tomcat **suites better than** in some different use cases (2 years passed and I’m more convinced of this, in the while Jboss web subsystem passed from Tomcat to Undertow).

            Anyhow, if you are searching for full J2EE features, your choice is JBoss because Tomcat is lacking more of them.

            Just read the article.

          • Rohi

            If you look for full JEE compliance that’s for sure, there’s nothing to discuss about it. But today Spring is widely used as an alternative to the full JEE stack to develop enterprise applications, making Tomcat (or any other servlet container) as suitable as JBoss for these apps

          • Kirill Burtsev

            J2EE is quite outdated term, I doubt there are any Java 2 left, especially on enterprise level.
            Also agree, that use of JEE features are not common these days even among large scale enterprise applications.

  • Deep Shah

    which server is the best for multiple files uploading in eclipse ??

    • Deep Shah

      they all are large in size