Engineering philosophies: simple first, ship small, own what you run
Three defaults that settle most of the arguments you will have in code review, and the price you pay for each. A principle without a stated cost is a slogan
Tallowmere's refill-reminder job calls its messaging provider for each of 300 patients. For 30 of them the call times out, so the job retries those sends, and the same 30 patients receive the text twice. What did the retry policy assume that was false?
An engineer’s defaults are the choices you make when the ticket is vague, the sprint ends on Friday and nobody is checking. Most people never state theirs, so they cannot examine them and cannot explain to a colleague why they are choosing differently. The arguments that follow in code review look technical and are about values. One person wants the general solution, another wants it merged today, and a third treats the problem as someone else’s once it is deployed.
This chapter names three defaults that many teams share: simple first, ship small and own what you run. For each it gives the idea, where it comes from, what it costs you and when to break it. The cost is the part people skip. A principle that has never cost you anything has not yet been tested. Staff engineers hold a different set, about leading without authority, in staff philosophies. The same exercise for testing is testing philosophies and for reliability SRE philosophies. This chapter is the one for the change in front of you.
The model: three defaults, each with a price
| Default | What you do when unsure | What it buys | What it costs | Break it when |
|---|---|---|---|---|
| Simple first | Build the least that meets today’s need, from parts you can explain | Fewer things to break, learn and run | You may rebuild it later, and you pay for what you left out | The need is known, dated and expensive to add afterwards |
| Ship small | Cut the change to the smallest piece that is safe and useful alone | Quick feedback, a review that works, an easy rollback | More pull requests and releases, so more overhead per change | The change cannot be split safely, such as a one-way data migration |
| Own what you run | Treat what you shipped as yours after the deploy: watch it, answer for it, fix it | You learn how it really fails and design for that | The pager, interruptions and less unbroken time | A dedicated operations function exists and has agreed the hand-over |
The three belong together. A simple design is one a single person can keep in their head, a small change is one a reviewer can keep in theirs, and a thing you own is one you understand well enough to look after at night. They also pull against each other, which is where the interesting decisions are, and a later section takes that up with one case.
Simple first
Start with a word that causes trouble. In his talk Simple Made Easy, Rich Hickey separates simple from easy. InfoQ’s summary of the talk gives the core of it: simple is the opposite of complex, and complex means intertwined, things tied together. Easy is about familiarity, what is already close to hand. Pasting a snippet from a search result is easy. It may not be simple, because your code is now tied to a pattern you do not understand. A design with fewer parts that do not depend on each other is simple even when it took longer to write.
Where to start from is an old question in systems design. John Gall’s book Systemantics contains the observation, which later writers named Gall’s law although the book does not use the name, that a complex system that works has grown from a simple system that worked. A complex system designed from scratch tends not to work and cannot be patched into working. The practical reading is to get the simple thing running first and grow it.
Martin Fowler’s Yagni, short for You Aren’t Gonna Need It, applies this to features. It says not to build for a need you only presume, and it lists four costs of building ahead:
- The cost of build: the effort you spend on something that may never be used.
- The cost of delay: the value lost because that effort did not go to something else.
- The cost of carry: the extra complexity that makes every later change harder until the feature is removed.
- The cost of repair: the price of fixing a feature you guessed wrong.
Fowler is explicit that the principle is not an excuse for a messy code base. Keeping code easy to change is what makes it safe to wait.
Dan McKinley’s Choose Boring Technology gives the instinct a budget. Each team has a small number of innovation tokens, and choosing an unfamiliar technology spends one. Long-established tools such as Postgres or cron cost little to adopt, because everyone knows how they fail. A new queue or datastore may fit your problem better, and it costs you the time to learn how it breaks in production.
In practice, simple first is three questions you ask before you write a line:
- What is the smallest thing that meets today’s need?
- What am I adding for a need I only expect?
- Could I explain every part of this to a new colleague in ten minutes? (A rule of thumb from this chapter, not a measured limit.)
What it costs. You will sometimes rebuild. The simple version is outgrown, and the rebuild takes longer than building the larger version first would have. Some people also use “keep it simple” to defend work that is under-built, with no tests and no way to see it failing. Simple means few parts, not few checks.
When to break it. Some decisions are expensive to change later: a field in an API that customers use, a format you store on disk, the way money is recorded. Spend design effort there, and keep everything around it simple. Break the default too when a need is known, dated and costly to retrofit, such as a customer contract that starts in March.
Ship small
The idea behind small changes is the same as behind simple designs: fewer places for a mistake to hide. The DORA research programme lists working in small batches among its capabilities. Its page says small batches let a team test hypotheses quickly and correct course, and it names two common pitfalls: not splitting the work finely enough, and regrouping small batches before testing or release, which brings the big batch back.
What a small change gives you is concrete. A reviewer can read all of it, so the review finds things. If it breaks production, the cause is in one of a few lines, and rolling it back removes one thing. You learn from real use sooner, so a wrong assumption costs a day and not a quarter. The size is not a count of lines. A good size is one change that does one thing and is safe to deploy by itself: it does not break the old behaviour, and anything half-finished is switched off. Writing the description and splitting a large change is the subject of pull requests that get merged, and cutting a feature into pieces is breaking down and estimating work. Both come later in this track.
What it costs. Each change carries fixed overhead: a branch, a review, a deploy, a check afterwards. Ten small changes pay that overhead ten times. Half-built features sit in production behind switches, and a switch nobody removes becomes carried complexity, one of Fowler’s four costs. Some engineers also use small slices to avoid ever finishing the hard part.
When to break it. Some changes cannot be split safely. A one-way change to how data is stored has no useful half-done state. A cut-over between two systems has a moment when one is on and the other is off. For those, make the change as small as it can be, rehearse it, and agree a rollback before you start, instead of pretending to slice it.
Own what you run
Vogels’s line, quoted at the top, comes in the interview straight after he contrasts the traditional model, where development throws software over a wall to operations, with Amazon’s. Owning means that after the deploy the software is still yours. In practice it is four things:
- You can see whether it works: a log you can search, a dashboard, and an alert that reaches you and not a mailbox nobody reads.
- You can turn it off or back out of it, with a switch or a written step.
- You answer first when it breaks, and you do not pass it on until you know it is not yours.
- You hear the complaint in the customer’s words, or from the person who talked to them.
At Tallowmere, the online pharmacy in Ibadan with 40 people and nine engineers, there is no separate operations team. The engineer who wrote a job is the person customer care messages when it misbehaves. That is how the principle works at its simplest.
What it costs. The pager is the visible part. The larger part is interruption: you stop what you were doing to look at your own earlier work, and focus time falls. Ownership also grows. Every change you ship adds to what you run, so a team that ships small and often has more to look after each month. Without an agreed rota, the person who built the most becomes the person everything depends on.
When to break it. Some companies have a dedicated operations or site reliability function, and then the right default is to meet its standards, not to run everything yourself. Even then, owning means you provide what that team needs: a runbook, alerts and an honest description of how the system fails. How the rota, the pager and the hand-offs work is in on-call done right and incident management. Carrying the pager for your own service is taught in on call for what you built, later in this track.
Where the three pull against each other
You will feel the conflicts before you can name them.
- Simple first against ship small. The simplest design is sometimes large, and a small step towards a better design can leave the system more complicated than before. A half-migrated system has two ways of doing everything.
- Ship small against own what you run. Each small release adds something to look after. A team that ships ten times a week without watching what it shipped is practising only half of the philosophy.
- Own what you run against simple first. The simplest thing to build can be the most costly to run: a script on one machine, a manual restart, a step only one person knows.
A single case shows all three. Tallowmere bills about 300 repeat-prescription patients each month, and the chapter on card tokenisation and recurring payments tells how its billing job learned to treat declines. Suppose, for this chapter, that a separate reminder job texts all 300 patients on the 28th to say their refill is charged on the 1st. This month the messaging provider timed out on about 30 of the 300 calls. The job, which had been written to retry on any failure, sent those texts again, and many of the first attempts had in fact been delivered, so those patients received the text twice. Two of them rang customer care. These numbers are illustrative.
The first lesson is in the Predict above. A timeout means unknown. The idempotency lesson shows why a client that never hears back must either retry and risk a duplicate, or give up and risk a loss, and why the way out is to make the second send harmless. The retries lesson adds that waiting longer between attempts changes when the second send happens and not whether it is a duplicate.
The second lesson is that there are two sizes of fix. The small one is a flag per patient, written when the provider accepts the text, so that a rerun skips patients who are already done. It is simple, small and quick to ship. The order of the two steps decides which mistake you can make. If the job writes the flag after the send, a crash in the gap can still produce a duplicate. If it writes the flag before the send, the same crash produces a missed text. Choosing between them means asking which mistake is cheaper for this message, which is an ownership question: you cannot answer it without knowing how patients react.
The large fix is an outbox. The job first records, in the same database transaction as everything else it changes, an intention to send each text, and a separate step sends it using a stable key that the provider honours. The gap closes, because a repeated send carries the same key and is refused as a duplicate. It also takes much longer. Which one you build, and when, is the decision at the end of this chapter, and the three defaults give different answers to it.
Where practitioners disagree
How much to build ahead. Fowler’s argument is for waiting for the need, and the opposing argument is that some needs are predictable. A wallet will need an audit trail, and a payments table will need a way to refuse duplicates. The usual resolution is the one above: wait on features, and spend care on the decisions that are costly to reverse.
Boring technology. The innovation-token idea is widely quoted and also challenged. Critics say it counts the novelty of a tool and not the operational burden it adds, and that a team that never spends a token never learns anything new. McKinley’s own framing is a budget and not a ban, so the practical question for you is who on the team has the experience to run a new choice at night.
Who runs it. “You build it, you run it” is not universal. Many companies, especially larger ones, keep a separate operations or reliability team, and the argument for it is that specialists run production better and developers should not be woken for every fault. The argument for ownership is that a developer who never feels the pager designs systems that need one. Most teams that last settle on a mix: developers carry the pager for their own service, and a platform or reliability team supplies the tools and the standards.
Small or complete. A change that is small enough to review can still be too small to understand. Reviewers sometimes ask to see the whole feature to judge a piece of it. The answer that works is to link the pieces: say in each description what the next piece is.
Day to day
At Foundations level you do not set your team’s philosophy. You apply it, and you build habits that make it real.
Before you start a task. Write three lines in the ticket: the smallest version that meets the need, what you are leaving out, and how you will know it works once it is live. Show them to a colleague before you start. Five minutes here saves a day of rebuilding.
While you work. Keep each branch to one purpose. If you find a second problem, write it down and fix it in its own change. Ask the three simple-first questions when you reach for a new library.
When you open the pull request. Say what the change does, what it does not do and how to switch it off. Be ready for the reviewer’s question about how this fails.
After you deploy. Stay near your screen for fifteen minutes and look at the logs and the dashboard for your change. This is the smallest piece of owning what you run, and the one most people skip.
Every morning. If you own a job or a service, spend ten minutes on its alerts, errors and complaints before you open anything new. Note what surprised you.
Weekly, team meeting or retro. Bring one case where a principle cost you something, or one where breaking it was right. A team that discusses those has a philosophy. A team that does not has a slogan.
When you join the rota. Shadow before you carry the pager: read the runbooks, sit with the person on call, then take a week with a buddy. Do not carry it alone on your first rota.
Every quarter. Re-read your own statement. Cross out any line whose cost you have not felt, and add one for a cost you have.
There are fewer than 30 of you, probably no operations team and perhaps no code review rule. Own what you run is not a choice, because you are the production team. Simple first is also forced on you, since nobody has time to maintain two of anything. The risk is the opposite one: with no review, small changes slide into big ones, and the one person who understands a system becomes its single point of failure. Write your statement down anyway, short and plain, and make the rota explicit before the first person burns out.
With 30 to 300 people the company is splitting into teams and the first platform and reliability people arrive. Your philosophy is now tested against other teams’ habits: one team ships weekly in large batches, another ships ten times a day. Expect arguments about who owns shared pieces such as a queue or a payment provider. Ownership needs naming in writing, and small changes need review turnaround that matches them. The common failure is an unwritten rule that only the original authors may touch a system.
At 300 and above, defaults are partly set for you: a change process, a platform, an approved list of technologies, perhaps a separate operations function. Your job is to work well inside those and to say plainly where they cost you. Ship small may mean meeting a weekly approval board. Own what you run may mean meeting a service standard and handing production to a team you do not sit with. The skill is to keep the principle while fitting the process, and to put your cost in writing when the process makes it larger.
Template
# How I work: <your name>, <date>
Team and what we run: <one line>
## Principle 1: <a default, in one sentence>
- What I do when unsure: <the action, not the value>
- The case: <what happened, when, how big, and the ticket or pull request>
- The cost I pay: <time, effort, risk, with a number>
- I break it when: <the circumstance>
## Principle 2: <default>
- What I do when unsure:
- The case:
- The cost I pay:
- I break it when:
## Principle 3: <default>
- What I do when unsure:
- The case:
- The cost I pay:
- I break it when:
## Where two of them pull against each other
<Which two, what I did last time, and what I would do again.>
## What a colleague should expect from me on a vague ticket
<Three lines.>
## Revision log
<What I changed or crossed out since last time, and why. Next review: <date>.>
## Shown to: <name>, on <date>. What they said: WORKED EXAMPLE
Tallowmere is a fictional online pharmacy in Ibadan: 40 people, nine engineers, no separate operations team. Adewunmi is an engineer on the team. This is the statement Adewunmi wrote for a team session in the first week of a quarter.
Principle 1: I build the smallest version that meets this month’s need. The case: the weekly stock-count export for the pharmacists, built as a cron script writing to one table, not a queue and a service. The cost I pay: it runs on one machine, and it missed one Sunday in the first three months, so a pharmacist counted by hand for about an hour. I break it when the need is dated and expensive to retrofit.
Principle 2: I ship the smallest change that is safe alone. The case: the pharmacist-notes screen, shipped in three releases. The cost I pay: three review rounds and about two extra days in total. I break it for one-way data changes, which I rehearse instead.
Principle 3: I look after what I ship. The case: I read the reminder job’s alerts for ten minutes each morning, and I shipped every change to it with a way to switch it off. The cost I pay: ten minutes a day and a week on the rota.
Where two pull apart: principle 1 against 3. The cron script was simple and costly to run, so I added a morning check. A colleague should expect a question about how my change fails. Revision log: I crossed out “I keep everything simple” because it had no cost I could name; next review at the start of next quarter. The cases are linked to their tickets. Shown to Iker, who asked me to say what “safe alone” means.
Now you
You are an engineer at Tallowmere, the 40-person online pharmacy with nine engineers. Iker, who reviews your changes, has asked every engineer for a one-page statement of how they work, to be read at a team session on Friday. You have three pieces of recent work to draw on. A new delivery-slot picker went out as one change of about 900 lines and a bug reached customers on the first day. A script you wrote to tidy old prescriptions ran correctly but took you four evenings of unplanned work to rerun after the database changed. You also spent ten minutes each morning for six weeks reading the alerts of the order-status page you built, and caught two faults before customers did. Write your statement with three principles, the cost of each in numbers from these cases, and one conflict between two of them.
Self-check
Tallowmere's refill-reminder job texts all 300 repeat-prescription patients on the 28th to say their refill is charged on the 1st. A provider timeout made the job retry 30 sends, and those 30 patients got the text twice; two of them rang customer care. The next run is in 24 days. Adewunmi owns the job. The nine-engineer team has one sprint of slack, and Iker, who reviews its changes, asks what to do first.
- POST A Conversation with Werner Vogels Werner Vogels, interviewed by Jim Gray, 2006
The interview in which Vogels describes 'You build it, you run it' as Amazon's alternative to handing software over to operations. Read it for the reasoning behind ownership, not only the slogan.
- TALK Simple Made Easy Rich Hickey, 2011
The talk that separates simple, meaning not intertwined, from easy, meaning familiar. Use it to test whether a design you like is simple or only easy to write.
- POST Yagni Martin Fowler
Fowler's account of why building for a presumed need costs more than it looks, with the four costs of build, delay, carry and repair. Read it with his warning that the principle does not excuse messy code.
- POST Choose Boring Technology Dan McKinley, 2015
The innovation-token argument for spending novelty sparingly. It helps you answer who will run a new tool at night before you choose it.
- DOC Working in small batches DORA
A short page from the DORA research programme on why small batches speed up feedback, with the common pitfalls. Use its pitfalls as a checklist for your own pull requests.
All companies and people in these examples are fictional. Any resemblance to a real business or person is unintended.