46

I have been trying to understand Spring Boot and maybe migrate my project to it. However I do not get the real advantage of it except the embedded Tomcat. Would you kindly explain to me what is the real power of Spring Boot compared to regular Spring?

Ozum Safa
  • 1,458
  • 2
  • 15
  • 27
  • 3
    A significant number of people are interested in the question, and a bunch of people decides to close the question as it is opinion based. Says much about stackoverflow – Ozum Safa Jan 02 '17 at 13:13
  • 2
    Given the question is closed, I wanted to add my 2 cents after 2 years as I've been observing some upvotes. Currently the main advantage of spring boot lies in how it fits to the container based deployment which is done by basically for every new infrastructure out there. Without spring-boot it is difficult to use spring in a docker based container. – Ozum Safa May 02 '17 at 11:11

7 Answers7

34

Quoting from the Spring Boot Page, it has following features:

  1. Create stand-alone Spring applications
  2. Embed Tomcat, Jetty or Undertow directly (no need to deploy WAR files)
  3. Provide opinionated 'starter' POMs to simplify your Maven configuration
  4. Automatically configure Spring whenever possible
  5. Provide production-ready features such as metrics, health checks and externalized configuration
  6. Absolutely no code generation and no requirement for XML configuration
naXa stands with Ukraine
  • 35,493
  • 19
  • 190
  • 259
Arpit Aggarwal
  • 27,626
  • 16
  • 90
  • 108
  • 1
    Is the "no requirement for XML configuration" part really specific to spring-boot? Is it not arleady possible to configure everything through java configuration classes without using spring-boot? – kgautron Jun 13 '16 at 15:27
  • @kgautron No, one can use Java based configuration without using spring-boot. – Arpit Aggarwal Jun 13 '16 at 16:15
  • 1
    Spring boot/Spring is double edged sword. Mainly it depends on what kind of developers working on the project. Because Spring is rich in features; it can quickly go out of hand with sloppy developers. You need a tighter control on what features should be used for what purpose otherwise you will end up with fatty application. Overall Spring is not lightweight anymore, with every release tons of features are getting added and if those features gets dragged in just for the sake of using it, the application becomes not maintainable any more, its hard to make changes quickly – webjockey Dec 14 '17 at 00:45
19

The big advantage is out of the box configuration based on what it finds and server embedded (you can make a jar run it and go to localhost:8080 to see the result) beside that it has metrics, health checks, externalised configuration, etc.

In my opinion is the perfect tool for building cloud microservices.

Cassian
  • 3,648
  • 1
  • 29
  • 40
7

Bootstrapping with defaults included in the configuration / jar-dependencies, is the real advantage of Spring boot! Get the things done quickly!

Its just another project from Spring framework, where things look simplified, with strong support for Security, Data, Social etc all features you want for your application.

If you prefer annotations over XML configuration like me you might use @Configuration for configuration, @ComponentScan for Dependency Injection, and @EnableAutoConfiguration to tell spring to guess the defaults and work along. The @SpringBootApplication annotation is equivalent to using @Configuration, @EnableAutoConfiguration, and @ComponentScan with their default attributes. So things further simplified, with a single annotation doing the work of 3.

DwB
  • 37,124
  • 11
  • 56
  • 82
5

It's real easy to get something going from nothing, with loads of useful defaults.

Not so easy if you want to migrate some existing project which will most likely have developed a lot of quirks that are going to be difficult to migrate.

ci_
  • 8,594
  • 10
  • 39
  • 63
5

Advantages of SpringBoot:

  • No need of creating boilerplate configuration
  • Plenty of SpringBoot Starter to quickly get up and running
  • DevTools to autorestart server on code/config updates
  • Embedded Tomcat/Jetty/Undertow support
  • Easier customization of application properties
  • Easy management of profile specific properties
  • Easier dependency management using platform-bom

Here are few of my articles on what are the advantages of SpringBoot and how SpringBoot works.

Why SpringBoot?

How SpringBoot AutoConfiguration magic works?

K. Siva Prasad Reddy
  • 11,786
  • 12
  • 68
  • 95
4

Biggest of all is that spring boot is aligned with the concept of microservices and can be run from a container anywhere e.g. cloud. This possible because the following nature of springboot

  • small footprint
  • standalone services
  • easier to launch from a container, each service can be in its own container (like docker)
  • easy to configure and deploy completely from a script. Good for auto-scaling and deploying in the cloud.
Santanu Dey
  • 2,900
  • 3
  • 24
  • 38
2

In active development,spring boot has the advantage of leave the complex xml file configure.

1.Embedded tomcat discard the web.xml configuration;

2.spring-boot security discard the applicationcontext-security.xml configuration;

3.spring-boot webservice discard the applicationcontext-ws.xml configuration;

4.spring-boot mvc discard the applicationcontext.xml configuration;

5.spring-boot datasource(both Relational Database and nosql Database) discard the applicationcontext.xml configuration,even if more than one datasource.

Discard this configuration file easy our development and improve the efficiency.

jinjun.zhu
  • 59
  • 4