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

Jetty

473
311
+ 1
47
Apache Tomcat

16.6K
12.4K
+ 1
201
Add tool

Apache Tomcat vs Jetty: What are the differences?

Introduction

Apache Tomcat and Jetty are both popular web servers and servlet containers used to serve Java web applications. While they have similarities in their functionality and purpose, there are also key differences between the two. This article will outline six key differences between Apache Tomcat and Jetty.

  1. Configuration: One key difference between Apache Tomcat and Jetty is the way they handle configuration. Tomcat typically requires XML configuration files and a separate installation, while Jetty uses a more flexible approach with properties files and a lightweight embedded server. This makes it easier to configure and deploy applications on Jetty.

  2. Embeddability: Another difference is in their embeddability. Jetty is often favored for embedded scenarios as it can be easily integrated into other Java applications and frameworks. It provides an API that allows developers to embed Jetty into their own applications, providing greater control over the server environment. Tomcat, on the other hand, is typically used as a standalone server and is not as easily embeddable.

  3. Performance: In terms of performance, Jetty is known for its lightweight architecture and low memory footprint. It is designed to handle a high number of concurrent connections efficiently, making it well-suited for applications with high traffic. Tomcat, on the other hand, may require more resources and is generally considered to be slower than Jetty.

  4. Community and Support: Apache Tomcat has a larger and more established community compared to Jetty. This means that Tomcat has a wealth of resources, documentation, and community support available, making it easier to find solutions to problems. Jetty, while still having an active community, may not have as extensive a support network.

  5. Advanced Features: Apache Tomcat includes a wider range of advanced features and capabilities out-of-the-box, such as support for clustering, session replication, and load balancing. These features are not as readily available in Jetty and may require additional configuration or plugins.

  6. Suitability and Use Cases: The choice between Apache Tomcat and Jetty often depends on the specific use case and requirements of the application. Tomcat is a good choice for larger, enterprise-level applications that require advanced features and a robust support network. Jetty, on the other hand, is well-suited for lightweight applications, microservices, and embedded scenarios where performance and embeddability are important factors.

In summary, Apache Tomcat and Jetty differ in their configuration approach, embeddability, performance characteristics, community support, availability of advanced features, and suitability for different use cases. The choice between the two depends on the specific requirements and priorities of the application being developed.

Decisions about Jetty and Apache Tomcat

I was in a situation where I have to configure 40 RHEL servers 20 each for Apache HTTP Server and Tomcat server. My task was to 1. configure LVM with required logical volumes, format and mount for HTTP and Tomcat servers accordingly. 2. Install apache and tomcat. 3. Generate and apply selfsigned certs to http server. 4. Modify default ports on Tomcat to different ports. 5. Create users on RHEL for application support team. 6. other administrative tasks like, start, stop and restart HTTP and Tomcat services.

I have utilized the power of ansible for all these tasks, which made it easy and manageable.

See more
Manage your open source components, licenses, and vulnerabilities
Learn More
Pros of Jetty
Pros of Apache Tomcat
  • 15
    Lightweight
  • 10
    Embeddable
  • 10
    Very fast
  • 6
    Very thin
  • 6
    Scalable
  • 79
    Easy
  • 72
    Java
  • 49
    Popular
  • 1
    Spring web

Sign up to add or upvote prosMake informed product decisions

Cons of Jetty
Cons of Apache Tomcat
  • 0
    Student
  • 3
    Blocking - each http request block a thread
  • 2
    Easy to set up

Sign up to add or upvote consMake informed product decisions

- No public GitHub repository available -

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 Apache Tomcat?

Apache Tomcat powers numerous large-scale, mission-critical web applications across a diverse range of industries and organizations.

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

Jobs that mention Jetty and Apache Tomcat as a desired skillset
What companies use Jetty?
What companies use Apache Tomcat?
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 Apache Tomcat?

Sign up to get full access to all the tool integrationsMake informed product decisions

Blog Posts

What are some alternatives to Jetty and Apache Tomcat?
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.
Jersey
It is open source, production quality, framework for developing RESTful Web Services in Java that provides support for JAX-RS APIs and serves as a JAX-RS (JSR 311 & JSR 339) Reference Implementation. It provides it’s own API that extend the JAX-RS toolkit with additional features and utilities to further simplify RESTful service and client development.
See all alternatives