Skip to content
Go back

Tomcat, Jetty, or Undertow? A Guide to Choosing a High-Performance Java Web Server

Published:  at  11:17 AM

When developing Java applications, choosing the right web server is a key factor in ensuring performance, scalability, and maintainability. The three most popular choices today are Apache Tomcat, Jetty, and Undertow. Each server has its own pros and cons and suits different types of applications. In this article, we’ll analyze them in detail to help you make the right decision.

1. Apache Tomcat

Introduction

Tomcat is one of the most popular web servers in the Java ecosystem, developed by the Apache Software Foundation. It fully supports Servlet and JSP, and is often bundled with Spring Boot via the spring-boot-starter-web dependency.

Advantages

Disadvantages

Suitable Applications

2. Jetty

Introduction

Jetty is a lightweight web server and servlet container, developed by the Eclipse Foundation. It stands out for being lightweight, fast, and flexible, suitable for microservices and embedded applications.

Advantages

Disadvantages

Suitable Applications

3. Undertow

Introduction

Undertow is an extremely lightweight and fast web server, developed by RedHat, and is the default server in WildFly. It supports embedded, non-blocking I/O, and reactive models, making it very suitable for microservices and cloud-native.

Advantages

Disadvantages

Suitable Applications

4. Overall Comparison

CriteriaTomcatJettyUndertow
Thread modelThread-per-requestThread-per-request / Non-blockingNon-blocking / Reactive
Memory footprintMediumLowVery low
StartupMediumFastVery fast
HTTP/2 supportLimitedGoodGood
EmbeddedYesVery easyVery easy
JSP supportYesYesNo
Reactive / WebFluxLimitedGoodExcellent

5. Server Selection Based on Application Type

6. Conclusion

Choosing a server isn’t just about performance, but also depends on application architecture, technology used, and deployment environment. Understanding the pros and cons of Tomcat, Jetty, and Undertow will help you optimize performance and user experience.


Share this post on:

Previous Post
Why Twilio Segment Said Goodbye to Microservices and Returned to Monolith
Next Post
Project Loom: The Concurrency Revolution in Java