§ 01Friday, dinner rush
Fennel is a grocery-delivery startup with three people. Jordan and Morgan founded it, and Morgan handles the money. Sam is the only engineer, and built the one server the Fennel app runs on. In this chapter you’re in Jordan’s seat: you know roughly what a server and a deploy are, and you’ve never had to fix either.
It’s Friday evening, the dinner rush, the busiest hour of Fennel’s week. At 18:12 customers start seeing an error at checkout, and orders stop coming in. A few minutes later the first annoyed emails reach Jordan. Sam is at dinner across town and doesn’t pick up.
Here’s the strange part.
Nobody has changed a line of Fennel’s code since Tuesday. So what could break checkout on Friday evening?
Settle on an answer in your head first.
ANSWERSomething about the machine the code runs on. Fennel’s code was fine. The server’s disk had filled up, and the database could no longer record new orders.
If your first thought was “a bug in the code”, that’s the usual instinct, and the rest of this chapter is about everything else an app depends on.
The disk had filled with log files, the running diary the app and its web server keep of every request. They had been growing for months, because nobody had set anything up to clear out the old ones. With no space left, the database couldn’t save new orders. Nothing already stored was damaged, but nothing new could be written.
Look at the last row, too. At 23:00 Sam set up a nightly job that deletes old logs, so the disk can’t fill up the same way again. It’s a good fix. Sam made it by hand, directly on the server, and didn’t write it down anywhere. That row comes back later.
§ 02What “the server” is
The server is one computer that Fennel rents in a data centre. Like a laptop, it has a processor, memory and a disk. Unlike a laptop, it runs day and night, and customers reach it over the internet.
The orange block is the Fennel app while it runs. A running program is called a process: the code, loaded into the machine’s memory, answering customers’ requests and writing orders and log lines to the disk. On Friday the process kept running. It just couldn’t do its job, because the disk it writes to was full.
When Sam ships a change, Sam copies the new code onto this machine and restarts the process. That copy-and-restart is a deploy, the arrow at the top of the figure.
So far the app sounds like code plus a computer. But code can’t run on just any computer. At the very least it needs the language runtime it was written for, such as Python, and that runtime is installed on the machine, not shipped with the code. What else does it need? You’re about to find out by hand.
§ 03What’s on Sam’s server, and can you rebuild it?
Below is Sam’s server as most people picture it: the code, running. First, work out what else is on it. Then try to build a second one using only Sam’s notes, and check whether it behaves like the first. It takes three or four minutes.
§ 04Why the notes fell behind
Everything you found on Sam’s server besides the code is something the app needs in order to work. Most of them are dependencies: the language runtime, the libraries and tools the code calls, and the config that tells it where its database is and which keys to use. The app also relies on the data on the disk, its orders and customers, which changes every minute. Many of these things live on the machine, not in the code, and a different machine may not have them. That’s how identical code broke photo uploads on your new machine.
Sam’s notes weren’t wrong when Sam wrote them. They described the server on the day it was set up. Then the photo tool went on in May, the email key in August, and the nightly log clean-up last Friday. Each was a sensible change, made by hand on the live server, and none of them reached the notes. Engineers call this drift (in full, configuration drift): changes to a system’s setup that go unrecorded. Every unrecorded change widens the gap between the notes and the server, so notes like Sam’s fall behind as a matter of course. Nobody has to be careless for it to happen.
Then there’s the holiday-sale setting. Sam changed it during a sale and can’t say whether it still matters. With no second machine to try it on, the surest way to find out is to remove it and see what breaks, on the server that takes every order. Martin Fowler, a well-known writer on software design, describes exactly this state of an old, hand-tended server: “You’re not sure what parts of the configuration are important.” That’s where “don’t touch it” comes from. Nobody knows which settings the app relies on, so every change is a gamble.
A server made unique by years of changes like these is a snowflake server. Fowler popularised the term in 2012: the result of all that hand-applied patching and tweaking is “a unique snowflake - good for a ski resort, bad for a data center.” Its first problem, he writes, is that it’s difficult to reproduce.
ANALOGYRebuilding a server from its notes is like replacing a long-serving employee using only the job description they were hired with. The replacement does everything that’s written down. The duties that piled up over the years show up only when something doesn’t get done.
WHERE THIS ANALOGY BREAKSA new hire notices gaps, asks around and uses judgment. A new machine does exactly what the notes say and fails without comment. And the old server can’t explain itself: even Sam doesn’t know which settings still matter.
§ 05If this box vanished tonight
On Friday the server was sick, and Sam could nurse it back. Now suppose it’s gone.
Saturday, 2 a.m. The rented server’s hardware fails for good. The code is safe in the repo, and Sam has the notes. When is Fennel fully back to normal?
So the length of an outage like this isn’t set by how fast someone can copy the code. It depends on how much is missing from the notes, and on whether the one person who knows the server is awake and reachable. Neither shows up in advance. The notes can’t list what they leave out, so the gaps surface as broken features. And the knowledge that fills them is mostly in Sam’s head, with some of it only on the machine that just died. That’s the practical meaning of Fowler’s warning about snowflakes: if the hardware fails, “it’s difficult to fire up another server to support the same functions.”
ANALOGYManagers know the bus factor: how many people could disappear before a project stalls. Formally, it’s “a measurement of the risk resulting from information and capabilities not being shared among team members.” Fennel’s server has a bus factor of one: Sam.
WHERE THIS ANALOGY BREAKSA bus factor is about what’s in people’s heads. Here part of the knowledge isn’t in anyone’s head. It exists only on the machine, and even Sam doesn’t know all of it.
WHY RECOVERY TIMEFowler once joked about a “certification” for operations teams: someone walks into the data centre and attacks the production servers “with a baseball bat, a chainsaw, and a water pistol”, and the team is graded on “how long it would take for the operations team to get all the applications up and running again.” He suggests forgoing the baseball bats. The measure is the serious part: what counts is how long until you’re back when the server fails.
§ 06“Couldn’t we just…”
After Friday, everyone reaches for a fix.
After Friday, Morgan offers to pay for a much bigger server, with ten times the disk. Which of Friday’s problems does that solve?
Bigger machines also run out. There’s a limit to how large a single machine can get, and near the top of the range the price climbs steeply. Fennel is nowhere near that ceiling, so for now the real objection is Friday’s: a bigger server is still one server, built by hand. Engineers call a machine like this a single point of failure: when something goes wrong with it, the whole site can go down with it.
Sam’s idea uses a different kind of server. A virtual machine, or VM, is an isolated computer created in software, with its own processor, memory, disk and operating system. Several of them can run on one physical machine, and a new one can be created in minutes. The provider can also take a snapshot of the VM’s whole disk every night: an exact copy you can start again later.
Sam suggests moving Fennel to a virtual machine at a cloud provider, with a snapshot of its disk taken every night. If that VM vanished tonight, what would getting back look like?
-
1 · Thu 01:00Last night’s snapshot taken.
- app code
- runtime
- libraries, tools
- config file
- 40 GB of old logs
- holiday-sale setting UNKNOWN
- app code
- runtime
- libraries, tools
- config file
- 40 GB of old logs
- holiday-sale setting UNKNOWN
Exact copy, clutter included.
-
2 · Thu 15:00Sam fixes something by hand.
- app code
- runtime
- libraries, tools
- config file
- new email setting hand-made, not in notes
- 40 GB of old logs
- holiday-sale setting UNKNOWN
- app code
- runtime
- libraries, tools
- config file
- 40 GB of old logs
- holiday-sale setting UNKNOWN
The snapshot doesn’t change.
-
3 · Thu 22:00The VM dies; restore last night’s snapshot.
- app code
- runtime
- libraries, tools
- config file
- new email setting MISSING
- 40 GB of old logs back
- holiday-sale setting UNKNOWN
Back in minutes. This afternoon’s fix is gone, and so are today’s orders.
ANALOGYA snapshot is like photocopying Sam’s desk. You get a copy fast, coffee stains and wrong notes included, and you still don’t know which papers matter.
WHERE THIS ANALOGY BREAKSA snapshot is an exact, working copy, so it really does get you back faster than a photocopy gets you a working desk. Its weaknesses lie elsewhere: it doesn’t help you understand or change the server, and it goes stale as soon as someone changes the live machine by hand.
VMs give you more machines, faster. They don’t tell you what should be on them.
§ 07The conversation
“We should keep a runbook for the server.”
Sam
A runbook is a written, step-by-step guide to setting up and repairing a system: think of Sam’s notes, kept current. It’s a good instinct. What matters is how Jordan answers.
The Monday after the outage, Sam says: “We should keep a runbook for the server.” What’s the most useful thing Jordan can say?
Sam answers your question. What answer should worry you, and what answer would reassure you? Think about it, then show the answer.
WORRYING“Depends. If I’m reachable, a few hours, I think.” That’s a guess, and it depends entirely on one person.
REASSURING“We rehearsed it last month. Jordan followed the notes on a spare machine while I watched without helping. It took fifty minutes, we found two gaps, and we added them to the notes.” That’s a measured time, from a real rebuild, that didn’t rely on Sam’s memory.
The point is what to listen for: a measured recovery time from an actual rebuild beats a confident estimate.
In short
- The app is the code plus everything it depends on, on one particular machine.
- A hand-built server drifts away from its notes, and only a rebuild shows how far.
- Bigger servers and VMs help, but neither tells you what should be on the machine.
One question stays open. If the app is the code plus everything on the machine, how do you ship all of it? A year from now Fennel has six engineers, and that question comes up every day.