Zero-downtime infrastructure before launch
Downtime is solved by three habits tested before launch, not by a pricier server: isolated environments, a verified restore, and alerts before your customer.
- Infrastructure
- Cloud
- Monitoring
- Topic
- Engineering
- Sections
- 5
- Date
- Reading
- 10 min read
- Author
- Codk Team

In this file
Opening
Where the question starts.
Downtime is not decided at the server. It is decided in the gap nobody measured: a path no test ever walked, a backup nobody ever restored, a maintenance window the person holding the decision never read. A product before launch looks stable because little traffic touches it, and that small amount of traffic is exactly what hides the failure. When something does fall over, the first hour usually goes to searching, not fixing. Who opens the dashboard? Where is the key? Is last night's dump intact? Every one of those questions could have been answered before launch in a single written line. Recovery is not an engineering mood borrowed under pressure. It is a set of small decisions taken early and rehearsed at least once.
The early outages are rarely exotic and rarely expensive to prevent: a change tested straight on production because it was faster, a copy taken every night and never restored, an alert landing in a mailbox left behind by the first engineer, a certificate expiring on a date nobody watches, a scheduled job running for months with no clear owner. None of these is really a technical failure. Each is a function with no person attached. Boredom does the damage: every item is dull enough for everyone to postpone, and then it becomes an incident at the worst possible hour. The answer is not a bigger server. It is folding these functions into the release itself: a list that gets reviewed, an alert with a name beside it, a rehearsal that is run rather than described. A recurring review is what keeps those items alive: a fixed date every few months, an owner written beside each line, and a short record of what was actually tried and what stayed on paper.
Body
What the file says, in detail.
Why we plan for recovery, not for launch
A launch plan runs on the happy path. The page loads, the payment clears, the user finishes. By definition it is incomplete, because it assumes everything works at the exact moment nothing does. A recovery plan starts from the opposite question. Which single component takes the whole service down if it stops? Then: what happens precisely when it stops? One specific first step, not "we handle it". Write that list before the launch checklist, and put one owner's name against every line. A line with no owner does not get executed at two in the morning, however obvious it looked in daylight. Authority is written down alongside it: a team hunting for permission at two in the morning does not move, however good the document in front of them.
You can see the difference between the two plans in the first hour. A site with a written recovery knows who calls whom, which button gets pressed, and what the customer is told. A site without one spends that hour assigning blame. One rehearsal before launch surfaces exactly what the incident would surface later, except the clock is on your side. The cost is not in tooling: alerts and snapshots ship with every cloud platform in some form. The cost is sitting down to write the steps and then running them seriously, once. That bill is paid a single time. The unprepared outage is paid every time it catches you. Keep one note after each rehearsal: the step that took longer than expected. That is the step that will eat the time on the real night.
- Which one component takes the whole service down if it stops: the database, the domain, the load balancer, the payment provider? Name it first.
- What does the application do when the database is unreachable: wait, retry, or show a message a person can read? Decide now, not in the moment.
- What happens when an external provider stops answering: does the request sit in a queue, or disappear without a trace?
- Who takes the call at three in the morning, on what number, and who is next when they do not pick up?
- What stays deliberately switched off during the first hour: reports, exports, image processing, or background jobs?
Environments and backups: what actually gets tested
Separating development, staging and production is not housekeeping. It is how you bound the blast radius. A test run on production differs from a test run on staging in exactly one respect: it cannot be undone. Write the infrastructure as code so configuration becomes a file in the repository, reviewable, diffable, rebuildable. The practical test is one question: can you build a clean environment from the repository alone, with no step that exists only in someone's head? Then backups. Decide first what you can afford to lose and how long you can be off the air; those two answers shape the backup design, not the other way round. And a copy becomes a backup only after a full restore: complete data, the application running on top of it, a checklist followed in order. Run the rehearsal in a separate environment, give every step a name, and record the gap between expected and actual time in the checklist rather than in memory. Secrets do not belong in the repository either; they live in a dedicated store the deployment can reach. Infrastructure everyone can read is not infrastructure. It is a documented hole.
- A restore environment fully detached from production, with no route that lets restored data write back over the live database.
- A written checklist where every step has a person, a start time and an end time. No step that "whoever knows" finishes.
- A full restore, not a partial one: database, uploaded files, configuration and secrets.
- A completeness check that compares numbers: row counts, the newest record, the integrity of the relationships between tables.
- The application pointed at the restored data with real pages loaded against it, then every step that needed unwritten knowledge written down.

Monitoring that reaches you before your customer does
Monitoring that sends no alert is a dashboard somebody opens after a visitor complains. And an alert with no written first action is a bell ringing in a room where people argue. Choose what you measure by what you can do about it: does the site answer from outside your network, what share of requests fail, how long the response takes, whether queues are growing, whether last night's copy completed. Deliver the alert to whoever is genuinely reachable, on the channel they actually open at that hour, not to an inbox read at breakfast. Beside every alert write the one line: the first thing its recipient does. If you cannot write that line, the alert is not an alert. It is noise. Start measuring where the user stands: a healthy server inside and a page that will not open from outside is a full outage.
Noise is itself a cause of downtime. A channel that rings every night for a condition nobody acts on trains the whole team to mute it, and on the night the real failure lands the mute got there first. So delete every alert that does not change behaviour; a threshold that triggers no action is decoration, not protection. Keep a quiet channel for what can wait until morning and one loud channel for what cannot, and never let the two share a destination. Add the customer-facing half as well: a status page or a prepared sentence published when the time comes, because silence leaves the gap to whoever guesses first. The person who owns the first sentence owns half the incident. The one waiting for a press statement owns none of it. Update the page during the incident, not after it; a late first sentence doubles the number of questions.
- A probe from outside your network against the public front door. A healthy server behind an expired certificate is still an outage.
- One owner, one written first action, and one clear closing condition per alert.
- An escalation path: who gets told if the first person does not respond, after how long, on which channel.
- A minimum signal set that does not drift: failures, response time, backup success, disk space.
- A quiet channel for what can be read tomorrow, so nothing urgent competes with what needs attention now.
Peak day: the decision written before you need it
Peak day is a decision problem before it is a capacity problem. Autoscaling covers the load you predicted. The part you did not predict needs a written expansion path: which component scales first, who is allowed to run the change at that hour, what ceiling you accept, and what gets switched off on purpose so the critical path keeps serving. Design the rollback the same way, as a path rather than an improvisation. The previous build stays deployable, database changes are written so both versions can run against them, and going back takes one command that two people know. A rollback that needs a discussion in the middle of an incident is a hope, neatly formatted — not a plan. Before the peak starts, define the degraded mode you accept: which page stays up when half the system is down, and which job gets suspended first. During the first hour, watch one metric that belongs to the critical path, so nobody on call drowns in dashboards and comes back with two different stories about the state.
- The expansion order is written down: application replicas first, then read replicas, then cache, and who decides to move to the next step.
- An acceptable cost ceiling agreed in advance, so nobody negotiates money at midnight.
- A deploy freeze for the peak window, with rollback as the only exception. Announced before the day, not during it.
- A rollback trigger written as a measurable condition, not a mood: a named signal past its limit for a stated stretch of time.
- Two people who know how to go back, and one of them did not write the change.

How to test the plan without dropping production
- Restore a full backup into an isolated environment and run the application on it. Restores get tested where they cannot hurt anyone.
- Stop one application instance in staging and watch: does the load balancer redistribute, does an alert arrive, does anyone notice?
- Hand the runbook to somebody who did not write it and have them follow it literally. Every question they ask is a hole in the document.
- Run the rollback as an ordinary deploy in staging: the same command, the same permissions, the same duration.
- Test the alert path itself. A person on the other end confirms it arrived and states their first action. An unconfirmed alert is not ready.
Nobody builds a product so that something can knock it over. Failure is not a possibility you wish away, though. It is an event with a route: who sees it first, what they do, how the system comes back. What separates a launch people remember fondly from one they remember badly is not the hosting provider and not the size of the server. It is whether the decisions were written before anyone needed them. Start with a short list: three plausible failures, each with a name, a first action, and one rehearsal that actually ran. That is enough to turn an outage from a surprise into an incident with a procedure, and that is the real difference between a product that works and a product that holds. The first rehearsal is the hardest, because it exposes what you never wrote down. Every one after it moves faster.
Closing
Where it lands.
A backup that has never been tested is not a backup. It is an assumption.
Related files
What this file connects to.
service
Cloud Migration & DevOps
We move your systems to AWS, Google Cloud, or Azure, and run them with Terraform
- 01
A bot wins when it closes one repeated task: a recurring question, a booking, a 2 a.m. lead. It fails as a full employee. Pre-launch checklist.
Full dossier