Skip to content

Fallback

A fallback is a predefined alternative used when the primary option fails or is unavailable; the term comes from aviation, where a fallback airfield is the destination an aircraft diverts to when the primary destination is unreachable.

Definition

What it is

A fallback is not a retry. A retry reattempts the primary; a fallback switches to a different one. font-family: "Inter", Helvetica, sans-serif falls back to Helvetica, then to the system sans-serif, when Inter is unavailable. A CDN falls back to origin when its cache is cold. A JavaScript catch falls back to a default value when a parse fails. A DNS resolver falls back to a second nameserver when the first times out.

The property that makes a fallback valuable is predictability. The fallback path must be tested as carefully as the primary, because it will be exercised only under stress, when the primary is already failing.

Why it matters

A service without fallbacks has a binary outcome: works or does not. A service with fallbacks has a spectrum: full quality, degraded quality, minimal functionality. The spectrum is what users experience as reliability. The fallback does not make the primary work better; it makes its failure cheaper.

Fallback vs retry vs failover

Aspect

Retry

Fallback

Failover

What it repeats

Same call

Different call

Same system, other instance

Latency

Adds delay

Adds switch cost

Adds election cost

Example

Retry an HTTP 503 twice

Use cached response

Promote standby DB

Best for

Transient failures

Permanent failures

Instance crashes

Risk

Thundering herd

Stale fallback data

Split-brain

Where fallbacks live

graph TD
  U[User request] --> P[Primary path]
  P -->|Success| S[Return result]
  P -->|Failure| F[Fallback path]
  F -->|Success| D[Degraded result]
  F -->|Failure| E[Error page]
  style P fill:#E8F5E9
  style F fill:#FFF3E0
  style E fill:#FFEBEE

How to design a good fallback

Designing a fallback that helps

  1. Test it

    A fallback tested only in production is a fallback that will fail in production. Exercise it periodically, even when the primary is healthy.

  2. Make it observable

    Every fallback event is a metric. A fallback that fires silently hides a broken primary.

  3. Do not let it become the default

    A fallback that works too well can hide the primary's failure indefinitely. Add alerts.

  4. Keep it simple

    A fallback that depends on the same component that failed is not a fallback.

Common failures

Origin

In early aviation, a fallback field was the strip a pilot diverted to when the primary airfield was fogged in, damaged or otherwise unreachable. The word was a compound of fall (to descend, to drop back) and back (to a prior point), used literally: a field to fall back to. From aviation it passed to military strategy ("fallback position"), then to computing in the 1970s as a general pattern for graceful degradation. The image survives: a fallback is a place you can land safely.

A fallback is not a plan B. It is a landing strip you build before you need it.

— Paraphrased from Barry Boehm, *Software Engineering Economics*, 1981
1920s · "fallback field" en aviación
1970s · fallback en computación (graceful degradation)
2004 · Fallback en CSS2 font matching
2013 · Fallback routing en microservicios (Netflix)
100% · cobertura que debe tener un fallback, igual que el primary

Evidence

FAQ

Fallback vs retry?

A retry repeats the same call. A fallback switches to a different path. Retries handle transient failures; fallbacks handle permanent ones.

Fallback vs failover?

A failover switches to a standby instance of the same system. A fallback switches to a different, usually simpler, mechanism.

Should every call have a fallback?

No. Fallbacks add complexity. Add them where the cost of failure is high and the alternative path is genuinely useful.

Why test the fallback?

Because in production it fires only when the primary is already failing. A fallback tested only in prod is tested for the first time during an incident.

Connections

Etymology

Origin: compound

  • fall (verb): Old English feallan, to descend, drop back
  • back (adverb): Old English bæc, to a prior point

Semantic network

FallbackreliabilitresilienceRetryCircuit brGraceful dFailoverObservabil

● broader ● narrower ● related

Used in the garden

Sources