Introduction to Spring Boot

Welcome to the Spring Boot tutorial!!!

In this article, we will understand the Spring Boot overview, its features, and its advantages also the difference between Spring MVC & Spring Boot.

As we know, there are multiple modules, sub-modules in Spring Framework. In that, one of the submodules is Spring Boot which helps us to develop applications rapidly. In order to understand Spring Boot, I would recommend you to first go through the concept of Spring Framework. You can check it here Introduction to Spring Framework

What is Spring Boot?

Spring Boot is a sub-module of Spring Framework which helps in the RAD (Rapid Application Development) feature.

While building a web application we have to configure certain things. So the Spring Boot helps us to configure the setup and run faster. It acts as a utility for setting up an application for building web applications. Spring Boot is built on Spring Framework which is used for creating web applications with minimal configuration.

  • Web Applications are created using Spring MVC which again is one of the modules of the spring framework. But, the problem here is that we have to do lots of configuration which can be really time-consuming and tiresome also.
  • So, the solution for this is Spring Boot; It is a sub-module of Spring Framework which provides a rapid production-ready environment.
  • Spring Boot is built on top of Spring Framework so it has all the features of Spring.
  • As we know, when we want to run any application we need to have a Tomcat server or any other server. So, Spring Boot also provides the Embedded Server inside the JAR file. It provides the combination of Spring Framework functionality with Embedded Servers.

Evolution of Spring Boot

  • In 2012, an issue was filed by Mike Youngstrom on Spring Git hub stating that “Improved support for containerless web application architectures“.
  • Then, Mr. Webb,(who was a member of the Spring Team)  decided that rather than fix this as a part of the core framework in Spring, he decided to have a new project called Spring Boot. Hence, in 2013, Spring Boot was made.
  • In April 2014, Spring Boot 1.0 was created followed by different versions.
  • Now, As we are in 2021, the latest version is 2.5.2 which has lots of features and modifications.

Why go for Spring Boot?

Let us discuss some points why should we go for Spring Boot.

  • Now, the developer will not be worried about configuration and he/she can concentrate on the logic part.
  • It will help us to create a production-ready application with minimum confusion.
  • As it is built on Spring so, all the features of the core spring are available in Spring Boot.
  • It makes easy integration of JDBC, JPA, ORM framework, and etc.
  • Many Organizations are using Spring Boot on a large scale.

Features of Spring Boot

Stand-alone Web Application

Spring Boot makes it easy to create a stand-alone application that is production-ready that you can ‘just run’. In this, we use the embedded server available in Spring Boot.

SpringApplication

Spring Boot Application can be bootstrap by using the class called SpringApplication. Just call the run() method to start the application.

public static void main(String[] argss)  
{    
SpringApplication.run(ClassName.class, argss);    
}

Avoid Configuration

Unlike Spring MVC, In Spring Boot everything is auto-configured. No need to write the configurations in the XML file.

Embedded Tomcat Server

No need to explicitly download Tomcat. Spring Boot comes with the embedded servers.

RestAPI

Creation of Rest API is easy in Spring Boot. Just need to add the annotation and that’s all.

Admin Support

Spring Boot provides support for admin-related features. It can be enabled using the spring.application.admin.enabled property.

Logging

It uses Common logging for all internal logging.

Security

As it is developed on top of  Spring so it is secured by default. There are a good amount of Endpoints available to develop a secure Spring Boot application.

Advantages of Spring Boot

There are lots of advantages to using Spring Boot.

  • It helps us to create a stand-alone Spring Application.
  • Provide us an opinionated ‘starter’ dependencies to simply configuration.
  • We don’t need to deploy WAR files as Embedded Servers are there in Spring Boot.
  • It provides production-ready features.
  • It decreases cost and reduces development time.

Difference between Spring MVC & Spring Boot

Spring MVC

Spring Boot

Spring MVC is a framework that follows the Model-View-Controller design pattern. Spring Boot is created to avoid the XML configuration and get started quickly with the java applications.
The developer has to configure manually Configuration is automatic in Spring Boot
It takes more time It reduces development time
The deployment descriptor is required Deployment Descriptor is not required
Does not come with Embedded servers It comes with Embedded Servers.
It is used for creating web applications If you want a production-ready environment so then use Spring Boot.

Thus, this was all about Spring Boot Introduction in detail. In the next article of this tutorial, we will understand the Architecture of Spring Boot.