Q11 · How do you handle partial failures in distributed systems?
Back to 24 Architecture Questions.
The question is not “add retries”. The axis it turns on: what the system does with an answer it cannot get, and whether half an answer is usable. A fan-out that queries five services will sometimes get four answers. The architecture is judged by what it does with the missing fifth: fail everything, serve four with the gap marked, or serve four and pretend nothing is missing.
What the answer should contain
Three postures, chosen per feature. Fail-all: the page refuses to render; correct, and the availability cost is real. Partial-and-marked: render without the missing panel, with the gap labeled; honest and usually right. Partial-and-silent: render without it and say nothing; this is the one that is always wrong, because it presents an incomplete answer as a complete one.
The decision is the product’s, made in advance. Which panels are optional? A product page without recommendations is a page; a checkout without a stock answer is not a checkout. Write the table before the incident, because deciding during the incident means deciding under time pressure with no data.
Give every fan-out call its own timeout. One per dependency, and one page-level deadline above them: the page does not wait for its slowest optional panel. A missing answer arrives as a value (“absent, budget spent”) into the assembly, not as an exception that kills it.
Distinguish absent from slow. A timeout is not an error, and an error is not a “no”. The handler should know which it received, because the marker shown to the user differs: “unavailable” (we tried) versus “we did not ask” (degraded by policy).
Retries live inside the dependency budget, not the page. The page-level deadline owns the total wait. A handler that retries its slowest call until the user gives up has turned one partial failure into one full failure.
Mark the partial answer in the response. The API or page states which parts are missing, so downstream consumers and users can distinguish degraded from complete. A silent partial poisons trust and, worse, downstream logic that assumes the answer is whole.
Ideas worth mentioning out loud
- The engineering half is timeouts and missing-value markers; the judgment half is the table of which panels are optional. Write the table before the incident, because deciding during it means deciding under time pressure with no data.
- Availability composes multiplicatively: five dependencies at 99.5% give about 97.5% if any failure fails all. Fail-all is a choice to multiply fragility; make it per panel, not per system.
- The fan-out shape makes the decision cheap: an aggregation point exists, so it is the natural place to apply posture and marking.
Follow-ups to expect
- What about consistency of the partial answer? Mark what is missing rather than guessing it; a labeled gap is honest, an interpolated value is a lie with good intentions.
- When is fail-all correct? Anything money- or safety-adjacent, and any feature whose absence makes the page legally or functionally wrong.
- How do you test it? Fault injection: kill or delay each dependency in turn and assert the posture that was designed, not the one that happens.
Red flags in an answer
- Silent partials: the missing panel simply vanishes.
- A blanket catch around the whole aggregation.
- Retries that ignore the page-level deadline.
- No recorded product decision on which features are optional.
Sources
- The Tail at Scale, Jeffrey Dean and Luiz Barroso, CACM 2013: a fan-out’s latency is set by its slowest shard, and the hedged-request and degradation techniques that follow. The canonical statement that partial slowness, not average latency, is what users experience.
- Addressing Cascading Failures, Google SRE Book, chapter 22: load shedding and the fail-fast posture that keeps one dependency’s failure from becoming the page’s failure.