Need advice about which tool to choose?Ask the StackShare community!

Jetty

472
310
+ 1
47
Undertow

51
94
+ 1
5
Add tool

Jetty vs Undertow: What are the differences?

Introduction

Jetty and Undertow are both web servers and servlet containers that are commonly used in Java web applications. While they serve similar functions, there are some key differences between the two.

  1. 1. Performance and Resource Usage: Jetty and Undertow differ in terms of performance and resource usage. Jetty is known for its faster throughput and lower latency, making it a suitable choice for high-performance applications. On the other hand, Undertow is designed to be lightweight and efficient, consuming less memory and CPU resources. This makes Undertow ideal for resource-constrained environments or deployments with limited resources.

  2. 2. Configuration and Embeddability: Jetty and Undertow offer different approaches to configuration and embeddability. Jetty has a centralized XML configuration file that allows fine-grained control over various settings. It is highly configurable and supports a wide range of extensions and modules. Undertow, on the other hand, follows a programmatic configuration approach, making it easier to embed and configure within applications. This makes Undertow a good choice for microservices-based architectures where embedding the server within the application is desirable.

  3. 3. WebSocket Support: Both Jetty and Undertow provide support for WebSockets, but there are some differences in their implementations. Jetty's WebSocket implementation is based on the JSR 356 standard, providing a high-level API and various useful features out-of-the-box. Undertow, on the other hand, uses its own WebSocket implementation, which is known for its scalability and low overhead. The choice between Jetty and Undertow in terms of WebSocket support depends on specific use cases and requirements.

  4. 4. Servlet API Compatibility: Jetty and Undertow have different levels of compatibility with the Servlet API. Jetty has a long history and robust support for the Servlet API, making it compatible with a wide range of Java EE specifications. It offers comprehensive support for servlets, filters, listeners, and other servlet-related features. Undertow, although fully compliant with the Servlet API, focuses more on the core functionalities and might not provide all the advanced features and extensions that Jetty offers.

  5. 5. Community and Ecosystem: Jetty and Undertow have distinct communities and ecosystems surrounding them. Jetty has been around for a longer time and has a larger and more mature ecosystem, with a wide range of extensions, plugins, and community support available. It has a well-established user base and is widely adopted in various industries. Undertow, being relatively newer, has a smaller but growing community. However, it benefits from being part of the larger JBoss and Wildfly ecosystem, which provides additional libraries and components.

  6. 6. Documentation and Learning Curve: The availability of documentation and the learning curve can also differ between Jetty and Undertow. Jetty has comprehensive and well-documented guides, tutorials, and examples, making it easier for developers to get started and find solutions to common problems. Undertow, while having good documentation, might not have the same breadth of resources as Jetty. However, its simpler configuration and embeddability approach can make the learning curve less steep for developers new to web server configurations.

In summary, Jetty and Undertow differ in terms of their performance, resource usage, configuration, embeddability, WebSocket support, Servlet API compatibility, community and ecosystem, as well as documentation and learning curve. The choice between the two depends on specific use cases, requirements, and familiarity with the respective technologies.

Manage your open source components, licenses, and vulnerabilities
Learn More
Pros of Jetty
Pros of Undertow
  • 15
    Lightweight
  • 10
    Embeddable
  • 10
    Very fast
  • 6
    Very thin
  • 6
    Scalable
  • 4
    Performance
  • 1
    Lower footprint

Sign up to add or upvote prosMake informed product decisions

Cons of Jetty
Cons of Undertow
  • 0
    Student
  • 1
    Smaller community
  • 1
    Less known

Sign up to add or upvote consMake informed product decisions

What is Jetty?

Jetty is used in a wide variety of projects and products, both in development and production. Jetty can be easily embedded in devices, tools, frameworks, application servers, and clusters. See the Jetty Powered page for more uses of Jetty.

What is Undertow?

It is a flexible performant web server written in java, providing both blocking and non-blocking API’s based on NIO. It has a composition based architecture that allows you to build a web server by combining small single purpose handlers. The gives you the flexibility to choose between a full Java EE servlet 4.0 container, or a low level non-blocking handler, to anything in between.

Need advice about which tool to choose?Ask the StackShare community!

Jobs that mention Jetty and Undertow as a desired skillset
What companies use Jetty?
What companies use Undertow?
Manage your open source components, licenses, and vulnerabilities
Learn More

Sign up to get full access to all the companiesMake informed product decisions

What tools integrate with Jetty?
What tools integrate with Undertow?

Blog Posts

What are some alternatives to Jetty and Undertow?
Apache Tomcat
Apache Tomcat powers numerous large-scale, mission-critical web applications across a diverse range of industries and organizations.
Netty
Netty is a NIO client server framework which enables quick and easy development of network applications such as protocol servers and clients. It greatly simplifies and streamlines network programming such as TCP and UDP socket server.
Wildfly
It is a flexible, lightweight, managed application runtime that helps you build amazing applications. It supports the latest standards for web development.
JBoss
An application platform for hosting your apps that provides an innovative modular, cloud-ready architecture, powerful management and automation, and world class developer productivity.
GlassFish
An Application Server means, It can manage Java EE applications You should use GlassFish for Java EE enterprise applications. The need for a seperate Web server is mostly needed in a production environment.
See all alternatives