Standalone conceptPatternChapter III · Operations · Building block 6 of 17

Fallback

A failed dependency can block a specific user function entirely.

  1. TriggerTrigger: A defined failure path activates the substitute response.
  2. SubstituteSubstitute: A substitute provides limited functionality.
  3. DisclosureDisclosure: Users and operators can identify the substitute state.

Context

Why this is important

Protect specific functions with a deliberate substitute.

Protect specific functions with a deliberate substitute.

Shop example · Mapping

Fallback: inspect the decision

The shop example uses the existing shared database and seven modules. Any added service or deployment model is a hypothetical extension. The shop serves recommendations from a cache while its recommendation service is unavailable. The fallback affects recommendations only; cart, price validation, and payment follow their own rules. The result carries a timestamp, and use of the cached value ends after five minutes. Monitoring counts fallback responses separately from normal ones. Once the dependency recovers, the normal path resumes.

This is how you read the picture

  1. Trigger Trigger
  2. Substitute Substitute
  3. Disclosure Disclosure
Fallback: inspect the decision
ConceptMeaningReview question
TriggerA defined failure path activates the substitute response.Which function continues during recommendation-service failure?
SubstituteA substitute provides limited functionality.What must the cache fallback check?
DisclosureUsers and operators can identify the substitute state.Why is the same fallback not automatically suitable for payment status?
Der Ersatz muss fachlich zulässig sein und seine Herkunft erkennbar halten. Veraltete Preise oder falsche Berechtigungsentscheidungen können schädlicher sein als eine klare Fehlermeldung; Fallbacks brauchen darum Frischegrenzen und einen Rückweg. Use the questions in the second column to test this scenario.

Benefits & limitations

Helps if:

  • Protect specific functions with a deliberate substitute.
  • Define permitted substitute data and maximum age for each function.

Boundaries

  • A substitute path can return incorrect or misleading business data.
  • A cache fallback can suit recommendations, but not automatically authoritative prices or payment status.

In practice

  1. Define which cached recommendation fields are acceptable as fallback and how their timestamp appears in the UI; keep price, cart, and payment status separate.
  2. Disable the recommendation service in a test and measure how long the cached value is used; check the five-minute limit and behavior for older data.
  3. Monitor fallback calls and errors separately from normal responses, and test whether the shop returns safely to the normal path after the dependency recovers.
Read the detailed explanation

A fallback selects an alternate path or substitute response when a dependency fails. It keeps a specific function usable, for example with a cached value or a reduced result.

The substitute must be valid for the business context and its origin must remain visible. Stale prices or incorrect authorization decisions can be worse than a clear error; fallbacks therefore need freshness limits and a recovery path.

The shop example uses the existing shared database and seven modules. Any added service or deployment model is a hypothetical extension. The shop serves recommendations from a cache while its recommendation service is unavailable. The fallback affects recommendations only; cart, price validation, and payment follow their own rules. The result carries a timestamp, and use of the cached value ends after five minutes. Monitoring counts fallback responses separately from normal ones. Once the dependency recovers, the normal path resumes. fallback degradation and graceful degradation help compare this decision with adjacent concerns.

Check your understanding

Test yourself in three stages

  1. ReadingCheck in the picture

    Which function continues during recommendation-service failure?

    View the solution with justification

    Recommendations are served from a cache with a defined freshness limit.

  2. ApplyingTransferred to a new situation

    What must the cache fallback check?

    View the solution with justification

    The value age and business validity, plus disclosure of the fallback state.

  3. EvaluateWeighing an alternative

    Why is the same fallback not automatically suitable for payment status?

    View the solution with justification

    Stale payment status could trigger a duplicate charge or a false order confirmation.

Continue on the learning path

Next in Runtime & operations: Bulkhead.

17 Building blocks

Continue withBulkhead