Book Deep Read · Fundamentals of Software Architecture · Chapter 13
Fundamentals of Software Architecture · Ch 13 · Mark Richards & Neal Ford · 2020
Picture a mid-sized company: orders, inventory, shipping and accounting all live in one piece of software. It keeps growing, and now changing one line of accounting code means stopping the whole system and releasing it again. Everyone has heard that "microservices" are the fashion: split it into hundreds of little programs. But the team is twenty or thirty people, and they could never keep hundreds of programs running. This chapter is about the road in between: split it into just a few big pieces. The book calls it service-based architecture.
Before, one big kitchen cooked everything, and if one stove broke the whole restaurant stopped. Now there are four or five stations: cold dishes, hot dishes, noodles, desserts. Each has its own cooks and opens and closes on its own; if the noodle station is being renovated, hot dishes still go out. But they all still share one big walk-in fridge. The ingredients sit in one place, so no station needs its own fridge or someone running back and forth moving food around.
With one big kitchen, every change touched everything. But go to the other extreme, one tiny kitchen and one fridge per dish, and just keeping track of "who has this piece of meat right now" wears everyone out. A customer orders a full table, a dozen kitchens have to check with each other, one of them slips, and the bill no longer adds up.
It comes down to three things. A few big stations: split by line of business, usually four to a dozen, each able to open and be upgraded on its own. One front counter: customers only talk to the counter, which passes each order to the right station. One shared fridge: every station takes from the same place, so a single order can be handled start to finish inside one station. Either all of it happens or all of it is undone, never the half-done "money taken, food never served".
The fridge gets divided too: the shelves everyone uses are off-limits for casual changes, and each station looks after its own shelves.
You get most of what microservices promise (change one piece, release one piece; one piece breaks, the rest carry on) while dodging the most expensive part. Plenty of companies stop here and are happy. The price: because each station is big, changing one thing means checking the whole station, and rearranging the shared fridge forces several stations to adjust.
Service-based architecture = a few big services cut by business area + one shared database: you get independent releases and failure isolation, and keep "one job, done in one go" simple.
Want the topology and its variants, how each service is layered inside, federated entity libraries for the shared database, the book's full electronics-recycling example, and the star ratings against microservices? → Switch to Deep
You might think that leaving a monolith means splitting all the way down to microservices. In fact most teams need the stop in between: 4 to 12 coarse-grained domain services, each deployed on its own, with one user interface in front and one shared database behind. FoSA Chapter 13 calls it one of the most pragmatic architecture styles. You get the deployability and fault isolation of a distributed system, and because the services are coarse enough you keep ACID transactions inside each service instead of wrestling with distributed transactions from day one.
In Part II, "Architecture Styles", right after the three monolithic styles (layered, pipeline, microkernel). It is the book's first distributed style and the reference point for event-driven, space-based, SOA and microservices (Chapters 14 to 17). Real-world match: line-of-business systems at mid-sized companies, and the first step out of a monolith.
Chapters 10 to 12 covered the monolith's pain: one deployment unit, so any change means a full test run and a full release, one memory leak takes down everything, and scaling means copying the whole thing. Chapter 9 listed the price of going distributed: the eight fallacies, network latency, distributed transactions.
Microservices push that trade-off to the extreme: dozens or hundreds of fine-grained services, each owning its data. For a 20-person team building a business system without extreme traffic, that means standing up service discovery, distributed tracing, container orchestration and saga compensation before writing any business logic. The infrastructure complexity arrives before the business value does.
The chapter's question: is there a distributed shape where you only pay for the distribution you actually need? The book's answer is to cut the application into a small number of large, domain-aligned, separately deployed services, and leave the database in one piece for now.
The book describes the basic form as a distributed macro-layered structure: a separately deployed user interface, a set of remote coarse-grained services, and a monolithic database. There are usually 4 to 12 services, about 7 on average. Each is an independently deployed part of the application, and the book calls them domain services.
The UI calls the services remotely over REST, messaging, RPC or SOAP. Typically each service runs as a single instance. If one needs to scale or be more fault tolerant you can run several instances, but then you need load balancing between the UI and the service.
The book draws three common variants: split the UI (several interfaces by domain, such as a customer-facing one and an internal back office), split the database (into several by domain, when the services' data is independent enough), and add an API layer (a reverse proxy or gateway between UI and services, useful when exposing services to external systems or handling cross-cutting concerns such as security and metrics in one place).
Because each service owns a whole domain, it is a small application in its own right. The book gives two ways to organise it: technically layered (an API facade layer, a business layer, a persistence layer) or domain-partitioned (internal components by subdomain, such as order placement, payment and inventory update inside the order service).
The API facade layer orchestrates the business request coming from the UI: the UI sends one "place order", and the facade calls placement, payment and inventory update inside the service. Compare microservices, where the same request often needs the UI or some coordinator to orchestrate three separately deployed services.
That gives the chapter's most important benefit: ACID transactions still work inside a service. If payment fails while placing an order, one database transaction rolls back. In microservices you write compensation logic; as the book puts it, highly distributed styles must rely on BASE (basic availability, soft state, eventual consistency). The cost runs the other way: the coarser the service, the larger the test scope for any change, and the higher the deployment risk. Touch the payment logic and the whole order service needs regression testing and a fresh release.
The biggest headache of a shared database is changing tables. In the book, services reach the database through entity objects in a shared library. With one big shared library, any table change forces every service to update code, retest and redeploy, even though most of them never touch that table.
The book's fix is to logically partition the database by domain and pair it with a set of federated shared libraries: a common entity library (named common_entities_lib in the book) for tables every service uses, plus one entity library per domain (customer, invoicing, order and so on). A change to a domain table only affects services that use that library. Changes to the common tables are locked down and go through the database team, because they ripple into every service. The book's advice: make the logical partitions as fine-grained as possible while keeping the data domains well defined.
The book reuses the electronics-recycling business from Chapter 12. Customer-facing services are Quoting (customers ask for a price) and Item Status (track progress); internal services include Receiving, Assessment, Recycling, Accounting and Reporting. The two groups get two UIs and two physically separate databases, with the internal side in its own network zone.
Each service makes its own trade-offs: the customer-facing ones must handle traffic and scale; assessment rules change often, so as a separate service they can change without redeploying anything else; if an internal service goes down, customers can still get quotes. That is the chapter's point in practice: you can split services and split databases independently, each according to the characteristics you need.
Service-based architecture is domain-partitioned. It usually has one architecture quantum (the shared UI and database bind the services together), and can have more than one when the UI and database are also split by domain. Ratings: deployability, testability, reliability, fault tolerance and modularity 4 stars; overall cost 4 stars; simplicity, scalability, evolvability and performance 3 stars; elasticity 2 stars. Why:
Table 1 · Three stops from monolith to microservices (stars are the book's ratings; the microservices column is from Chapter 17)
| Dimension | Layered monolith (Ch 10) | Service-based (this chapter) | Microservices (Ch 17) |
|---|---|---|---|
| Services · granularity | 1 deployment unit | 4–12, domain-sized | Dozens to hundreds, fine-grained |
| Data | One database | Usually one shared database, can split by domain | Each service owns its data |
| Transactions | ACID | ACID within a service | Sagas / eventual consistency across services |
| Cost · simplicity | 5 · 5 | 4 · 3 | 1 · 1 |
| Deployability · fault tolerance | 1 · 1 | 4 · 4 | 4 · 4 |
| Scalability · elasticity | 1 · 1 | 3 · 2 | 5 · 5 |
| Price | Any change ships everything | A change tests a whole service; shared-table changes need coordination | All the complexity of operations and distributed data |
Table 2 · Three ways to manage the shared database (from the book + this page's summary)
| Approach | What you get | What it costs |
|---|---|---|
| One big shared entity library | Simplest | Any table change means redeploying every service |
| Logical partitions + federated libraries | A table change only reaches services that use it | Partition boundaries to maintain; common-table changes need approval |
| Physically separate databases by domain | Real data isolation; more than one quantum | Cross-domain queries and consistency get harder, heading toward microservice complexity |
The test in one sentence: do you need independent deployment and fault isolation, but not extreme elasticity, and can you not afford the cost of distributed data? Then stop here. The book also notes it fits domain-driven design (DDD) naturally: one domain service per business domain, without agonising over fine-grained boundaries. Conversely, if one domain really does face second-by-second traffic bursts, split just that one finer; there is no need to turn everything into microservices.
Neither case is literally a service-based architecture, but both make the same point: every extra service boundary adds a network call and something more to operate, and that bill should be counted first. In an architecture review, ask three things: how many services does a typical request cross? How many services must redeploy when one shared table changes? Which service truly needs to scale elastically on its own? In an interview, asked "why not go straight to microservices?", answer: "Cut 4–12 domain services over a shared database and keep ACID within each; when one domain really needs its own scaling or team independence, split just that one finer."
① Service-based = separate UI + 4–12 (about 7 on average) coarse-grained domain services + a usually shared monolithic database; the book's first distributed style.
② Three variants: split the UI by domain, split the database by domain, add an API layer / reverse proxy between UI and services.
③ Inside, services are technically layered (API facade / business / persistence) or partitioned by subdomain; the facade orchestrates requests.
④ Biggest benefit: coarse services keep ACID within a service, with no saga compensation from day one.
⑤ Biggest cost: one change tests the whole service; shared-table changes ripple across services.
⑥ Logically partition the database by domain with federated shared libraries; the common entity library is locked down; make partitions as fine as data domains allow.
⑦ Ratings: deployability, testability, reliability, fault tolerance, modularity, cost 4 stars; scalability, performance, simplicity, evolvability 3; elasticity 2.
⑧ A natural fit for DDD; usually one quantum, more when UI and database are split by domain.
⑨ Evidence: Segment merged over a hundred fine-grained services back into one; Prime Video cut cost by over 90% by moving into one process.
⑩ Interview line: "Cut a few big domain services over a shared database to keep ACID; split finer only where elasticity is truly needed."