Book Deep Read · Fundamentals of Software Architecture · Chapter 12
Fundamentals of Software Architecture · Ch 12 · Mark Richards & Neal Ford · 2020
You have probably installed browser extensions: an ad blocker, a translator, a password manager. The browser itself never changes; each extension adds one new trick, and removing it doesn't stop you from browsing. Code editors work the same way: install a plug-in and it suddenly speaks a new language. This chapter is about that shape of software: a small, stable core plus a ring of plug-ins you can add and remove. The book calls it the microkernel architecture, also known as the plug-in architecture.
A kitchen stand mixer does one thing: it spins. Want to knead dough? Attach the dough hook. Whisk eggs? The whisk. Grind meat? The grinder attachment. The attachments don't know each other; each just has to fit the one standard socket on the machine. When the maker releases a new attachment, you keep your old mixer.
Without this, every special case lives in the main program: "if it's this phone model, price it this way; if it's that one, price it that way." A year later there are hundreds of ifs. Touching one might break another, and adding a new phone model means retesting and redeploying the whole program.
There are only four things. The machine does only the main routine that every job goes through. Attachments: one per special case, each minding its own business, never talking to the others. A catalog: the machine keeps a list of which attachments exist and where to find them. A standard socket: every attachment plugs in the same way, so the machine never needs to know how one works inside.
Some attachments can only be swapped with the power off; others can be swapped while it runs. The second kind is handier but needs a fancier machine.
It fits software where the core is fixed but the variations keep changing: browsers, editors, tax software, insurance claims whose rules differ by region. It is cheap, easy to understand, and new variations don't touch old code. The cost: it is usually still one single machine, so you can't add capacity to just the busiest attachment, and if the core goes down everything stops.
Microkernel is a small core + plug-ins + a catalog + a standard socket: lock what changes inside plug-ins, and the core can stay still for years.
Want the two definitions of the core, the three ways to connect plug-ins, registries and contracts, the book's device-recycling and insurance examples, and the star ratings? → Switch to Deep
You think microkernel is something only operating-system kernels talk about; in fact it is the most common shape of product-based software. The core system keeps only minimal functionality or the "happy path"; every customization, special case and new feature goes into independent plug-ins, found through a registry and spoken to through a contract. FoSA Chapter 12 shows it is the only style that can be both technically and domain partitioned; cost gets 5 stars and simplicity 4, but as a monolith it still gets 1 star for scalability, elasticity and fault tolerance.
The third chapter of Part II, "Architecture Styles," after layered (Chapter 10) and pipeline (Chapter 11); it closes out the three monolithic styles, and service-based architecture (Chapter 13) starts the move to distributed. Real-world match: IDEs, browsers, CI servers, and business systems whose rules vary by customer or region.
The book names the natural home right away: product-based applications, software that is packaged, downloaded, deployed as a single monolith and run at the customer's site. They share one hard problem: the core features are stable, but the extensions different users need vary wildly and keep changing.
What happens if you ignore it? The book's example is electronic device recycling: every used phone that comes in needs a different assessment depending on its model. Put it all in the core and you get one enormous conditional; every new model means changing the core, retesting everything and redeploying, and editing one model's rules can break another's. Business apps are no different: insurance claim rules differ by jurisdiction, and the book notes that some states allow a free windshield replacement after rock damage while others do not. Pile thousands of such rules into one rules engine and, in the book's words, you get a big ball of mud of rules.
The style has just two kinds of components. The book gives two definitions of the core system. First, the minimal functionality needed to run the system: Eclipse's core is a basic text editor, and plug-ins turn it into a customizable IDE. Second, the happy path: the general processing flow with little or no custom processing. Moving cyclomatic complexity out of the core and into plug-ins improves the core's extensibility, maintainability and testability.
Internally the core can be organized as a layered architecture or a modular monolith; the presentation layer can be embedded in the core, split out on its own, or even be a microkernel itself.
Plug-ins are standalone, independent components holding specialized processing, additional features and custom code that enhance or extend the core. The book stresses that plug-ins should ideally have no dependencies on each other; otherwise a change in one ripples into another and the whole point of plugging is lost.
There are three ways to connect them. Compile-based plug-ins are the simplest, but adding, changing or removing any one requires redeploying the whole monolith. Runtime-based plug-ins can be added or removed without redeploying the core; the book names OSGi, Penrose and Jigsaw for Java and Prism for .NET as frameworks to manage them. Both are point-to-point: the core calls a method on the plug-in's entry class, and plug-ins live as shared libraries (JAR, DLL, Gem) or namespaces such as app.plugin.<domain>.<context>. The third is remote plug-ins: each one is its own service, called by the core over REST or messaging.
Going remote buys better decoupling, scalability and throughput, runtime changes without OSGi, and asynchronous calls to plug-ins. The book is blunt about the cost: the whole architecture becomes distributed rather than a monolith, so deployment is harder, more complex and more expensive; and with synchronous REST, if a plug-in stops responding, the request cannot complete. Its conclusion: pick point-to-point or remote from actual requirements, not fashion.
On data: plug-ins should not connect directly to a central shared database; the core hands each plug-in the data it needs. A plug-in may keep its own data store that only it can access, such as an assessment plug-in with its own rule base.
The core has to know which plug-ins are available and how to reach them; that is the registry. Each entry holds the plug-in's name, its data contract and remote-access protocol details (for remote plug-ins). The simplest registry is an in-memory map inside the core; the book's example maps model names to a plug-in class name, a message queue name or a REST URL. A complex one can use discovery tools such as Apache ZooKeeper or Consul.
Contracts are usually standard across a whole family of plug-ins and cover behavior, input data and output data, expressed in XML, JSON or objects. In the device-recycling example the contract is an assessment interface: assess() runs the assessment, register() / deregister() add and remove it; the output carries an assessment report, whether the device can be resold, its value and resale price.
When a plug-in comes from a third party and you don't control its contract, the book's advice is to put an adapter in between that translates the third-party contract into the standard one, so the core never needs special code for any single plug-in. This is the style's lifeline: once the core starts knowing one plug-in's private details, that plug-in is no longer pluggable.
Microkernel is the only style in the book that can be both technically and domain partitioned: plug-ins split by domain (one per device model, one per jurisdiction) lean domain-partitioned, while the core is often layered by technical role inside. It usually deploys as a monolith, so the number of quanta is 1. Ratings: overall cost 5 stars; simplicity 4; deployability, testability, reliability, modularity, evolvability and performance 3; scalability, elasticity and fault tolerance 1. Why:
Table 1 · The three monolithic styles side by side (stars are the book's ratings)
| Dimension | Layered (Ch 10) | Pipeline (Ch 11) | Microkernel (this ch) |
|---|---|---|---|
| Partitioning | Technical | Technical | Technical + domain |
| Cost · simplicity | 5 · 5 | 5 · 5 | 5 · 4 |
| Modularity | 1 | 3 | 3 |
| Deploy / test | 1 / 2 | 2 / 3 | 3 / 3 |
| Performance | 2 | 2 | 3 |
| Scale · elastic · fault tol. | 1 | 1 | 1 |
| Natural fit | Request–response business apps | One-way data processing | Products and rule systems with a stable core and shifting extensions |
Table 2 · Three ways to connect plug-ins (book's description + this page's summary)
| Style | What you gain | Cost | Good for |
|---|---|---|---|
| Compile-based | Simplest, no extra framework | Any plug-in change means redeploying everything | Internal systems with few, slow-changing plug-ins |
| Runtime (OSGi etc.) | Add or remove plug-ins without stopping the core | You must adopt and master a plug-in framework | IDEs, products extended in the field |
| Remote (REST / messaging) | Decoupling, independent scaling, async | Becomes distributed; with sync calls a dead plug-in fails the request | A few heavy plug-ins that need their own capacity |
The test in one line: can your system be split into "the main path every request takes" and "special cases that vary by customer or place"? If yes, and the special cases keep growing, microkernel is about the cheapest answer there is. If instead the "special cases" must call each other or share state, or the main path itself is changing violently, forcing plug-ins just produces a pile of tangled modules.
In an architecture review, ask three things: how many if/else branches distinguishing special cases are still in the core? Are plug-ins quietly calling each other? Does the contract expose the core's internal structure? In an interview, asked for the pros and cons of microkernel, you can say: "A small core guards the main path and special cases go into independent plug-ins, discovered via a registry and spoken to via a contract; cheap, extensible, the best performer among the monoliths, but still a monolith with one-star scaling and fault tolerance."
① Microkernel = core system + plug-ins, a.k.a. plug-in architecture; a natural fit for product software and for business systems whose rules vary by customer or region.
② Two definitions of the core: minimal functionality to run (Eclipse), or the happy path; move cyclomatic complexity into plug-ins.
③ Plug-ins are independent with no cross-dependencies; no direct access to the central database, but they may own private data stores.
④ Three ways to connect: compile-based (simple, full redeploy), runtime (OSGi etc.), remote (REST / messaging, now distributed).
⑤ The registry records name, contract and access details: a simple map, or ZooKeeper / Consul.
⑥ The contract fixes behavior, input and output; third-party plug-ins come in through adapters so the core holds no special-case code.
⑦ The only style that can be both technically and domain partitioned; one quantum.
⑧ Cost 5, simplicity 4, performance 3 (best among the monoliths); scalability, elasticity, fault tolerance 1.
⑨ Evidence: Eclipse is built on OSGi; VS Code isolates extensions in their own process; Firefox replaced its whole extension model because the legacy contract was too wide.
⑩ Interview line: "Small core for the main path, special cases in plug-ins, registry for discovery, contract for talk; cheap and extensible, but still a monolith."