BOOKS DEEP-READ · SRE · CH 7

The Evolution of Automation at Google

Site Reliability Engineering · Ch 7 · Google · 2016

中文 →

What is this chapter about?

Auto-updates on your phone, the badge reader at the office — that's automation. Google has a group of engineers called SREs whose job is to keep the site up, and the machines they look after number in the hundreds of thousands. Clicking through them one at a time is not an option. This chapter is the story of how, over more than a decade, they moved from "a human works through a checklist" to "the system takes care of itself" — and what they broke along the way.

A strange thing first

You probably assume the biggest win from automation is saving time. Google's answer: no. Saving time comes last. First place goes to doing it exactly the same way every time. Ask a hundred people to do one task by hand and you get a hundred slightly different results; run a script a hundred times and you get the same result each time (even if it's the same mistake). At scale, "identical" is worth far more than "fast" — because the most expensive line item in an outage is rarely "the code was wrong", it's "this box differs from that box and nobody knows how".

Why the old world was hard

Bringing up a new Google datacenter once meant an SRE working through a checklist of hundreds of steps over several weeks: install this, configure that, verify the other. A checklist is written for humans, and humans skip steps, read them differently, get tired. Worse, when it was done, nobody could state what "correct" actually looked like — all that existed was a checklist that goes stale and the memory of a few veterans.

How they did it

Two moves. First, turn the checking into a program: stop asking a veteran "is this one configured right?" and instead write many small checks that verify, one fact at a time, that the thing that should be there is there — and say precisely which one isn't. Second, and this is the turn, turn checking into fixing: the program already knows what it should look like, so let it put things right.

That relies on one property, idempotence: whatever state you're in now, one run lands you in the intended state, and ten runs land you in the same place as one. Like a steering wheel that self-centers — you don't need to know how far off it is; let go and it returns. Only with that property can automation be run repeatedly, at any moment, without fear.

Following that road up is a staircase: hands → someone writes a script → the script becomes a shared tool → the tool moves inside the system and ships with it → and finally, the system notices its own problem, fixes it, and nobody gets woken. Google's cluster system Borg — the one Kubernetes learned from — stands on the top step: you say "I want five copies of this version", and it watches the rest.

What it costs

One honest line: moving humans out of the operation also moves them out of understanding it. On the day the automation itself goes wrong, whoever is on call may have neither the reflexes nor a manual.

Remember this one thing

Automation isn't a labor-saving tool, it's an amplifier: it multiplies what you got right and what you got wrong, and it does so much faster than a person could. So the thing worth chasing isn't "more scripts", it's "a system that looks after itself without bolt-on scripts at all".

Want the five-level ladder, idempotent reconciliation and the diagrams? → switch to the deep read