Reference Guide · DevOps

Designing for Failure

A system whose failure modes nobody knows is not finished — it just hasn't had a bad day yet. In a real system, everything fails eventually; the question is not whether, but how the system responds. How to design for failure instead of hoping against it. A decision document for CTOs, architects and senior engineers.

What is this? · Reference Guide

A solid guide to an engineering question — with trade-offs, costs and the case in which we decide differently. Not an opinion piece, but a reference text. Go to overview

Author
Batunet Engineering
Reading time
16 min
Level
In depth
Status
Approved
Last reviewed
21 July 2026
Updated
21 July 2026
On this page

Most systems are built for the good day — for the case where everything works, every connection responds, every service is reachable, every assumption holds. That is understandable, because the good day is the common one. It is also the reason so many systems fail on the bad day: they were never designed for it. Software is not judged on its good days but on its bad ones — and the bad day reveals whether anyone thought about it beforehand.

This document covers designing for failure — the discipline of building systems so that they withstand the inevitable failure of their parts instead of breaking apart. It is deliberately neutral with respect to frameworks and clouds, because it is about a mindset, not a tool. It is the flip side of observability: observability shows that something is going wrong; designing for failure ensures that the thing going wrong does not drag the whole system down with it. No figures are given.

1. Everything fails eventually

The one assumption that changes everything is simple: in a real system, every part fails eventually. A connection drops, a service doesn't respond, a disk fails, a call takes too long, a neighboring system is overloaded. That is not a rare exception you can afford to ignore but the normal state of a system that runs long enough and consists of enough parts. Whoever assumes the parts will work is building on an assumption that time will disprove.

Reversing that assumption — assuming the parts will fail and asking what happens then — is the core of the discipline. It requires not pessimism but realism: you plan for what is certain to happen instead of hoping it won't. A system designed for the failure of its parts has an answer on the bad day; one that never considered it has only surprise. The difference is decided long before the incident, in the design. You cannot prevent the bad day — you can only decide whether you meet it prepared or surprised, and that decision is made while everything is still calm.

Trade-off. Assuming failure means designing more than the good case — effort that only pays off on the bad day, which you don't see during design.

Cost. Building for failure makes systems more complex for now and slower to build, because you handle cases that rarely occur in testing.

When we decide differently. For a short-lived, non-critical system whose failure has no consequences, full failure design is overkill; its value grows with the number of parts, the length of operation and the damage an outage causes.

2. Known and unknown failure modes

A failure mode is a way in which a system can fail. Some you know: you have considered them, handled them, perhaps even rehearsed them. Others you don't — they arise from a combination of circumstances nobody anticipated and show up for the first time in production. The mature approach is not to know every failure mode — that is impossible — but to handle the known ones cleanly and build the system so that even an unknown failure does not immediately bring down the whole.

This yields a yardstick for completeness: a system whose failure modes nobody knows is not finished, merely untested. As long as you cannot say what happens when this service fails or that connection drops, you have built the system only for the good day. Asking "what happens if this fails?" for every part is the exercise that brings known failure modes to light while you can still handle them — and that shows where you have to rely on containment because you cannot prevent the failure.

Failure modeDo you know it?Approach
Known, consideredyeshandle cleanly, rehearse if possible
Known, unhandledyes, but ignoredthe ticking clock — handle it before it occurs
Unknownnocontainment, so it doesn't bring down the whole

Trade-off. Deliberately searching for failure modes costs time in design and the willingness to ask uncomfortable "what if" questions while everyone wants to see the system finished.

Cost. The search is never complete; you find the known ones, not the unknown ones, and have to live with the remainder you didn't foresee.

When we decide differently. Where a part is obviously non-critical and its failure has no consequences, you skip the deep analysis; attention goes to the parts whose failure affects the system or its users.

3. Contain failures, don't prevent them

You cannot prevent failures — you can only limit their consequences. That is the central shift: away from the hopeless goal of nothing ever failing, toward the achievable one of a single part's failure not dragging down the whole. To do this, you isolate the parts from one another, so that a failure is stopped at its boundary instead of spreading. An overloaded or failed part must not pull the others down with it; it is cut off, its failure stays local, and the rest of the system keeps working.

without containment: one fails, the failure drags all down with containment: one fails, the boundary keeps it local

Diagram: Without a boundary, an outage propagates through the entire system; with a boundary, it stays where it originated. Containment beats prevention.

Containment also means never relying indefinitely on another part's response when calling it: you don't wait forever, only for a limited time, and you treat the absence of a response as what it is — a failure you are prepared for. A call without a timeout is an open door through which a neighbor's outage enters your own system.

The most important tools of failure design at a glance — each a design stance, not an after-the-fact setting:

ToolWhat it achievesIts price
Isolationkeeps a part's failure localdesigning and maintaining boundaries
Timeoutprevents someone else's waiting from spreadinghandling the edge cases of a missing response
Safe retryheals transient failuresmaking operations idempotent
Graceful degradationpreserves the main task during partial failurebuilding several levels of functionality

A particularly effective containment pattern is to temporarily stop calling a part that fails repeatedly. Instead of running into a closed door again and again and tying up resources in the process, the system recognizes that a neighbor isn't responding right now and leaves it alone for a while — it immediately falls back to the intended failure handling and only tries again after a pause. This protects two sides at once: your own system, which doesn't suffocate in hopeless retries, and the overloaded neighbor, which gets a chance to recover instead of being pushed further under water by requests. Containment here means not only keeping the failure local, but also not making it worse through blind persistence.

Trade-off. Containment buys resilience with boundaries and isolation that you have to design and maintain — structure that seems superfluous in the good case.

Cost. Every boundary, every timeout, every cutoff is additional logic with its own edge cases that you have to understand and test.

When we decide differently. In a small, tightly coupled system whose parts stand and fall together anyway, isolation brings little; its value grows with the independence of the parts and the damage that propagation would cause.

4. Safe retries

Many failures are transient: a connection drops briefly, a service is overloaded for a moment, a call runs into a timeout. Responding to such failures with a retry is obvious and often right — but only if the operation can safely tolerate a retry. Blindly retrying an operation that takes effect twice when executed twice turns a harmless transient failure into real damage: a double charge, a duplicate order, a duplicate effect nobody wanted.

That is why retries and idempotency are inseparable. You only retry what can be repeated without harm — and you make sure that operations which change state or move money have this property before you retry them automatically. A safe retry is therefore not merely an operational setting but a design decision: you build operations so that a second attempt has the same result as the first. Whoever retries without ensuring this has not handled the failure but doubled it.

Trade-off. Safe retries buy recovery from transient failures at the cost of making operations idempotent — mechanics you build and maintain.

Cost. Establishing idempotency requires state and care around concurrency; that is real work, incurred for every retryable operation.

When we decide differently. Pure reads and naturally idempotent operations are retried without extra effort; the care applies to operations that are not inherently repeatable — those you only retry once they are (see Idempotency in distributed systems).

5. Graceful degradation instead of total failure

When a part fails, there are almost always more than two options. Between "everything works" and "nothing works" lies a wide field: the system can continue fulfilling its most important task while a secondary one pauses; it can deliver an older, cached response instead of none; it can temporarily switch off a feature instead of collapsing. Graceful degradation means deliberately designing these intermediate levels, so that the failure of a part leads to less functionality, not none.

full functionality secondary feature off core task only total failure

Diagram: Between full functionality and total failure there are levels. Graceful degradation steps down them instead of falling — the dashed level is only reached when no other level holds.

The value lies in the fact that a user almost always prefers a partial service to a complete outage. A system that switches off a secondary feature when there is a problem and keeps carrying the main task seems reliable; one that comes to a complete halt at the first failure seems fragile — even though perhaps only a small part was affected. Designing degradation means deciding in advance what is important enough to preserve under failure and what is dispensable enough to drop. You set this order at the desk, not during the incident.

Trade-off. Graceful degradation buys reliability during partial failure at the cost of designing several levels of functionality instead of just all-or-nothing.

Cost. Every degradation level is a state of its own that you build, understand and test; too many levels can make the system itself complex and hard to see through.

When we decide differently. Where partial functionality has no value — an operation only makes sense in full or not at all — you don't design degradation; it pays off where a remainder of functionality still serves the user.

6. Rehearsing failure

You don't know whether a system can withstand an outage until you have tried it. The most dangerous assumption in resilience is that a safeguard works simply because you built it — the backup that was never restored, the fallback that never triggered, the timeout that never kicked in. Such untested safeguards are not protection but hope with the appearance of protection. Only when you deliberately induce the failure and observe whether the system reacts as intended do you know the resilience is real.

Rehearsing failure is therefore not a luxury but the only way to prove resilience rather than claim it. You deliberately switch off a part and check whether containment holds; you let a response fail to arrive and check whether the timeout kicks in; you restore a backup so you know you can when it matters. What you have not rehearsed, you must not count as protection. This exercise turns presumed resilience into proven resilience — and exposes the gap while it is still cheap to close, instead of during a real incident.

Trade-off. Rehearsing failure costs time and a little courage to deliberately disrupt a running system — in exchange for knowing the resilience rather than hoping for it.

Cost. Rehearsals require preparation and a safe setting so that the exercise itself does no real damage — effort that only shows in the outage that was avoided.

When we decide differently. For a non-critical system whose failure has no consequences, thinking the safeguards through is enough; active rehearsal pays off where a real outage causes serious damage.

7. Making failure visible

Designing for failure presupposes noticing failure. Even the best containment, even the cleverest degradation is of no use if nobody sees that it is currently in effect — then the system does keep working, but unnoticed in a damaged state, and the actual fault remains unexplained until it gets worse. Resilience and observability therefore belong together: one ensures that a failure doesn't drag down the whole; the other ensures that you see it and can respond.

Concretely, this means the failure itself must be visible — not just the total outage, but also the silent partial failure, the triggered fallback, the timeout that kicked in. A system that degrades gracefully without reporting it hides its own wounds; you think it is healthy while it is bleeding. Safeguards for failure must therefore be designed so that their triggering is noticed — in the sense of observability as an architectural principle, which is the prerequisite for responding to failures at all.

Trade-off. Making failure visible buys the ability to respond at the cost of instrumenting every safeguard — including those that never trigger in the good case.

Cost. This instrumentation is additional work in places that are rarely active, and it has to be maintained so that it reports reliably when it matters.

When we decide differently. Where a safeguard is so non-critical that its silent triggering has no consequences, you can do without instrumentation; it is mandatory where an unnoticed partial failure can get worse.

8. Common mistakes

The recurring patterns on which systems fail on the bad day — almost all of them are variants of having built only for the good day:

  • Assuming the parts will work instead of designing for their inevitable failure.
  • Considering a system finished without knowing what happens in the known failure cases.
  • Trying to prevent failures instead of containing them — and losing the entire system at the first unforeseen failure.
  • Calling other parts without a timeout, so that a neighbor's outage enters your own system.
  • Automatically retrying non-idempotent operations — turning a transient failure into double damage.
  • Knowing only all-or-nothing where graceful degradation would have preserved a remainder of functionality for the user.
  • Counting safeguards as protection that were never rehearsed — the backup that was never restored, the timeout that never triggered.
  • Degrading gracefully in the failure case but not reporting it — the system keeps bleeding unnoticed.

9. Decision checklist

When designing a system for failure, clarify in order:

  • Failure assumed? Is the system designed for its parts to fail — not for them to work?
  • Failure modes known? Has it been asked for every important part what happens when it fails?
  • Contained? Does a part's failure stay local instead of spreading — through isolation and timeouts?
  • Safely retryable? Are only idempotent operations retried automatically, so that a second attempt does no harm?
  • Graceful degradation? Are there intermediate levels between full functionality and total failure that preserve the main task?
  • Rehearsed? Have the safeguards been deliberately triggered rather than merely built — does what is supposed to protect actually hold?
  • Visible? Is the triggering of every safeguard noticed, including the silent partial failure?
  • Proportionate? Is the effort proportionate to the damage — strict where an outage would be expensive, lean where it has no consequences?

If you can answer these questions, you have built a system that survives the bad day — not just one that works on the good day.

FAQ

Can't you simply make sure nothing fails? No. In a real system, every part fails eventually — a connection, a service, a disk, an overloaded neighbor. That is the norm, not the exception. That is why the goal is not to prevent failures but to limit their consequences, so that the failure of one part doesn't drag down the entire system.

What does "a system is not finished if its failure modes are unknown" mean? That a system for which nobody can say what happens in the known failure cases has been built only for the good day. As long as you don't know what happens when this service fails or that connection drops, you haven't considered the bad day — and software is judged on the bad day.

Why are retries without idempotency dangerous? Because an operation that takes effect twice when executed twice causes real damage through a blind retry — a double charge from a harmless transient failure. You only retry what can be repeated without harm, and you make operations that change state or move money idempotent before you retry them automatically.

What is graceful degradation? The deliberate design of intermediate levels between full functionality and total failure: switching off a secondary feature while the main task continues; delivering an older response instead of none. A user almost always prefers a partial service to a complete outage. Which functionality you preserve under failure and which you drop is decided in the design.

Why do you have to rehearse failure? Because an unrehearsed safeguard is not protection but hope with the appearance of protection — the backup that was never restored, the timeout that never kicked in. Only when you deliberately induce the outage and observe whether the system reacts as intended is resilience proven rather than claimed.

How does this relate to observability? Inseparably. Resilience ensures that a failure doesn't drag down the whole; observability ensures that you see it. A safeguard that triggers silently without reporting it hides the system's wound — you think it is healthy while it keeps running in a damaged state. That is why every safeguard for failure must be designed so that its triggering is noticed.

Further reading

It is grounded in the Batunet Engineering Method: design for failure, contain uncertainty, rehearse resilience instead of hoping, observability from day one.

Closing engineering principle

A system is only finished when you know how it fails. The good day asks no questions; it forgives every carelessness, because nothing goes wrong. Only the bad day tests whether anyone thought about it beforehand — and on that day it is too late to start thinking about it. That is why designing for failure is not an extra for especially critical systems but the sign that a system has been thought through to the end. You don't build a system that never fails — no such thing exists — but one that fails without breaking. The difference between the two is decided long before the incident, in the quiet moment of design.


Software is not judged on its good days but on its bad ones. Everyone builds for the good day; the difference shows in whether anyone also built for the bad one.

Referenced entities

A concrete project in this field?

Reference Guides show how we think. To discuss your system, talk directly to our management.