October 7, 2020

What Is Tomcat?

Tomcat
Java

Apache Tomcat —or, Tomcat for short — is a popular tool in enterprise infrastructure. And there are many ways in which Tomcat can shine as a Java application container.

In this blog, we give an overview of Apache Tomcat, how it works, why it's used, and discuss some commercial and open source Tomcat alternatives.

What Is Tomcat?

Apache Tomcat is a lightweight, open source Java application server that serves as a reference implementation of the Servlet specification. 

The servlet specification is the official definition of a Java web application. At a high level, this specification let’s everyone know how to layout their application, how the requests are handled and how the responses are generated. Tomcat is an implementation of this specification.  

The first servlet specification was over 25 years ago, and has now reached Servlet 5.0 in Tomcat 10 (although Servlet 4.0 in GA release of Tomcat 9). Tomcat 10 is in alpha (pre-release) at the time of this writing.

Considerations When Using Tomcat

Tomcat is an excellent Java application container, but it is not the solution for every problem. Some applications will require a setup that implements the JavaEE specification, and Tomcat does not.

The enterprise edition (EE) specification has a lot of features, as does Tomcat, but the fact that Tomcat does not implement this specification is not necessarily a bad thing.

By not offering full EE functionality, Tomcat is much lighter, it does not require the same amount of computing resources to run as WildFly or WebLogic. It does not load components that will not be used and therefore does not waste RAM, processing power or time.

Now Available: The Enterprise Guide to Apache Tomcat

Whitepaper Apache Tomcat Best Practices PDF Mockup 1

Our new Enterprise Guide to Apache Tomcat provides detailed best practices for Tomcat deployment, including best practices for performance, security, resilience, and more.

Grab Your Free Copy

How Does Tomcat Work?

Tomcat provides the means and methods for deploying Java web applications. Deploying a web application is simple, just place the war file or the directory containing the web application in the folder called “webapps.” There is also a provided management application that will allow you to “upload” a file to be deployed on the server.

The basics of a Java web application are outside the scope this conversation, but, in simplest terms, a Java web application is an application that is accessible via a browser. To the end user it looks just like a website, but the content is dynamic, not static. Assuming users have knowledge of a web application, Apache Tomcat is one of many options for serving a dynamic web site.

 Apache Tomcat is better than most solutions that are available, as it is very fast, and very lightweight. 

Open Source Tomcat Alternatives

WebLogic, Wildfly, JBoss, Jetty, Undertow, and WebSphere are just a few of the other Servlet implementations that are considered open source Tomcat alternatives. This is because they serve Java content to the end user. WebLogic and WebSphere are two other options, but they feature proprietary software components accompanied by a hefty price tag for licensing and support. For open source Tomcat alternatives, Wildfly, JBoss, Jetty, and Undertow are popular open source solutions available to the public.

Comparing Commercial and Open Source Tomcat Alternatives

The difference between all these containers and Tomcat? Tomcat is not a full EE container. This will cause problems if you are attempting to deploy an application with a lot of EE functionality. There are components available to assist with every bit of functionality that would normally be used in an Enterprise application.  

Some applications will require a setup that implements the JavaEE specification, and Tomcat does not. The EE specification has a lot of features, as does Tomcat, but the fact that Tomcat does not implement this specification is not necessarily a bad thing.

Example Open Source Web Application Stack

Using Apache HTTP Server, Apache Tomcat, and PostgreSQL enables users the ability to construct a 100% free and 100% reliable infrastructure to serve content. There is no reason to pay for these components. Some of the “for-pay” products might have better documentation (although Tomcat’s documentation is amazing) and better graphic user interfaces for management, however, these are not reasons to discount using Tomcat.

Tomcat vs. TomEE

For those who want to use Tomcat for enterprise applications, there is an EE implementation of Tomcat, called Apache TomEE. TomEE is a wrapper that wraps TomEE with full EE stack functionality.

Related Reading - Read a full breakdown of Tomcat vs. TomEE here >>

Final Thoughts

One of the major differences between open source and proprietary “for-pay” software is support. However, OpenLogic has supported a number of open source projects, like Tomcat, professionally for more than a decade. Using “for-pay” software, with outrageous license renewal fees, is not worth the cost.

Get Support for Apache Tomcat From OpenLogic

Want to learn more about how OpenLogic can support your open source web application stack?

Talk With an Expert

Additional Resources