Simplest form of software architecture, dividing software into horizontal layers.
- Presentation Layer (User interfaces)
- Business Logic Layer (Application logic)
- Data Access Layer (Database interactions)
Presentation → Business Logic → Data Access
An online store can use a layered structure:
- Presentation Layer: Product pages, cart screen, and checkout form.
- Business Logic Layer: Pricing rules, discount validation, stock checks, and order processing.
- Data Access Layer: Queries for products, customers, inventory, and orders.
When a customer places an order, the UI sends the request to the business layer, which validates the order and then uses the data layer to save it.
- Easy to understand, widespread usage.
- Simple separation of concerns.
- Tends toward tight coupling.
- Harder to change foundational layers later.
- Simple CRUD applications.
- Small to medium-sized web apps.