Is Spring Boot’s Embedded Tomcat a Step Forward or Backward?
The article argues that while Spring Boot’s embedded Tomcat simplifies deployment, it tightly couples the web layer with business code and inflates JAR size, whereas the lightweight smart‑servlet framework offers a modular 1.3 MB alternative with clear boundaries, fast cold start, full Servlet 6.1 compliance, and tangible benefits for migration, domestic adaptation, and operations troubleshooting.
Since its 2014 release, Spring Boot promoted the embedded Tomcat container as a major breakthrough, allowing developers to run a JAR directly without configuring an external container or building a WAR package, which indeed simplifies deployment.
However, the article points out that this convenience comes at a cost: Tomcat shifts from a "deployment target" to a "runtime dependency" packaged inside the application JAR, binding the web service layer tightly to business code and making the service layer hard to replace. A minimal "Hello World" Spring Boot application typically produces a 17‑20 MB JAR, where the actual business code may be only a few dozen kilobytes and the rest is Spring Boot and Tomcat.
As an alternative, the smart‑servlet framework provides a complete dependency bundle of about 1.3 MB . The smaller size is not due to missing functionality but because each layer does only what it should: a network layer, a core web‑service layer, and a servlet‑adapter layer, all with clear boundaries. It achieves cold‑start times under 100 ms, supports HTTP/1.1, HTTP/2, WebSocket, and SSE, and is cloud‑native friendly. By strictly implementing the Servlet 6.1 specification, it offers near‑100 % compatibility, leaving existing web.xml configurations and filter chains untouched.
The contrast between 1.3 MB and 20 MB highlights an architectural rather than functional difference.
For enterprises, this architectural shift brings several advantages: clear separation between the web service layer and business code enables migration by changing only the web layer, leaving business code untouched; independence from commercial container vendors facilitates domestic (国产化) adaptation; and the web layer becomes transparent for operations, allowing easier troubleshooting of connection management, thread scheduling, and protocol handling.
v3.2 just released, focusing on feature and smart‑socket stability improvements. Lightness is not the goal; reliability is.
GitHub: https://github.com/smartboot/smart-servlet
Gitee: https://gitee.com/smartboot/smart-servlet
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Three Knives
Every line of code you contribute to open source could help make the future better.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
