Book Deep Read · Fundamentals of Software Architecture · Chapter 10
Fundamentals of Software Architecture · Ch 10 · Mark Richards & Neal Ford · 2020
The expense form on your company intranet, a university course-registration site, the order back-office of a small online shop: the software behind them almost always has the same shape, one layer stacked on another. On top is the screen you see; below it are the rules ("can this expense be approved?"); below that, a layer that fetches and saves data; at the bottom, the database. This chapter is about that most common, cheapest shape: why everyone reaches for it, and when it starts holding you back.
Picture a building. The ground floor is reception and only greets visitors. The second floor is the business department and only makes decisions. The third floor is the records room and only opens filing cabinets. A visitor's request has to be passed up one floor at a time; reception may not barge into the records room. The upside: clean division of labor. If the records room buys new cabinets, reception never needs to know. The downside: even if the visitor only asks "what's my file number?", reception still hands it to the business floor, which does nothing and passes it straight up. The more floors, the more wasted trips.
Many teams never think about "shape" at first. They just start coding: screens query the database directly, rules are scattered everywhere, and it all ends up in a tangle. Layering is the most natural first cleanup: sort code by the kind of job it does. Screens with screens, rules with rules, data access with data access. It also matches how companies already split people (front-end team, back-end team, database team), so almost nobody has to be taught it.
The real point of layering isn't how many layers you have. It's the gate: each layer may only call the one directly below it, with no skipping. That way, as long as the hand-off between two layers stays the same, one layer can change its insides and nobody else notices. That's the new filing cabinets again: reception doesn't feel a thing. Sometimes you deliberately open a side door. Small shared helpers that everyone uses, like "stamp it" or "write it in the log", can live on their own floor, and the business floor is allowed to walk past it straight to the records room instead of getting an extra stamp on every errand.
Watch out for wasted trips. If most requests are simply handed along at every floor with no rule applied anywhere, the book has a name for it: a sinkhole. Water flows from top to bottom and nothing filters it on the way. A few such requests are fine. If most requests look like that, the building itself is the wrong design for you.
Layering fits best when the system is small and simple, the budget and schedule are tight, or you don't yet know what you'll end up needing. It's cheap, easy to understand, and you can start today. But it ships as one block: change one word and the whole program is redeployed; to handle more traffic you can only copy the whole thing; if memory blows up in one corner, everything goes down together. There is also a quieter cost: the code for one business area (say, "customers") is chopped up across every layer, so changing one feature means touching every layer.
Layering is one trade per floor. The gates keep floors from disturbing each other; the price is that requests climb floor by floor, business features get sliced apart, and the whole building moves as one. When most requests are just making wasted trips, it's time for a different shape.
Want closed vs open layers and layers of isolation, the sinkhole 80/20 rule, technical vs domain partitioning, the book's star ratings and a selection table? → Switch to Deep Read
You'd think the essence of layered architecture is how many layers. In fact it's which layers are closed. FoSA Chapter 10 takes apart the most common monolithic style: closed layers plus layers of isolation buy separation of concerns and replaceability, at the cost of requests that must walk through every layer, business logic sliced up by technology, and deployment and scaling only as a whole. The test of whether it still fits is the share of sinkhole requests: if most requests merely pass through, you picked the wrong style.
The first chapter of Part II, "Architecture Styles". Chapter 9 split styles into monolithic and distributed; from here the book rates them one by one, starting with the most common and cheapest monolith, followed by pipeline (Ch 11) and microkernel (Ch 12). Real-world counterpart: most internal enterprise systems, early-stage startup products, and the textbook MVC web app.
The book is blunt: the layered style, also called n-tiered, is the de facto standard for most applications because it is simple, familiar and cheap. There's a less flattering reason it's the default: teams that skip architecture and just start coding usually end up with layers anyway, which the book calls the architecture by implication and accidental architecture anti-patterns.
So the question isn't "is layering good?" It's this: since it's almost always the starting point, what does its mechanism give you, what does it take away, and what signal says it's time to leave? Skip that and you get one of two failures. One: a system with clear business boundaries that needs targeted scaling gets forced into layers, and later every feature touches four layers and every release needs full regression. Two: the layers exist only on paper, the presentation layer writes SQL, and the whole thing decays into Chapter 9's big ball of mud.
The typical form has four layers: presentation (UI and browser interaction), business (executing business rules), persistence (talking to the database: SQL, ORM mapping), and database. A small app may have three (business and persistence merged); a large one, five or more. Deployment varies too: database deployed separately with the other three bundled; all four bundled together; even an embedded or in-memory database. Either way, the number of architecture quanta is 1.
The key point is that this is Chapter 8's technical partitioning: components are grouped by kind of technical work, not by business domain. So the "customer" domain is cut into four slices (customer screens, customer rules, customer DAO, customer table) spread across every layer. The upside is that each layer can have its own specialists: front-end engineers stay in presentation, DBAs stay in the database. That fits teams organized by skill, a natural result of Conway's law. The downside: every business requirement is a change across four layers, which is why the book says the style doesn't fit domain-driven design (DDD) well.
Each layer is either closed or open. Closed means that as a request moves down, it may not skip this layer; it must pass through it to reach the next one. Intuitively it would be faster for the presentation layer to query the database directly, skipping two layers. But the book stresses that closing layers gives you layers of isolation: a change in one layer generally doesn't affect the others, as long as the contracts between layers stay the same.
Rewrite the SQL or swap the ORM in the persistence layer, and the presentation layer never notices, because it was never allowed to touch persistence. Conversely, replace the whole UI framework (the book's example is moving from JSF to React) and the business layer stays untouched. That's the real value of closed layers: the blast radius of a change stays inside one layer. If every layer is open and upper layers call down wherever they like, the layers become tightly coupled to each other, one change ripples everywhere, and the layering exists in name only.
The book's example: the business layer often uses shared services such as date and string utilities, auditing and logging. To enforce architecturally that "the presentation layer must not use these", you add a separate services layer below the business layer; because the business layer is closed, presentation can't reach it. But if the services layer were also closed, the business layer would have to pass through it on every trip to persistence, for no reason. So the services layer is marked open: the business layer may use it, or bypass it and go straight to persistence.
The point: which layers are open, which are closed, and why must be written down and communicated to the team. If not, developers will skip layers on instinct, and the system becomes brittle and hard to test and deploy.
The architecture sinkhole is when a request passes through layer after layer and each one just hands it along with no business logic. The book's example: the presentation layer asks for basic customer data (name, address); the business layer neither aggregates nor applies any rule and forwards it to persistence, which runs a simple SQL query and sends the result back the same way. Such requests burn object creation, processing and memory while adding nothing.
The book's test is the 80/20 rule: about 20% of requests being sinkholes is normal; if about 80% are sinkholes, layering isn't the right style for the problem domain. The book mentions another way out, opening every layer to eliminate the pass-throughs, but at the cost of harder change control and losing the layers of isolation.
The book rates every style from 1 to 5 stars. Layered gets 5 stars for overall cost and simplicity (the best); 3 for reliability; 2 for performance and testability; and 1 star for deployability, elasticity, evolvability, fault tolerance, modularity and scalability. Every reason traces back to monolithic deployment:
Table 1 · When to choose layered (book's advice + this page's summary)
| Scenario | Layered a fit? | Reason / cost |
|---|---|---|
| Small, simple apps; internal systems | Yes | 5 stars for cost and simplicity; everyone already knows it |
| Tight budget and schedule | Yes | Fast to start; accept the later migration cost |
| Requirements still unclear | Good starting point | The book calls it a good starting point, but advises minimal reuse and shallow object hierarchies to ease a later move |
| Teams split by skill (UI / backend / DBA) | Yes | Matches Conway's law; domain-aligned teams would coordinate across groups constantly |
| Large, growing systems | No | Maintainability, agility, testability, deployability degrade with size |
| Need targeted scaling / high availability / frequent releases | No | Scalability, elasticity, fault tolerance, deployability all one star |
| ~80% of requests are pass-throughs | Change style | Sinkholes dominate; the layers are pure overhead |
Table 2 · Both monoliths: technical layers vs domain modules
| Dimension | Technical partitioning (layered) | Domain partitioning (modular monolith) |
|---|---|---|
| Top-level split | Presentation / business / persistence | Customer / order / payment |
| One business change touches | Every layer | Mostly one module |
| Swap framework or database | Easy, confined to one layer | Every module changes |
| Team alignment | Grouped by skill | Grouped by business area (cross-functional) |
| Splitting into services later | Hard: domains are sliced apart | Easier: module boundaries are candidate service boundaries |
The rule in one line: will your changes mostly be "swap the technology" or "change the business"? For the former, layers of isolation are worth the most; for the latter, every change cuts across four layers and domain partitioning pays off. The two also combine: layers inside each domain module.
Read together: layering is the default for good reasons (cheap, replaceable parts), but at scale the industry's corrections point the same way: split the top level by domain and push layers inside modules, or invert dependencies so the business core doesn't depend on the database. In an architecture review, ask three questions: which layers are closed, and is that written down? Roughly what share of requests are sinkholes? Over the next year, will change mostly be new technology or new business? In an interview, if asked "what's wrong with layering?", answer: "Technical partitioning slices the business apart, whole-unit deployment hurts deployability and fault tolerance, and once sinkholes pass 80% it's time to switch styles."
① Layered is the de facto default for most apps: simple, familiar, cheap; skip architecture and you'll grow one anyway.
② Topology: presentation / business / persistence / database; many deployment variants, but always one architecture quantum.
③ It's technical partitioning: business domains are sliced vertically across every layer; fits skill-based teams (Conway's law), not DDD.
④ The essence is layers of isolation from closed layers: as long as contracts hold, one layer can change without touching the others.
⑤ Open layers serve shared services: usable or skippable; which layers are open, and why, must be written down.
⑥ Sinkhole: requests pass through layers doing nothing; ~20% is normal, ~80% means the wrong style.
⑦ Ratings: 5 stars for cost and simplicity; 1 star for deployability, elasticity, evolvability, fault tolerance, modularity, scalability.
⑧ Good for small systems, tight budgets, and unclear requirements; bad for large growing systems needing targeted scaling or frequent releases.
⑨ Industry fixes: split the top level by domain with layers inside (modular monolith), or invert dependencies (hexagonal).
⑩ Interview line: "Layering trades closed layers for isolation, at the cost of sliced-up business logic and whole-unit deploys; past 80% sinkholes, switch."