There are several layers to consider when designing a web application. These include:
Presentation layer: This is the user interface of the web application, and it is responsible for displaying information to the user and allowing the user to interact with the application.
Business logic layer: This layer contains the logic for handling business rules and processes. It is responsible for handling tasks such as data validation, calculation, and manipulation.
Data access layer: This layer is responsible for accessing data from the database or other data sources and providing it to the business logic layer.
Data storage layer: This layer is responsible for storing data in a persistent manner, such as in a database or file system.
It is important to design these layers separately, as it allows for easier maintenance and modification of the application.
Three-layer web application design
In a three-layer web application, there is physical separation between the presentation,
application, and data layer, which is described as follows:
Presentation layer:
This is the server that receives the client connections and is
the exit point through which the response is sent back to the client. It is the
frontend of the application. The presentation layer is critical to the web
application, as it is the interface between the user and the rest of the application.
The data received at the presentation layer is passed to the components in the
application layer for processing. The output received is formatted using HTML,
and it is displayed on the web client of the user. Apache and nginx are open
source software programs, and Microsoft IIS is commercial software that is
deployed in the presentation layer.
Application layer:
Data access layer
The actual storage and the data repository works at the data
access layer web application design. When a client requires data or sends data for storage, it is passed
down by the application layer to the data access layer for persistent storage. The
components working at this layer are responsible for maintaining the data and
keeping its integrity and availability. They are also responsible for managing
concurrent connections from the application layer. MySQL and Microsoft SQL
are two of the most commonly used technologies that work at this layer.