Spring Boot – Architecture
Last Updated :
11 Mar, 2022
The Spring Boot is built on top of the core Spring framework. It is a simplified and automated version of the spring framework. The spring boot follows a layered architecture in which each layer communicates to other layers(Above or below in hierarchical order). The spring boot documentation provides the following definition to the Spring Boot Framework.
Spring Boot makes it easy to create stand-alone, production-grade Spring based application that you can “Just Run”
The main aim of spring boot is to remove the XML and annotations-based configuration settings from the application. Along with this spring boot provides the following benefits such as opinionated(options to later change the configuration), convention over configuration, stand-alone, and production-ready.
Spring Boot Layers
The spring boot consists of the following four layers:
- Presentation Layer – Authentication & Json Translation
- Business Layer – Business Logic, Validation & Authorization
- Persistence Layer – Storage Logic
- Database Layer – Actual Database
Fig 1 – Layers Of Spring Boot
1. Presentation Layer
The presentation layer is the top layer of the spring boot architecture. It consists of Views. i.e., the front-end part of the application. It handles the HTTP requests and performs authentication. It is responsible for converting the JSON field’s parameter to Java Objects and vice-versa. Once it performs the authentication of the request it passes it to the next layer. i.e., the business layer.
2. Business Layer
The business layer contains all the business logic. It consists of services classes. It is responsible for validation and authorization.
3. Persistence Layer
The persistence layer contains all the database storage logic. It is responsible for converting business objects to the database row and vice-versa.
4. Database Layer
The database layer contains all the databases such as MySql, MongoDB, etc. This layer can contain multiple databases. It is responsible for performing the CRUD operations.
Spring Boot Flow Architecture
Fig 2 – Spring boot flow architecture
Explanation:
- The Client makes an HTTP request(GET, PUT, POST, etc.)
- The HTTP request is forwarded to the Controller. The controller maps the request. It processes the handles and calls the server logic.
- The business logic is performed in the Service layer. The spring boot performs all the logic over the data of the database which is mapped to the spring boot model class through Java Persistence Library(JPA).
- The JSP page is returned as Response from the controller.
Previous
Spring Boot - Annotations
Next
Spring Boot Actuator
Share your thoughts in the comments
Please Login to comment...
Similar Reads
Difference Between Spring Boot Starter Web and Spring Boot Starter Tomcat
Spring Boot - Spring JDBC vs Spring Data JDBC
Spring vs Spring Boot vs Spring MVC
Java Spring Boot Microservices - Develop API Gateway Using Spring Cloud Gateway
Spring Boot | How to access database using Spring Data JPA
How to Create a Spring Boot Project in Spring Initializr and Run it in IntelliJ IDEA?
How to Create and Setup Spring Boot Project in Spring Tool Suite?
How to Run Your First Spring Boot Application in Spring Tool Suite?
How to Make a Project Using Spring Boot, MySQL, Spring Data JPA, and Maven?
Java Spring Boot Microservices – Integration of Eureka and Spring Cloud Gateway