Home > Enterprise >  Should we use embedded tomcat container that springboot provides for production grade application?
Should we use embedded tomcat container that springboot provides for production grade application?

Time:07-20

As I read that springboot provides internal embedded containers like Tomcat? Can we use the same for production application or should we configure any other container for this purpose?

CodePudding user response:

Embedded Tomcat is as much production-ready as an external one. There's nothing inherently wrong with using embedded Tomcat in a Spring Boot application in production. Embedded server is just a way of running a Spring Boot application as a jar. An alternative would be deploying it as a war on an external server. Both approaches have their trade-offs.

A typical scenario where you might prefer to run the application as a jar is if you want to run it in a Docker container. Deploying a container with a packaged jar application is arguably a more modern and cloud-native way than deploying a war to an external Tomcat installed somewhere.

Obviously, for production you might want to configure the server differently as compared to the development environment, but that has nothing to do with it being embedded or external.

  • Related