Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the pros/cons of using Spring Boot with embedded server

What are the pros/cons to using Boot with embedded server rather than conventionally deploying war to web server?

I realize it is a great fit for development and also seems to be embedded in most discussions surrounding microservices. Is this model intended to be deployed to production? Seems like tuning the embedded server could be problematic not to mention heap requirements.

like image 768
stanlick Avatar asked Jan 07 '16 19:01

stanlick


People also ask

Does spring boot have embedded server?

Each Spring Boot web application includes an embedded web server. This feature leads to a number of how-to questions, including how to change the embedded server and how to configure the embedded server.

What are the disadvantages of spring boot?

Disadvantages of Spring Boot Large deployment files that result from unused dependencies. The long amount of time that it takes to replace legacy systems with Spring Boot applications. Its inability to build large, monolithic applications (although it works extremely well for developing microservices)

What is embedded server in spring boot?

An embedded server is embedded as part of the deployable application. If we talk about Java applications, that would be a JAR. The advantage with this is you don't need the server pre-installed in the deployment environment. With SpringBoot, the default embedded server is Tomcat.


1 Answers

Pros:

  • You can create the entire applications in a fast track manner. Not very in depth knowledge of Spring framework is required. It defaults a lot of settings or in other words convention over configuration.
  • Good for developing micro services in docker environment. Spring Cloud Netflix OSS is one such example.
  • It has embedded tomcat servlet container and you write code as if you are writing a standalone Java code with plain old main method. This way you are focusing more on the developing the business logic rather than plumbing aspects.

Cons:

  • As it's rapid application development with convention over configuration and you really want to control each and every aspect of the application - then you need to know everything that is happening under the hood. For any further code changes you just don't have to go thru the source code but each and every configuration that is done by Spring boot for you.
  • Lots of JAR files and settings are created for you so it might impact the overall footprint of the app as well as impact the performance. Yes you can work on it but you need to know what's going on under the hood.
  • I don't think that the convention over configuration does the best configuration for the embedded server. You should be looking into each and every configuration settings of embedded server to optimize the run time performance of your application.
like image 160
Ashu Avatar answered Oct 06 '22 02:10

Ashu