Spring Boot : IntroductionSpring Boot can be referred as Spring on Steroids. Spring boot is a wrapper written over spring modules to allow users to create fast paced spring applications without doing the redundent configurations needed to setup the application.
Features provided by Spring Boot
- CLI applications - enables to create a single class application.
- Embedded Tomcat and Jetty
- Auto configurations for most of the libraries like mysql, mongo, amqp etc
- No Xml required for setup or configurations.
- Ability to package the application as both war and jar.
- Dependency Management using starter projects and BOM's.
When you create a spring application that needs Mysql database. We had to
- declare the mysql connector dependency in build file.
- add the component scan to search the classes for mappings.
- map each entity/domain in xml files.
- Read data base configurations and create DataSource bean.
- add resource handlers to serve static content like css, js, images etc.
After doing all these steps, if you did not miss any and all your configurations are good, you will be able to run your application properly. But with spring boot all you need to do is,
- Add Spring boot dependency
- add data base configurations in a properties file or yaml file.
- run application
Here in spring boot, Auto configuration is already done to load your database credentials from a properties file and create datasource bean.
The first case might take 1-2 days or even a week if your a newbie in spring world. However when you do that same thing in Spring Boot, you will be able to launch the application in a few hours or even less.
This is how Spring Boot has made the Spring configurations so easy and has removed all the Boiler plate code.