Book Deep Read · Fundamentals of Software Architecture · Chapter 17
Fundamentals of Software Architecture · Ch 17 · Mark Richards & Neal Ford · 2020
When you open a shopping app, place an order, pay, and track the parcel, there are probably dozens or hundreds of small, separate programs passing the job along behind the scenes. That approach is called "microservices." It has been the hottest architecture word of the past decade, and also the most misused. This chapter explains what it really is, how finely to cut it, and the few things that make it hard.
An old-style system is like a department store: every counter shares one warehouse and one ledger, and rearranging one counter means closing the whole building for stocktaking. Microservices are like a street of independent shops: the bakery, the pharmacy and the bookshop each have their own storeroom and their own books, and when one renovates, the neighbors stay open.
The previous chapter showed an older approach that wanted "one set of parts for the whole company," and every part ended up tied to every department. Microservices flip the idea: rather than share, keep your own copy. Two shops both need customer addresses? Each keeps its own, even if that means repeating work.
Each shop handles exactly one line of business, from counter to storeroom, and nobody else is allowed into its storeroom to read its books; you ask at the door. Chores every shop needs, like security guards and bookkeepers, come from one shared property-management company that stations staff in each shop, so the house rules are the same everywhere while the business stays separate.
The hardest part is a job that needs several shops at once, like "place an order," which must take stock, collect money and arrange delivery. In the department store, one ledger entry does it. On the street, you visit shops one by one, and if one fails midway, you have to go back to each earlier shop and undo what it did.
The win is speed of change and resilience: one shop has trouble, the rest of the street stays open; whichever shop gets busy can hire on its own. The cost is just as real: running errands between shops is far slower than shouting across one building, and managing a whole street is much more work than managing one store.
Microservices = a street of independent shops: each does one thing, owns its storeroom, and never reads another's books; you trade duplication for independence, and pay in slower errands and harder management.
Want to see what a "bounded context" really is, the three tests for how fine to cut services, why the book says "don't do transactions in microservices," choreography versus orchestration, and the star ratings? → Switch to Deep
You think the point of microservices is "micro," but the book quotes Martin Fowler bluntly: the term "microservice" is a label, not a description. The real driving idea of microservices architecture is the bounded context from domain-driven design: each service fully owns one slice of the business and its data, and duplication is preferred to coupling. FoSA Chapter 17 covers its topology, how to set granularity, how data and operations are isolated, and distributed transactions, the hardest hurdle.
The eighth style in Part II, "Architecture Styles," following orchestration-driven SOA (Chapter 16) and leading into "Choosing the Appropriate Architecture Style" (Chapter 18). It is the style in the book that pushes domain partitioning plus distribution the furthest; real-world counterparts are internet systems like Amazon and Netflix, split into hundreds or thousands of services.
The previous chapter's SOA traded "enterprise reuse" for global coupling: a shared Customer service had to hold every division's needs, so changing one field meant several departments testing and releasing together. At scale, the expensive thing is no longer machines, it is coordination.
Microservices aim at exactly that: how, in an engineering organization of hundreds, can each small team change, test and release its own piece independently, and keep a failure or traffic spike in one piece from dragging down the rest? The cost of not solving it is concrete: releases ride a "train," a big version ships every few weeks, and one module's bug can stop the whole train.
The book also notes the timing: by the time Lewis and Fowler named the style in 2014, DevOps, automated deployment and containers had matured. Only once operations got cheaper did "split into many pieces" become affordable.
The topology is simple: a set of single-purpose services, each in its own process (usually its own container), with an optional API layer in front. The key is inside each box: the service carries its own database, and nobody else may touch it directly.
A bounded context is a DDD idea: each service models one domain or workflow and contains everything it needs, including classes, subcomponents and database schemas. It does not depend on anything outside that context.
This clashes head-on with reuse. The book's example: several services need an Address class. Traditionally you would extract a shared library and inherit or compose it; in microservices, architects usually prefer each service to keep its own copy. Once it is shared, changing the address class means retesting and redeploying every service, and you are back at the previous chapter's Customer service. The principle: prefer duplication to coupling.
It also enables heterogeneity: since services do not depend on each other's implementation, each team can pick the best language or database, say a graph database for one service and a relational one for another.
The book says the most common mistake is making services too fine-grained, which then forces lots of inter-service communication just to get work done. The "micro" in the name misleads many. It offers three guidelines for finding boundaries:
And one very practical line: iteration is the only way to ensure good service design. Few people cut it right the first time; you merge and split as you go.
Bounded contexts demand isolated data too: no shared "integration database" across services, or changing one table drags in every service again. Each service owns its data and picks a store that suits it. Each piece of information needs a single source of truth; other services ask it through its interface, or keep a copy via replication or caching.
The price: data that one SQL join used to fetch may now take several service calls stitched together, and consistency the database used to guard is now yours to design.
You can put an API layer (such as an API gateway) in front, but the book warns it should only proxy, route and name, and never grow into the logic-stuffed orchestration hub of the last chapter, or you have invited the ESB back.
What about monitoring, logging and circuit breakers (cutting off calls to a downstream that keeps failing, to stop cascades), which every service needs? The book's answer is to separate operational concerns from domain concerns: operational capabilities live in a sidecar component attached to each service, owned by a shared infrastructure team, and the sidecars connect into a service mesh managed from one control plane. Don't reuse the business, do reuse the operations: a precise refinement of "prefer duplication to coupling."
Services can call each other synchronously or exchange messages asynchronously. A cross-service workflow can be coordinated two ways: choreography (dancers each moving to the beat, no conductor) and orchestration (a conductor decides who goes when). Microservices prefer choreography, since there is no central node and coupling is lowest, but this is not absolute.
The book's example is a customer request that needs several services. Under pure choreography, the first service called (say, Customer) has to double as coordinator, becoming more coupled and muddier in purpose; the alternative is a dedicated local service that coordinates only this workflow. Both carry coupling, just in different places, which is the book's refrain: no free choices, only trade-offs.
Here the book is emphatic: don't do transactions in microservices; fix granularity instead. Architects often try to carry monolith-era transactions straight over, but once one business action spans several services, the database's ACID is gone.
When you really need it, the common pattern is a saga: one service acts as coordinator and calls the others in turn; if a step fails, it issues a compensating transaction (a reverse operation that undoes an earlier change) to each completed step. Meanwhile data sits in a "pending" state, and other requests may read intermediate values.
The book's stance: a few sagas are acceptable; if cross-service transactions are the norm, your granularity is wrong, and things that always change together belong back in one service.
Table 1 · The chapter's core trade-offs
| Decision | Option A | Option B | The book's lean, and the cost |
|---|---|---|---|
| Shared code | Extract a shared library | Each service keeps its own copy | Leans B: duplication over coupling; cost is maintaining the same logic in several places |
| Granularity | Fine: one entity per service | Coarse: one workflow per service | Decide by purpose, transactions, chattiness; too fine is the most common error |
| Data | Shared integration database | Database per service | Must be B; cost: joins become service calls, consistency is on you |
| Workflow | Choreography: no center | Orchestration: local mediator | Prefer choreography; use a local mediator for complex flows or error handling |
| Cross-service consistency | Saga + compensation | Merge services, back to a local transaction | A few sagas are fine; routine sagas mean wrong granularity |
Table 2 · The book's star ratings (5 is best)
| Strengths | Middle | Weaknesses |
|---|---|---|
| Scalability, elasticity, evolvability, modularity 5 stars; deployability, testability, fault tolerance, reliability 4 | Architecture quanta: one to many, usually one per service | Performance 2; simplicity and overall cost 1 |
How to read it: microservices push independent change and independent scaling to the limit, and bill the cost to performance and money. The performance hit is concrete: an in-process call of nanoseconds to microseconds becomes a network call, typically milliseconds, and each endpoint also runs a security check; chain five or six services in one request and the latency stacks up. The book's advice: right-size granularity to shorten call chains, and use caching and replication to cut cross-service reads.
So it fits when domain boundaries are clear, teams are many, load differs widely across parts (product browsing may be tens of times the order traffic), and independent releases are frequent. It fits poorly for small teams, domains not yet understood, transaction-heavy systems, or latency-critical paths; there, Chapter 13's service-based architecture is often more pragmatic.
It is the most-asked style in interviews and architecture reviews over the past decade, and the most misused. The chapter's value is in giving tests rather than slogans. Public sources show both sides clearly:
In a review, ask directly: do these services always change together? Do two services read the same table? How many services does one user request chain through, and does the P99 latency budget allow it? In an interview, asked "how would you split into microservices," you can say: "Split by bounded context, using purpose, transactions and chattiness as tests; isolate data per service; put operational concerns in sidecars; avoid cross-service transactions by adjusting granularity, and use sagas with compensation when unavoidable."
① The driving idea is DDD's bounded context: a service fully owns one slice of the business and its data; "micro" is a label, not a description.
② Core principle: prefer duplication to coupling, even for a class like Address.
③ Three granularity tests: purpose, transactions, chattiness; too fine is the most common error, and iteration is the only guarantee.
④ Data isolation: no shared integration database; each piece of information has one source of truth.
⑤ The API layer only proxies and routes, no business logic; operational reuse goes to sidecars and a service mesh.
⑥ Coordination prefers choreography, with local orchestration for complex flows; both have coupling, just placed differently.
⑦ Don't do transactions in microservices: sagas with compensation work, but if they are routine, granularity is wrong.
⑧ Ratings: scalability, elasticity, evolvability, modularity 5 stars; performance 2; simplicity and cost 1.
⑨ Interview line: "Split by bounded context, isolate data, put operations in sidecars, avoid cross-service transactions by fixing granularity."