Skip to content
New Atlanta
Topics

Tomcat vs Jetty

Choose Tomcat or Jetty by matching the application’s Servlet API and Java version first, then decide who owns packaging, patching and rollback.

Published 9 min read
Tomcat 9.0 compatibility
Servlet 4.0 on Java 8 or later
Tomcat 11.0 compatibility
Servlet 6.1 on Java 17 or later
Jetty namespace choice
Select a deployment environment
Jetty embedding
Embeddable server components

Decision guide

Apache Tomcat
Choose Tomcat for a WAR deployment that matches an Apache-supported branch and fits a platform team’s existing server configuration and update cycle.
Eclipse Jetty
Choose Jetty when application-owned server assembly or distinct Servlet environments on a Java 17 host solve a concrete packaging or migration constraint.
Deciding factor
Identify the class that handles a real request, its Servlet namespace and the Java version on the production image before comparing throughput.

Comparison matrix

Both servers can be embedded. The practical difference for a mixed estate is how each deployment selects the web API its application expects.

Deployment choices and Servlet compatibility, checked December 3, 2026 Verified
Decision factorApache TomcatEclipse Jetty
Choosing a Servlet API Branch determines Servlet generation9.0, 10.1 and 11.0 Select a deployment environmentJetty 12 environment model
Packaging in an application Programmatic startup availableApplication-owned container Embeddable server componentsApplication-owned container

Match the deployed binary to a supported branch

A servlet compiled against javax.servlet expects different class names from one compiled against jakarta.servlet. Read the dependencies and descriptors of the artifact that actually runs in production before choosing its host.

Tomcat 9.0 implements Servlet 4.0 and runs on Java 8 or later. Tomcat 10.1 implements Servlet 6.0 and requires Java 11 or later. Tomcat 11.0 implements Servlet 6.1 and requires Java 17 or later. The move from the 9 line to the 10 line crosses the Servlet package boundary. A later Java release can run an application compiled for an older Java baseline in many circumstances, but changing the JVM alone cannot supply a missing Servlet package. An installation already on Java 17 may still have a Java EE 8 application.

Jetty 12.1 requires Java 17 and offers separate web application environments for EE8, EE9, EE10 and EE11. Select the deployment module that corresponds to the artifact. An EE8 application can use javax.servlet while a different application on the same server uses a Jakarta environment. Within one application the filter, listener and library dependencies still need to agree about the API. A legacy application whose supplier certifies only Java 8 has a second constraint: choosing an EE8 environment in Jetty 12.1 does not lower the Java minimum of the server itself.

Decide who ships the container patch

A platform-owned installation lets one team deliver a server update to a group of WARs. An embedded server makes the container libraries part of each application release, whether the project uses Tomcat or Jetty.

With a standalone Tomcat deployment, an operations team can build a common image, maintain connectors and logging, and deploy a versioned application archive into a configured context. List the pieces the archive assumes will exist outside itself. Database pools, naming resources, trust stores, shared libraries and reverse-proxy settings can make an apparently portable WAR depend heavily on a particular installation. Inventory the configuration that supplied those pieces and identify who tests replacements when a server image changes.

For an embedded service, identify the application dependency that brings in the server. A framework or dependency-management file may choose the version on the team's behalf. Record that resolved version in the release inventory and make a trial patch through the normal image build. The useful measurement is the time between selecting a supported patch and delivering it to every running replica. A library update merged in the source repository buys no protection for an old image still serving production. Conversely, a single shared installation can make one platform update affect several applications at once. Decide whether their owners can test and roll back together.

Inspect a real WAR before changing servers

Use the packaged artifact and a production-like configuration to discover dependencies that the application build hides. Start with the request path that carries the most business risk, then work outward to startup and administrative paths.

For a checkout service, trace one authorized request from the proxy through the authentication filter and servlet to the database pool. Identify the code that sets a session cookie, the component that resolves the user identity and the object looked up by name. A filter supplied by a third-party JAR can still require the older namespace even if the application source compiles cleanly against the newer API. Check service-provider configuration and deployment descriptors for references that a search of Java source would miss. Record the exact class in any linkage error before changing another dependency.

Next, deploy the archive using the packaging intended for production. Exercise a JSP if the application ships one, an asynchronous request if it relies on one, and a WebSocket upgrade if clients use persistent connections. Observe how forwarded headers affect redirects and cookie attributes when the request comes through the actual proxy chain. Static content can return a successful status while every authenticated route fails. A useful smoke test includes a successful login, a rejected login, a data write in a disposable database and the resulting response sent back through the proxy.

Compare capacity with the same request and resource limits

Choose a throughput target only after both candidates pass correctness tests. A credible comparison holds the application, JVM settings, downstream capacity and request mix steady while changing the container.

Build two images with the same JDK distribution, feature version, memory limit and collector settings. Specify the provider's support tier for that JDK separately from the container project's support status. Match TLS termination, compression, connection reuse, thread limits and database pool size, or record the reasons a setting must differ. Warm the endpoints long enough to observe steady behavior and run several trials. Capture arrival rate, completed requests, error rate, tail latency and CPU consumption together. A rising completion rate can conceal a growing queue if the generator submits work faster than the service drains it.

Include a quiet period, a burst, a slow downstream dependency and a rolling restart. A server that looks quick on short stateless requests may behave differently while streams wait on a client or a database connection. Monitor the downstream pool while varying concurrency. If both runs plateau as every database connection becomes busy, allocating more application threads may increase waiting time without increasing completions. Keep those observations with the image digests and test data. They let the next engineer reproduce a result when the application, host size or JVM changes.

Plan the upgrade and test a reversible cutover

Treat the server branch, JDK distribution and application framework as three support calendars. The target deployment needs a maintainer for each one throughout its planned lifetime.

Apache's February 11, 2026 branch announcement sets March 31, 2027 as the end of support for Tomcat 9.0.x and schedules releases from 9.1.x through December 31, 2030. A team that needs the older Servlet namespace should put the move to 9.1.x on its calendar and check whether its installation uses the retiring APR/Native Connector. Eclipse Jetty's compatibility guide lists the 10 and 11 branches as end of life and distinguishes the environments supported by the 12 branches. Record the source and date for each support statement. A commercial vendor may maintain a separate contract for a build, so confirm entitlement and patch availability against that contract.

For a pilot, select a route with known traffic and direct a small portion to the candidate image. Preserve the previous runnable image, server configuration and traffic rule together. Compare authentication, response bodies and application errors alongside normal health checks. If sessions live in memory, decide whether to drain connections, tolerate reauthentication or use a compatible shared store. Test a request with an existing session during rollback. Sending traffic back to the former process is straightforward only when that process still understands the session and data the candidate produced. Keep database schema changes in a separately rehearsed deployment so a web container rollback remains a practical option.

Frequently asked questions

Can one Jetty process host old and new servlet applications?

Jetty 12.1 can deploy different applications into their respective EE environments when the corresponding deployment modules are enabled. Check the environment assigned to each WAR and test it on the Java version required by the server.

Will a Tomcat WAR run unchanged in embedded Jetty?

It depends on the APIs and deployment services the WAR expects. Check the Servlet environment, optional modules, naming resources and authentication integration. A matching namespace solves only one part of the move.

Which server should a framework-based service choose?

Start with the server versions the framework supports. Build an example with the replacement, exercise application endpoints, then test the framework’s shutdown and restart behavior. A project-supported server may still fall outside the support window of your framework version.

Methodology and sources

Branch and namespace claims use the Apache Tomcat support matrix, Eclipse Foundation project records and the Jetty 12.1 compatibility and deployment manuals, checked December 3, 2026. Test procedures are proposed measurements; no universal performance ranking is assumed.

About Evan Pritchard
Infrastructure & Kubernetes Architecture Writer

Editorial pen name. Covers infrastructure as code, cluster upgrades and application runtime migrations.