The Classic Three-Tier Architecture
What you'll learn: How the three-tier architecture organizes systems into presentation, business logic, and data access layers to separate concerns and responsibilities.
The Three Fundamental Layers
The classic three-tier architecture divides your application into three distinct horizontal layers, each with a specific responsibility:
1. Presentation Layer (Top Tier)
This is where users interact with your system. It handles the user interface, displays data, captures user input, and translates user actions into requests for the layers below. Think of it as the "face" of your application—whether that's a web page, mobile app, or desktop interface.
2. Business Logic Layer (Middle Tier)
This is the brain of your application. It contains all the rules, workflows, calculations, and decision-making logic that define what your application actually does. When a user submits an order, this layer validates it, calculates totals, applies discounts, and orchestrates the entire process.
3. Data Access Layer (Bottom Tier)
This layer manages all interactions with your database or data storage. It handles queries, updates, and data persistence, shielding the business logic from the specifics of how data is stored or retrieved.
The Flow and Separation
Requests flow downward: Presentation → Business Logic → Data Access. Responses flow upward. Each layer only communicates with its immediate neighbor, creating clear boundaries.
Think of a restaurant: the dining room (presentation) takes orders from customers, the kitchen (business logic) prepares meals according to recipes and rules, and the pantry/storage (data access) provides ingredients. Each area has distinct responsibilities and doesn't need to know the internal details of the others.
This separation makes each layer independently modifiable—you can redesign your UI without touching business rules, or swap databases without changing your application logic.
Key Takeaway: The three-tier architecture separates presentation, business logic, and data access into distinct layers, creating maintainable systems where each tier has a single, clear responsibility and communicates only with adjacent tiers.