Skip to content

Commit 6f4307f

Browse files
committed
docs(notes): add Tomcat vs Jetty comparison
1 parent aadb0c3 commit 6f4307f

File tree

5 files changed

+64
-3
lines changed

5 files changed

+64
-3
lines changed

_posts/en/2025-01-11-notes-en.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ generated: false
77
translated: false
88
---
99

10-
These 2135 notes are primarily generated by AI chatbots. I used them to summarize key points and will walk through them to enhance my understanding.
10+
These 2136 notes are primarily generated by AI chatbots. I used them to summarize key points and will walk through them to enhance my understanding.
1111

1212
* [Core Essentials of LLM Applications](/notes/2025-09-05-core-llm-essentials-en)
1313
* [Spring Web Application Setup Without Boot](/notes/2025-09-05-spring-webapp-setup-en)
14+
* [Tomcat and Jetty Comparison](/notes/2025-09-05-tomcat-jetty-comparison-en)
1415
* [Web Application Deployment Options Explained](/notes/2025-09-05-web-app-deployment-options-en)
1516
* [Working Directory Importance for Coding Agents](/notes/2025-09-05-working-directory-importance-en)
1617
* [AI Model Context Window Capacities](/notes/2025-09-03-ai-model-context-window-en)
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
title: Tomcat and Jetty Comparison
3+
lang: en
4+
layout: post
5+
audio: false
6+
translated: false
7+
generated: true
8+
image: false
9+
---
10+
11+
Tomcat and Jetty are both popular **Java-based web servers and servlet containers**, but they serve slightly different purposes and have different strengths. Here’s a breakdown in a narrative style for easier reading:
12+
13+
---
14+
15+
### Tomcat
16+
17+
Tomcat, developed by the Apache Software Foundation, is often considered the **default choice** when people think of running Java web applications.
18+
19+
* **Focus**: It’s primarily designed as a reference implementation of the Java Servlet and JSP specifications.
20+
* **Ecosystem Fit**: Many frameworks (like Spring MVC) assume Tomcat as the default container, so integration and documentation are abundant.
21+
* **Performance**: Reliable and stable under high traffic, but it carries more overhead than Jetty for lightweight setups.
22+
* **Use Cases**: Large-scale enterprise apps, production systems where standard servlet/JSP support is required.
23+
24+
---
25+
26+
### Jetty
27+
28+
Jetty, developed by Eclipse Foundation, is lightweight and highly embeddable.
29+
30+
* **Focus**: It’s designed to be a small, fast HTTP server and servlet container that can be embedded into other applications.
31+
* **Ecosystem Fit**: Frequently used in microservices, frameworks, and servers that need to ship with their own HTTP engine (e.g., Hadoop, Spark, Solr, and many Spring Boot apps embed Jetty).
32+
* **Performance**: Very fast to start, lower memory footprint, and well-suited for scenarios with many short-lived connections (like WebSockets).
33+
* **Use Cases**: Microservices, IoT, tools needing an integrated web server, or environments with resource constraints.
34+
35+
---
36+
37+
### Key Differences in Spirit
38+
39+
* **Tomcat** feels like a “full-featured, ready-to-deploy” server. It shines when you want a standalone application server with a well-known ecosystem.
40+
* **Jetty** feels like a “component” rather than a “product.” It excels when you want to embed HTTP serving inside your application or keep the footprint minimal.
41+
42+
---
43+
44+
👉 If you’re building an **enterprise web application**, Tomcat is usually the go-to.
45+
👉 If you’re building **lightweight services or tools** where the server is just a piece of the puzzle, Jetty tends to be a better fit.
46+
47+
---
48+
49+
Would you like me to also cover **how they compare in Spring Boot** specifically? That’s often where people decide between embedded Tomcat vs. Jetty.

original/2025-01-11-notes-en.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ generated: false
77
translated: false
88
---
99

10-
These 2135 notes are primarily generated by AI chatbots. I used them to summarize key points and will walk through them to enhance my understanding.
10+
These 2136 notes are primarily generated by AI chatbots. I used them to summarize key points and will walk through them to enhance my understanding.
1111

1212
* [Core Essentials of LLM Applications](/notes/2025-09-05-core-llm-essentials-en)
1313
* [Spring Web Application Setup Without Boot](/notes/2025-09-05-spring-webapp-setup-en)
14+
* [Tomcat and Jetty Comparison](/notes/2025-09-05-tomcat-jetty-comparison-en)
1415
* [Web Application Deployment Options Explained](/notes/2025-09-05-web-app-deployment-options-en)
1516
* [Working Directory Importance for Coding Agents](/notes/2025-09-05-working-directory-importance-en)
1617
* [AI Model Context Window Capacities](/notes/2025-09-03-ai-model-context-window-en)

playground-server/.claude/settings.local.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"allow": [
44
"Bash(mvn checkstyle:check:*)",
55
"Bash(mvn compile:*)",
6-
"Bash(mvn tomcat7:run:*)"
6+
"Bash(mvn tomcat7:run:*)",
7+
"Bash(pkill:*)"
78
],
89
"deny": [],
910
"ask": []

playground-server/pom.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,15 @@
189189
</execution>
190190
</executions>
191191
</plugin>
192+
<plugin>
193+
<groupId>org.apache.tomcat.maven</groupId>
194+
<artifactId>tomcat7-maven-plugin</artifactId>
195+
<version>2.2</version>
196+
<configuration>
197+
<port>8080</port>
198+
<path>/</path>
199+
</configuration>
200+
</plugin>
192201
</plugins>
193202
</build>
194203

0 commit comments

Comments
 (0)