20

We're looking at converting some of our legacy JaveEE apps over to Spring Boot. We're getting a vendor in to perform this, but they claim that Spring boot with embedded Tomcat or Jetty is not production ready and instead recommend us to still package it for deployment into a container (either Tomcat/Jetty or JBoss). This kinds of defeats the purpose. Is the claim accurate?

Oliver Drotbohm
  • 80,157
  • 18
  • 225
  • 211
arislan
  • 281
  • 1
  • 2
  • 7
  • Other similar and interesting posts: [Deploying Spring Boot in Production](https://stackoverflow.com/q/53002502/269514) [One Spring Boot project, deploy to both JAR or WAR](https://stackoverflow.com/q/23868580/269514) – Gilberto Jul 14 '20 at 14:00

2 Answers2

24

The Spring team recommends the standalone "embedded mode", Pivotal (Spring's corporate sponsor) provides major consulting services and recommends embedded mode, and Netflix has reengineered large sections of its systems to run on standalone Boot.

I've been using embedded mode (Tomcat and now Undertow) since 0.5.0M6 and have never had a problem with the server component. Sounds like maybe your vendor has a problem to sell you.

chrylis -cautiouslyoptimistic-
  • 75,269
  • 21
  • 115
  • 152
  • 1
    **"The Spring team recommends standalone embedded mode"** Where have you found this information ? I don't manage to find this information in the Spring boot documentation. And what do you mean by "**standalone embedded mode**". It sounds weird since contradictory terms. When I search this terms with quotes on google, I don't find any related information but your answer on SO. – davidxxx Sep 15 '16 at 19:33
  • @davidhxxx I'm not sure where to direct you at this point; in no small part, that's based on personal conversations with Dave Syer and others. Regarding "standalone embedded", that comes from the traditional J2EE business of having an external container into which you install the application. Spring Boot *embeds* the servlet container as an engine so that you can run the application *standalone* with just `java -jar`. – chrylis -cautiouslyoptimistic- Sep 15 '16 at 20:00
  • Thank you for these precisions. About the second point (standalone embedded), I question myself. If SpringBoot provides the container, it looks like an embedded mode. You said **Pivotal (Spring's corporate sponsor) provides major consulting services and recommends embedded mode** But i don't see how this embedded mode could be different from the String team embedded mode that you have just described in your comment. – davidxxx Sep 15 '16 at 20:47
  • @davidhxxx Don't understand your comment. "Standalone embedded" and "embedded" are the same thing. The opposite is "external container". – chrylis -cautiouslyoptimistic- Sep 15 '16 at 20:48
  • I agree but in your answer you seem distinguish "Standalone embedded" and "embedded" : **The Spring team recommends standalone embedded mode, Pivotal (Spring's corporate sponsor) provides major consulting services and recommends embedded mode** But by reading you last comment, you confirm that the distinction you did in your answer is not needed. – davidxxx Sep 15 '16 at 20:52
4

The Twelve-Factor App recommendations on the topic:

The twelve-factor app is completely self-contained and does not rely on runtime injection of a webserver into the execution environment to create a web-facing service.

It doesn't explain why, but the source is here. From my personal experience, I'd argue that it adds more configuration (and therefore complexity) where it really isn't required. It also makes the development and production environments closer (i.e. what the developer writes is what gets run in production). Under heavy loads, it would make sense to put another service in front of a cluster of your services to handle load balancing, but that's another topic.

Alex Taylor
  • 8,343
  • 4
  • 25
  • 40