Tomcat vs. TomEE: Comparing Specifications and Use Cases
According to a recent survey by JRebel, Apache Tomcat accounts for 48% of application server usage for Java teams. However, teams that need a more substantial application server often turn to TomEE. So how can teams choose between Tomcat vs. TomEE?
In this blog, we compare Tomcat and TomEE, including differences in specifications, use cases, and key considerations for enterprise deployment.
- Comparing Tomcat and TomEE
- Specifications in Apache Tomcat vs. TomEE
- Apache Tomcat vs. TomEE Use Cases
- Final Thoughts
Comparing Tomcat and TomEE
For organizations considering their open source application / web server options, Tomcat and TomEE are often at the top of the list. But there are some key differences between Tomcat and TomEE that teams should note before deciding.
At the surface level, Tomcat and TomEE are very similar. The primary difference between Tomcat and TomEE is that Tomcat supports servlets and JSPs, whereas TomEE boasts a more extensive set of technologies based on JSRs, such as EJBs and CDI.
What Is Tomcat?
Introduced in 1999, Apache Tomcat is a very popular open-source web server that is a reference implementation for servlet and Java Server Pages (JSPs).
Due to its lightweight nature, Tomcat has a very fast startup and deployment time. The current version of Apache Tomcat is 10.0.x which implements Servlet 5.0 and JSP 3.0 specifications. The Apache Tomcat license is managed by the Eclipse Foundation under the Apache 2.0 and Eclipse Public License 1.0 licenses.
What Is TomEE?
Started in 2011 by contributors of the OpenEJB project, Apache TomEE is the enterprise edition of Apache Tomcat.
Apache TomEE leverages all the features of Apache Tomcat (JNDI, security, etc.) including Enterprise Java Beans (EJBs), Contexts and Dependency Injection (CDI), Java Persistence API (JPA), Java Transaction API (JTA), Java Server Faces (JSF), Java Message Service (JMS), Web Services, and a Relational Database Management System (RDBMS) implementation with (Java Database Connectivity) JDBC. The TomEE license is also managed under the Apache 2.0 license.
TomEE WebProfile, MicroProfile, Plus, and Plume
TomEE comes in four different distributions, TomEE WebProfile, TomEE MicroProfile, TomEE Plus, and TomEE Plume.
- TomEE WebProfile - Provides servlets, JSPs, JSF, JTA, JPA, CDI, and lite version of EJBs.
- TomEE MicroProfile - In addition to the WebProfile specifications, adds support for microservices.
- TomEE Plus - In addition to the MicroProfile specifications, adds support for JMS, JAX-WS, and more. Uses MyFaces, OpenJPA.
- TomEE Plume - Same specifications as TomEE Plus, but uses Mojarra in place of MyFaces, and adds EclipseLink JPA on top of OpenJPA.
Specifications in Apache Tomcat vs. TomEE
Every TomEE release will have a corresponding Tomcat version it is based which will include a Java SE version requirement, MicroProfile version, and Jakarte EE (formerly Java EE) version. For example, the latest version of TomEE, 9.x, is based on Tomcat 10.0.x and uses Java 11 and MicroProfile and Jakarta EE version 5.0 and 9.1 respectively.
Apache Tomcat will always have the following list of specifications, with these specifications also included in TomEE WebProfile, MicroProfile, Plus, and Plume:
|Jakarta Annotations||Jakarta Authentication||Jakarta Debugging Support for Other Languages|
|Jakarta Security||Jakarta Server Pages||Jakarta Servlet|
|Jakarta Standard Tag Library||Jakarta Expression Language||Jakarta WebSocket|
Apache TomEE specifications will include Apache Tomcat specifications in addition to specifications specific to TomEE WebProfile, MicroProfile, Plus, and Plume.
The specifications listed below represent what are included in the most robust versions, Plus and Plume. For a more detailed breakdown of which features are included in which versions, visit: https://tomee.apache.org/comparison.html
|Jakarta Annotations||Jakarta Interceptors||MicroProfile OpenAPI|
|Jakarta Authentication (JASPIC)||Jakarta JSON Binding (JSON-B)||MicroProfile OpenTracing|
|Jakarta Debugging Support for Other Languages||Jakarta JSON Processing (JSON-P)||MicroProfile Rest Client|
|Jakarta Security (Java EE Enterprise Security)||Jakarta Mail (JavaMail)||Jakarta EE specifications|
|Jakarta Servlet||Jakarta Managed Beans||Jakarta Authorization (JACC)|
|Jakarta Server Pages (JSP)||Jakarta Persistence (JPA)||Jakarta Batch (JBatch)|
|Jakarta Standard Tag Library (JSTL)||Jakarta RESTful Web Services (JAX-RS)||Jakarta Concurrency|
|Jakarta Expression Language (EL)||Jakarta Transactions (JTA)||Jakarta Connectors|
|Jakarta WebSocket||Jakarta XML Binding (JAXB)||Jakarta Enterprise Web Services|
|Jakarta Web Profile specifications||MicroProfile specifications||Jakarta Messaging (JMS)|
|Jakarta Activation||MicroProfile Config||Jakarta SOAP with Attachments|
|Jakarta Bean Validation||MicroProfile Fault Tolerance||Jakarta Web Services Metadata|
|Jakarta Contexts and Dependency Injection (CDI)||MicroProfile Health||Jakarta XML Web Services (JAX-WS)|
|Jakarta Dependency Injection (@Inject)||MicroProfile JWT Authentication||Jakarta Faces (JSF) implementation|
|Jakarta Enterprise Beans (EJB)||MicroProfile Metrics||Jakarta Persistence (JPA) implementation(s)|
|Jakarta Faces (JSF)|
Apache Tomcat vs. TomEE Use Cases
Apache Tomcat and TomEE can be used to meet a multitude of various application requirements. The following sections illustrate where each product would be a good fit.
When to Use Tomcat
Apache Tomcat has a very broad use in the enterprise, and it can be used for simple requirements such as a shopping cart with a RDBMS or anything that is user facing. Tomcat is perfect for basic model view controller applications using a web presentation framework. You can still add features available in TomEE to Tomcat such as JSF or CDI, but you would need to import those into your application. Tomcat is very developer friendly where changes can be redeployed without restarting the server rapidly and repeatedly, and it integrates well with Eclipse.
When to Use TomEE
Instead of importing frameworks into your application server, TomEE includes many of the bells and whistles which allows the developer to focus on writing code instead of importing numerous tools into the environment. TomEE can be used to connect to legacy systems such as a mainframe as well as middleware running ActiveMQ or IBM MQ via JMS.
TomEE also has built in functionality to persist data between Java objects and relational databases using JPA. JTA is also included in TomEE which enables an application to perform distributed transactions. MyFaces, a JSF implementation, is included with TomEE Plus. Web Services and REST can be implemented with ease as the TomEE container already includes the dependencies in the distribution. This is a subset of functionality include with TomEE.
Like any software choice, choosing between Tomcat and TomEE comes down to the needs of your application. For applications that require more robust and enterprise functionalities, TomEE will probably be the better choice. For applications that have simpler requirements, Tomcat will likely be the better choice.
Need Support for Your Tomcat or TomEE Deployments?
For teams using Tomcat or TomEE in mission-critical applications, OpenLogic can provide the support and services you need to keep your deployments secure and performant.
- Blog - Tomcat Configuration Tips and Tricks
- Blog - 5 Apache Tomcat Performance Best Practices
- Blog - What Is Apache Tomcat?
- Blog - GhostCat Vulnerability in Tomcat
- Blog - Apache Tomcat 7: EOL Dates and Considerations
- Blog - Apache Tomcat 8: Overview, Clustering, and More
- Blog - Apache Tomcat 10: Key Considerations for Deployment
- Blog - Apache Tomcat Clustering: The Ultimate Guide
- Blog - Apache Tomcat Security Best Practices