presentation → application → data
Layered architecture
The application is split into horizontal layers — usually presentation, business logic, and data access — and each layer calls only the one below it. It is the default shape of most web frameworks and the easiest to explain: a request enters at the top, and dependencies point down toward the database.
Each layer calls only the layer below it.
Use it for
- Applications whose main job is moving data between a UI and a database: back offices, internal tools, CRUD-heavy products.
- A starting point while the domain is not yet understood well enough to draw better boundaries.
Watch for
- Rules leak upward into controllers or downward into SQL, and the middle layer becomes a pass-through that only forwards calls.
- The business layer depends on the data layer, so the rules cannot be tested without a database and change whenever the schema does. Hexagonal architecture exists to reverse that arrow.
- Layers cut across every feature. One feature change touches every layer, and teams split by layer hand work to each other on every ticket.
app/
routes/ // presentation: parse input, render output
services/ // rules: orderService.place()
repositories/ // data access: orderRepository.insert()
// routes → services → repositories → database, never upward