Book Deep Read · Fundamentals of Software Architecture · Chapter 11
Fundamentals of Software Architecture · Ch 11 · Mark Richards & Neal Ford · 2020
Every night, a company exports the day's orders: first it throws out the badly formatted ones, then converts everything to one currency, then picks out the refunds, and finally writes it all into a report — so the boss can read it over morning coffee. Jobs like this share one trait: a batch of data gets worked on step by step, in a fixed order. This chapter is about the software shape built exactly for that kind of job: the pipeline architecture.
Picture an assembly line. The conveyor belt only moves one way, and every station along it does exactly one thing — this one only tightens screws, that one only sticks on labels. A worker doesn't need to know who sits upstream or what happens downstream; an item arrives, they do their bit, and put it back on the belt. Need a new step? Slot a new station onto the belt, and everyone else carries on as before.
Without this split, the usual approach is one big program that does everything start to finish: reading, cleaning, converting, deciding, saving — all stirred together. Adding a step means cutting into the middle of a long block of code; reusing the "convert" step somewhere else is impossible, because it's glued to the steps around it.
There are only four kinds of station on this line. The intake: takes raw material from outside, the start of the line. The workstation: takes an item, changes it, sends it on. The inspector: takes a look, lets good items through or steers them down the right branch, and simply stops sending the rest. The shipping dock: the end, where finished goods go into storage or onto the shelf.
The rules are few, too: the belt only moves forward, and each belt connects just two stations; no station keeps a memory, so it never needs to remember what the last item looked like. Because the rules are so simple, stations can be unplugged, moved around and snapped together into new lines, like building blocks.
It fits jobs that flow one way — moving data, building reports, processing logs: cheap, easy to understand, and easy to extend. The price: the whole line usually lives under one factory roof, so you can't add staff to just the busiest station, and when one station jams, the whole line tends to stop with it.
A pipeline is a one-way conveyor belt plus stations that each do one thing: the simpler the rules, the easier the stations are to rearrange. Great for data that flows downhill; a poor fit for work that needs back-and-forth.
Want the constraints on pipes and filters, the four filter types, the book's telemetry example, its star ratings, and how it compares with layered architecture? → Switch to Deep Read
You might think pipeline architecture is "something data-processing frameworks use"; in fact it's just a handful of constraints: pipes are one-way and point-to-point; filters are self-contained, generally stateless, and do one thing. FoSA Chapter 11 shows that those constraints are exactly what buy compositional reuse — filters can be rearranged and inserted like building blocks. But it is still a monolith: cheap, simple and fairly modular, with elasticity, scalability and fault tolerance stuck at one star.
|: on the command line, wires one program's output straight into the next program's input.The second chapter of Part II, "Architecture Styles", following layered architecture (Chapter 10) and leading into microkernel (Chapter 12) — all three monoliths. Real-world counterparts: the Unix shell, ETL and EDI tools, log and telemetry processing chains, and routes in integration frameworks such as Apache Camel.
A large class of problems is naturally "data flowing through a sequence of processing steps": nightly bulk exports, translating a partner's order format into your own, cleaning the monitoring data services report and loading it into a store. The book notes that everyone has met this style in Unix shells like Bash and Zsh, and that function composition in functional languages and MapReduce are its shadows too.
Without it, this kind of code tends to become one long start-to-finish procedure: every step knows the details of its neighbours, adding a step means editing the middle, swapping a step means retesting everything, and no step can be reused in another flow. The chapter's question is: when you break processing into pipes and filters, which constraints must you keep, and what do they buy — and not buy — you?
Pipes are the communication channels between filters. The book stresses two things: they are unidirectional, and usually point-to-point rather than broadcast, for performance. The payload can be any format, but architects favour small amounts of data — hauling big objects through pipes is expensive.
Filters are self-contained, independent of each other, generally stateless, and perform one task only; a complex task is handled not by one big filter but by a sequence of filters. These constraints look fussy, but they are where the style's value comes from: a filter knows nothing about its neighbours, only the data arriving through its pipe, so it can be unplugged, moved and reused.
The book sorts filters into four types, each with a crisp boundary:
map in functional programming.reduce; in practice it often plays the role of router and gatekeeper.The book's argument: the one-way nature of pipes plus the simplicity of each filter encourages compositional reuse. A classic illustration is Unix. In 1986 Jon Bentley's CACM column asked Donald Knuth to print the k most frequent words in a text; Knuth wrote a literate program of roughly ten pages, and Doug McIlroy's review did the same job with a shell pipeline of six commands. Each command is a filter that does one thing; | is the pipe.
The cost hides in the same place: composition works because filters talk only through data. Once a filter peeks at a neighbour's internals, or hoards state across requests, it can no longer be moved freely, and reuse drops immediately.
Services stream telemetry to Apache Kafka. Service Info Capture (producer) subscribes to the topic and passes data to Duration Filter (tester), which checks whether it concerns request duration in milliseconds. If yes, Duration Calculator (transformer) computes the duration metrics; if no, Uptime Filter (tester) checks whether it's uptime data — if not, this flow doesn't care about it and the pipeline simply ends; if so, Uptime Calculator (transformer) takes over. Both calculators feed Database Output (consumer), which writes to MongoDB.
The point of the example is extensibility: to start collecting database connection wait time later, just add a new tester after Uptime Filter — not a line of the earlier filters changes.
Pipeline is technically partitioned: logic is split by filter type (producer, tester, transformer, consumer), not by business domain; it is usually deployed as a monolith, so it has one architecture quantum. Ratings: overall cost and simplicity, 5 stars; modularity, testability, evolutionary and reliability, 3 stars; deployability and performance, 2 stars; elasticity, scalability and fault tolerance, 1 star. Why:
Table 1 · Two monolithic styles side by side (stars are the book's ratings)
| Dimension | Layered (Ch 10) | Pipeline (this chapter) |
|---|---|---|
| How it's split | By technical layer: presentation / business / persistence | By filter type: producer / transformer / tester / consumer |
| Flow | Request goes down, result comes back up | One way, ending at the consumer |
| Modularity | 1 star | 3 stars: filters replaceable one by one |
| Deployability / testability | 1 / 2 stars | 2 / 3 stars |
| Cost · simplicity | 5 stars | 5 stars |
| Scale · elasticity · fault tolerance | 1 star | 1 star (still a monolith) |
| Natural fit | Request–response business apps | Step-by-step data work: ETL, EDI, telemetry |
Table 2 · When to choose a pipeline (book's guidance + this page's synthesis)
| Scenario | Good fit? | Why / cost |
|---|---|---|
| One-way, ordered data processing | Yes | Its natural shape; a new step is one inserted filter |
| Steps added or removed often, reuse wanted | Yes | Stateless filters that only know data can be reordered |
| Tight budget, fast delivery | Yes | 5 stars for cost and simplicity |
| Business flows with back-and-forth | No | A one-way pipe can't express "ask back, wait for confirmation" |
| One step needs its own scaling or high availability | No | Scale, elasticity, fault tolerance 1 star; accept it or go distributed |
| Filters must share lots of state | Rethink | Breaks statelessness; compositional reuse goes with it |
The one-line test: can your problem be drawn as a flowchart that only moves forward? If so, a pipeline is close to the cheapest answer; if not — loops, waits, memory shared across steps — don't force it. Note: once each filter becomes its own service with a message queue as the pipe, you have moved to a distributed, event-driven style (Chapter 14), buying scalability and signing up for Chapter 9's eight fallacies.
In an architecture review, ask three things: does each filter really do one thing, and is it truly stateless? Is the data in the pipes small enough? Will some step eventually need to scale on its own — and if so, this pipeline will one day be split into a distributed one. In an interview, asked about pipeline pros and cons, you can say: "One-way pipes plus stateless single-purpose filters buy compositional reuse and five-star cost and simplicity; but it's still a monolith, so scalability, elasticity and fault tolerance are one star."
① Pipeline architecture = pipes + filters; Unix shells, functional composition and MapReduce are all its shadows.
② Pipes: one-way, point-to-point (for performance), small payloads.
③ Filters: self-contained, independent, generally stateless, one task each; complex work is done by chaining.
④ Four filter types: producer (start), transformer (like map), tester (tests and decides whether to output), consumer (end).
⑤ One-way + simple → compositional reuse; break statelessness or let filters peek at each other and reuse dies.
⑥ The book's example: Kafka telemetry → two testers route → calculators → MongoDB; a new metric is one inserted tester.
⑦ Technically partitioned, one quantum; cost and simplicity 5 stars, modularity 3 (better than layered), scale, elasticity, fault tolerance 1.
⑧ Fits one-way data work (ETL, EDI, telemetry); not systems needing back-and-forth or targeted scaling.
⑨ Turn filters into separate services and it becomes a distributed style: new ratings, plus the eight fallacies.
⑩ Interview line: "One-way pipes and single-purpose filters buy composition; still a monolith, so scale and fault tolerance get one star."