BOOK DEEP READ · CONTINUOUS DELIVERY · CH 11

Managing Infrastructure and Environments

Continuous Delivery · Ch 11 · Jez Humble & David Farley · 2010

中文 →

What is this chapter about?

Every app you open runs on thousands of machines. Earlier chapters covered how a new version gets pushed onto those machines. This chapter digs one layer down, to something more basic: where those machines came from, who is allowed to change them, and what happens when one breaks.

An analogy

Think of the machines as the kitchens of a restaurant chain. The ideal is that headquarters holds one blueprint and every branch is built strictly from it — where the stove goes, which extractor fan, which shelf holds the fire equipment. Opening a new branch means building from the blueprint. If a kitchen burns out, you rebuild from the blueprint, which is faster than repairing it.

The old way looks different: each branch kitchen is put together by a local contractor from experience. They all look roughly alike. Year one is fine. In year three headquarters wants to switch everyone to a new stove, and only then does it emerge that no two kitchens are actually the same — one has the sockets in the wrong place, another had a wall moved years ago for convenience, and nobody wrote the wall down.

Why the old world was hard

A hand-built server is raised rather than built: over three years someone installed a package in a hurry, someone edited one line of config to stop an outage, someone opened a port and forgot to close it. Each change was tiny and none was recorded. Three years later the machine is a living fossil nobody dares touch: it still runs, but nobody can say why it runs, and nobody can produce a second one exactly like it.

Which is where the famous shrug comes from — "well, it works on my machine." Usually nobody is lying. It is simply that the machine you tested on and the machine serving users were never the same thing.

How the chapter fixes it

First, write down what a machine should look like: which things are installed, what every setting is, which ports are open. That list lives in the same repository as the code, so every change carries a name and a reason.

Second, only the robot touches the machines; people may not. This is the hardest rule in the chapter: to change a setting in production you change the list and let automation push it down. You do not log in and type.

Third, the robot keeps coming back to check. If something on the list has gone missing it puts it back; if somebody slipped something extra in, it removes it. That way machines cannot drift over time.

A fiercer version grew out of this later: rather than repair a machine that has gone crooked, build a fresh one from the list and throw the old one away — disposable, like paper plates.

Last comes watching: put dashboards on the whole fleet, on a screen the team walks past, so anyone can see at a glance when something has gone red.

The honest cost

Writing everything down as a list is real up-front work, and some ancient systems cannot be written down at all — nobody alive remembers how they were installed — so they stay fossils, tended by hand.

One thing to remember

Stop raising machines by hand. Write down what each machine should look like, keep it in version control, and let only automation build, change and correct them. The moment a person logs in and edits something, that machine can never be reproduced again.

Want the actual mechanics — how the definitions are written, how state converges, what virtualization and cloud changed? → Switch to the deep read