Skip to main content
Article

Spring Boot Architecture Overview

Spring Boot is built on the core Spring framework.This is a simplified and automated version of the Spring framework.Spring Boot follows a layered architecture in which each layer communicates with the other layers in hierarchical order.

2 min read
javaspring-boot
javaspring-boot

Spring Boot is built on the core of the Spring framework.This is a simplified and automated version of the Spring framework.Spring Boot follows a layered architecture in which each layer communicates with the other layers in hierarchical order.

Spring Boot Layers

Spring Boot consists of the following four layers:

  1. Presentation Layer – Authentication
  2. Business layer – Business logic, validation and authorization
  3. Persistence layer – Storage logic
  4. Database Layer – Real Database

Spring Boot layers

1. PRESENTATION LAYER

The presentation layer is the top layer of the Spring Boot architecture.It consists of the front part of the application.It manages HTTP requests and performs authentication.It is responsible for converting parameters from JSON fields to Java objects and vice versa.Once it has performed the authentication of the request, it forwards it to the next layer, i.e. the business layer.

2. BUSINESS LAYER

The business layer contains all the business logic.It is made up of classes of services.She 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 into database row and vice versa.

4. DATABASE LAYER

The database layer contains all the databases like MySql, MongoDB, etc.This layer can contain several databases.It is responsible for executing CRUD operations.

Spring Boot – Flow Architecture

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 it and calls server logic.
  • Business logic is executed in the service layer.Spring Boot executes all logic on the database data which is mapped to the Spring Boot model class through the JPA (Jakarta Persistence API)
  • A JSP page (or JSON or XML) is returned as a response by the controller.

Jakarata Persistence API?

The Java Persistence API (JPA), renamed Jakarta Persistence in 2019, is a Java application programming interface specification that describes the management of relational data in applications using Java Platform, Standard Edition, and Enterprise Edition/Jakarta EE.

I hope this article was useful to you.Thanks for reading it.

Find our #autourducode videos on our YouTube channel: https://bit.ly/3IwIK04

ShareXLinkedIn