N-tier architecture
N-tier
architecture separates an application into logical layers
and physical tiers
.
A tier
refers to a distinct physical layer or group of servers within an application.
Tiers are not just conceptual; they are physically separated, often running on different machines
or in different parts of a network.
While layers
describe the logical organization of an application's components, tiers
emphasize the physical distribution and deployment of those components.
A layer is a logically separated part of the application.
Example
Traditional web applications have 3 tiers: Presentation Tier
, Business Tier
, and Data Access Tier
.
Presentation Tier
running in web servers, responsible for the user interface.
Application Tier
running on application servers, handling business logic and data processing.
Data Tier
running on database servers, responsible for data storage and retrieval.
More complex applications can have more than three tier.
Each Tier can be split into layers. For example, the Application Tier
is split into 3 logical layers the Presentation Layer
, the Business Layer
, and the Data Access Layer
.
Presentation Layer
is responsible for all user interactions with the application. It's the "face" of the system.
Business Layer
contains the core business rules, logic, and processes of the application. It acts as an intermediary between the Presentation Layer and the Data Access Layer.
Data Access Layer
handles all interactions with the underlying data storage (usually a database).