Book Deep Read · Fundamentals of Software Architecture · Chapter 11

Pipeline Architecture: A One-Way Conveyor Belt and Stations That Do One Thing

Fundamentals of Software Architecture · Ch 11 · Mark Richards & Neal Ford · 2020

中文 →

What is this chapter about?

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.

An analogy: a factory assembly line

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.

Why the old world was hard

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.

The core mechanism: four kinds of station, one one-way belt

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.

What it buys you / how to choose

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.

One sentence to remember

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