Skip to main content

Command Palette

Search for a command to run...

N-tier architecture

Updated
1 min read

Screenshot 2022-10-26 at 12.16.30 PM.png This is one of the first architectures I've learned when using spring The first layer is the front end framework. This layer can be any framework that is desired. I personally use angular, since it is the framework I code the most in.

The next layer is the controller layer. The controller layer determines what services to call in order to get the needed data for the front end.

The next layer is the service layer. Service layer deals with the business logic and how which repository functions to call in order to obtain the correct data.

Finally the last layer is the repository layer. This layer is an interface that connects the spring boot application with a database of your choice. An interface is basically a class that contains methods/properties that must be implemented in our program. In java, interfaces are used to connect with third party applications/API.

Benefits: Scalable (decoupling , and easily swap out databases) , Reusable (layers), and maintainable.

Drawbacks: latency( due to the number of layers) this can increase latency if a layer is bogged down. Complexity. If more layers are added can be more complicated.

Screenshot 2022-10-26 at 12.31.23 PM.png