- Spring Boot is an open source, microservice-based Java web framework.
- It is an extension of already existing Spring Framework with some specific features that make the application easier for working within developer ecosystem.
- Spring Boot is not a separate framework. It is built on top of the Spring Framework.
- It removes the tedious work from the developer end and allow developers to focus on the business code with minimal or zero configurations.
- It provides a set of libraries and APIs that make Spring development much easier.
- Spring Boot contains all of the modules of spring framework such as Web (MVC), JDBC, Security, Batch, and so on with some additional features and integrated tomcat server.
From the below figure, you can see that Spring Boot is built on top of the Spring Framework, with all of the modules of spring such as Web (MVC), JDBC, Security, Batch, with addition of Embedded Tomcat server. Also there is no need of XML configurations, it is done by framework itself.
Spring Boot does not compete with the Spring or Spring MVC Framework. It makes it easy to use them in the Spring application.
Why Spring Boot is so popular ?
- Spring Boot is an amazing tool that helps you to get enterprise-grade applications up and running quickly without having to worry about configuring your application.
- Reduces development time and increases the overall productivity of the developers.
- Avoids writing lots of boilerplate code, annotations, and XML configuration.
- Makes it easier for developers to create and test Java-based applications by providing a default setup for unit and integration tests.
- It comes with embedded HTTP servers like Tomcat or Jetty to test web applications.
- Spring allows you to easily connect with database and queue services like Oracle, PostgreSQL, MySQL, MongoDB, Redis, Solr, ElasticSearch, Rabbit MQ, ActiveMQ, and many more.
Need of Spring Boot
Prior to Spring, Java developers relied on traditional Java EE to create their applications. This led to three main problems:
- Writing code became more and more complex, as developers had to create countless XML files and work with several different types of configurations.
- Working with Components was frustrating, as developers had to hard-code all the dependencies each component required.
- All of Java EE's features needed to be configued. This led to very bloated code that slowed down applications.
Goals of Spring Boot
The main goal of Spring Boot Framework is to reduce Development, Unit Test and Integration Test time and to ease the development of Production ready web applications very easily compared to existing Spring Framework, which really takes more time. Other goals include :
- To avoid XML Configuration completely
- To avoid defining more Annotation Configuration(It combined some existing Spring Framework Annotations to a simple and single Annotation)
- To avoid writing lots of import statements
- To provide some defaults to quick start new projects within no time.
- To provide Opinionated Development approach.