Why separate layers
Splitting the app to layers help maintain, decouple, and scale.
What is it
Most popular implementation of multi-tier architecture:
- presentation tier (client)
- logic tier (server)
- data tier (database)
Layers
Presentation Layer
Handles the user interface and user interactions, presenting information to users and capturing user input
Business-Logic Layer
Intermediate between Presentation
and Data Access
layers.
This layer handles business logic, business rule, and calculations.
- Defines how data from the database can be retrieved and used, what it can perform, and cannot perform.
- Repsonsible for processing and manipulating data before it is presented to the user or stored in the database.
- Run validation to ensure that data meets business rules and constraints.
- Enforce business rules and policies like access control, authorization, and authentication.
Database Layer
Stores, maintains, and manages data structurally and organizationally
Layers
Presentation Tier
Interacts with the user and the business layer
- UI and user interactions
- Presenting information to users and capturing input
Business Logic Tier
Store/retrieve Data
Performs further processing
Pass result to the presentation layer
Respond to user requests