Three-tier architecture
corebeginnerThree-tier architecture splits a system into a client (what the user interacts with), an application tier (business logic), and a database tier (persistent storage) — each tier only talks to its immediate neighbor.
Think of it as
Think of a restaurant: the client is the dining room where a customer places an order, the application tier is the kitchen that turns the order into food using business rules (recipes), and the database tier is the pantry storing raw ingredients. The customer never walks into the pantry directly — every request passes through the kitchen, which is what lets the pantry's organization change without the customer noticing. Each tier can scale, deploy and fail independently of the others.
What we're doing: Trace one request through all three tiers and show what would break if the client bypassed the application tier.
- 3
- The client only ever talks to the application tier — it has no direct database access.
- 4
- Business rules (the discount, the validation) live in the application tier, not the client or the database.
- 9
- Bypassing the application tier would also bypass every rule it enforces — this is exactly why the tiers are kept separate.
Why this works: Separating tiers keeps business logic in one place, lets the database evolve (schema changes, a new storage engine) without touching client code, and lets each tier scale independently — more application servers for compute-heavy logic, a bigger database for storage-heavy load.
Letting the client query the database directly, skipping the application tier
Wrong
Better
What you see: Business rules meant to apply to every order (auth checks, filtering, pricing logic) get silently skipped whenever a client queries storage directly, and the database schema can no longer change without breaking every client that queries it.
Why: A client with direct database access bypasses every rule the application tier is meant to enforce, and couples every client permanently to the current database schema — exactly the coupling the three-tier split exists to prevent.
- Client — browser, mobile app
- leads to Application (request)
- Application — business logic, validation
- leads to Database (query)
- leads to Client (response)
- Database — persistent storage
- leads to Application (result)
The three tiers
Together
Remember: Client (presentation) → application (business logic) → database (storage) — each tier only talks to its immediate neighbor.
See also: layered architecture · pattern tradeoffs

