Mark DeLeap King

Reliability

Small releases: the discipline behind a dozen live products

Frequent small releases are safer than rare large ones, for mechanical reasons. The release path I use to run more than a dozen live products has checks before the switch, a smoke test after it, rollback in one command and four measures to watch. The same habit can be brought to a team that ships once a month.

Published · 7 min read

Why small releases are safer

A release is a bet that the change does what you think. A large release is a large bet, placed rarely by people who are out of practice at shipping. When it fails, the suspect list is long, the diff is hard to read and the on-call engineer is the one reading it at night.

A small release changes the arithmetic. Fewer lines mean fewer interactions between changes. If something goes wrong, the cause is usually in the last thing you shipped, and reverting it is cheap. Shipping becomes ordinary, so the scripts get exercised daily and their bugs turn up early.

I run more than a dozen live products on a handful of Linux servers, and I carry the pager. That only works if every deploy follows the same path, every failure shows up quickly and every risky action has a way back.

Before the switch: a clean state, a lock and a build

The path starts before the build, and three rules do most of the work.

  1. Commit and push first. The release is built from the pushed head, so unpushed edits, stray files and half-finished experiments in someone's working folder stay out.
  2. Build from a clean copy. Export the pushed commit into a fresh directory and build there. That takes the "works on my machine" class of failure out of production.
  3. Check ancestry. Before the switch, confirm that the release currently live is an ancestor of the one you're about to ship. If it isn't, someone shipped something you haven't seen, and your deploy would silently overwrite it. Stop and look.

The ancestry check exists because of a failure. Several sites at CloudVerg were once rolled back when agent sessions deployed stale, unpushed copies over newer work. The rules above came out of that incident, along with a simple split: each site belongs to one session at a time.

Then take the lock. Only one heavy step, such as a build, a deploy or a browser sweep, runs on a host at a time, and it runs at low priority. A lock is a file or a small service that a script has to hold before it starts, so two busy people can't collide by accident.

On a host that's also serving traffic, run the targeted tests and keep the full suite in your pipeline, where it can take its time. Scheduled background jobs should check load and memory and skip a run when the machine is busy, recording it as skipped. A busy machine shouldn't page anyone.

After the switch: smoke tests and live equals committed

A deploy that exited cleanly has proved only that the script ran. A smoke test is a short, fast set of checks against the live site, run automatically after every deploy, and it shows whether the product works.

A good smoke test starts with six checks.

  • Every public page returns 200. Walk the whole sitemap or a maintained list, since the home page alone proves little.
  • Content types are right. HTML pages come back as HTML, scripts and styles as themselves and images as images. A server that answers 200 with an error page in the wrong type is a classic silent failure.
  • Security headers are present on every response: content security policy, transport security, and frame and content-type protections.
  • The sign-in page loads and a protected page refuses an anonymous request.
  • A health endpoint reports the expected version, and the database and cache respond.
  • One complete task passes. For a shop that's add to cart, and for a console it's creating and deleting a record.

Then verify that live matches committed. Ask the running service which commit it was built from and compare that with the commit you meant to ship. It sounds trivial, and it catches a deploy that went to the wrong host, a cache serving an old release or a second session that deployed on top of you.

If the smoke test fails, roll back automatically and then tell a person. The person decides what to do next with the failure in hand and the site already healthy.

Recovery time is half of the score

Teams often tune for deployment speed and forget the other side. In an incident, what matters is how long users were affected, and that depends on how fast you can undo a change. A team that can roll back in seconds can afford to deploy often, because a mistake is cheap. A team that needs an hour to recover will deploy rarely, and each deploy will carry more fear.

The DORA research gives the vocabulary. Four measures describe delivery performance: deployment frequency, lead time for changes, change-fail rate and time to restore service. More recent versions add rework rate. The measures are paired on purpose. In the teams that do well, throughput and stability rise together, and they only look like a trade-off when the release process is manual and fragile.

Track them where you can read them without effort. Deploys come from your pipeline logs, lead time from first commit to verified deploy, change-fail rate from rollbacks and hotfixes, and time to restore from incident open to incident closed. Put the four numbers on a page the whole team sees.

Bringing this to a team that ships monthly

A monthly release is usually the scar from one bad release. The answer was more ceremony and more waiting, which made the next release bigger and the next failure worse. The way out is to shrink the batch and strengthen the safety net together.

  1. Measure first. Write down current lead time and change-fail rate. You need a baseline to show progress, and it'll usually be worse than people think.
  2. Make the build repeatable. One command should build from a clean checkout, so fix everything that stops it.
  3. Add the smoke test, even a short one. Five checks that run every time are worth more than fifty that run when someone remembers.
  4. Make rollback one command and practice it on a quiet afternoon. Do it twice, so the team has walked the path before an incident needs it.
  5. Release the next change on its own, mid-week, as soon as it's ready. Start with a low-risk one.
  6. Move to weekly, then daily for the services with good tests. Use feature flags for work that can't ship in small slices.
  7. Hold a short review after every failed deploy. Ask what the path allowed, and fix the path.

The cultural change is slower than the technical one. People who've been burned need to see a few boring deploys in a row before they believe the new system. Give them that evidence, and tell them when something goes wrong. When a rollback does its job, share it with the team so they see the net hold.

If you're moving a team to smaller releases, start with the lock and the smoke test. They pay for themselves in the first month.

TopicsReliability, releases and operations