liveBook · Manning

Fallback

A fallback is an alternative behavior, result, resource, or processing path selected when a preferred option fails, is unavailable, or is inadequate.

How 24 Manning books explain it

The Art of Code

A fallback is an alternative behavior or result selected when the preferred operation is unavailable or unsuccessful.

How it is used
Uses fallbacks to keep applications useful during technical failures and make failure paths explicit.
How deep it goes
Explains retry, circuit-breaker recovery, and fallback choices, with review criteria against hidden failures and unjustified business-rule changes.
Examples
Illustrates cached responses after remote failures, actionable error messages, reduced image quality, and temporary read-only mode.
What you can do after
Evaluate failure paths and choose an acceptable alternative without hiding failures or changing business rules without justification.

Read how The Art of Code explains fallback →

Grokking Software Architecture

Fallback logic provides an alternative behavior when a preferred operation or dependency fails.

How it is used
Provides an alternative response when a preferred operation or downstream dependency fails, helping preserve transactions through graceful degradation.
How deep it goes
Defines fallback responses and their business tradeoffs, then asks readers to design a payment-outage fallback.
Examples
Illustrates flat-rate shipping, fixed recommendations, queued orders, and an identical backup computer that fails alongside the primary.
What you can do after
Evaluate/understand it by choosing a defensible alternative that preserves customer progress while accepting an explicit business tradeoff.

Read how Grokking Software Architecture explains fallback →

Natural Language Processing in Action, Second Edition

A fallback response is a predefined chatbot reply provided when no recognized intent meets the required confidence level.

How it is used
Provides a recovery path when a chatbot cannot handle input or generated content may not be grounded.
How deep it goes
Explains threshold-based triggering and recovery options without specifying how to calibrate the threshold.
Examples
Uses a math tutor conversation diagram and suggests choices, other functionality, or a human representative as recovery options.
What you can do after
Apply it by specifying a default action, setting an intent-confidence threshold, and offering users a way to continue.

Read how Natural Language Processing in Action, Second Edition explains fallback →

Prompt Engineering in Practice

A predefined response or processing path used when input is malformed, incomplete, invalid, or manipulated.

How it is used
Routes out-of-scope or conflicting requests to a specified response instead of leaving refusal wording to the assistant.
How deep it goes
Defines an exact trigger and response, demonstrates adversarial tests, and places fallback alongside other prompt-hardening techniques.
Examples
Uses a code review assistant asked to change personas and a support chatbot asked to disclose customer orders.
What you can do after
Operate/configure it as an exact system-prompt response for requests outside a defined task, then test whether it fires.

Read how Prompt Engineering in Practice explains fallback →

CSS in Depth, Second Edition

Fallback is the font-display value that permits a brief invisible-text period, then uses the fallback font until the web font loads.

How it is used
Balances brief invisible text against an immediate fallback font while a web font loads.
How deep it goes
Explains the visible loading sequence and connection-speed trade-offs, but defers deeper web-font performance treatment.
Examples
Uses a Google Fonts `&display=swap` URL parameter that can be changed to select `fallback`.
What you can do after
Operate/configure it by selecting `font-display: fallback` in `@font-face` or a Google Fonts URL.

Read how CSS in Depth, Second Edition explains fallback →

Vanilla Web

An alternative implementation or behavior used when a preferred feature or supplied content is unavailable.

How it is used
Keeps core web experiences usable when preferred APIs, supplied slot content, routing features, or deployment paths are unavailable.
How deep it goes
Works through slot defaults, limited route matching, navigation behavior, and server rewrites without requiring alternatives to duplicate every preferred feature.
Examples
Uses an out-of-stock slot default, a regex route matcher, and an index.html server rewrite for application paths.
What you can do after
Build it from scratch by defining a smaller supported behavior, checking availability, and preserving usable content or navigation.

Read how Vanilla Web explains fallback →

Microservices Patterns, Second Edition

A fallback pattern supplies a degraded but useful result when the primary operation or dependency fails.

How it is used
Maintains useful responses when synchronous dependencies fail, especially for queries composed from multiple services.
How deep it goes
Explains cached and hardwired strategies, their constraints, and an annotated fallback method.
Examples
Uses an order query with unavailable delivery or kitchen data, fixed restaurant recommendations, and an authorization fallback returning false.
What you can do after
Apply it via Resilience4j annotations or select replacement data for a provider proxy.

Read how Microservices Patterns, Second Edition explains fallback →

Machine Learning System Design

A fallback is an alternative behavior or implementation used when the primary behavior or system cannot operate normally.

How it is used
Maintains ML-system decisions when the primary model fails, is unavailable, or produces an unsatisfactory prediction.
How deep it goes
Describes alternative implementations and selection rules, with a tiered monitoring-and-switching strategy.
Examples
Uses manufacturing equipment-failure prediction and a retail demand system with time-series and previous-week alternatives.
What you can do after
Apply fallback strategies by choosing backup responses and identifying conditions for switching to them.

Read how Machine Learning System Design explains fallback →

Spring Microservices in Action

A pattern that provides an alternative way for a client to carry out work when a service call fails.

How it is used
Provides an alternative client code path when a remote service call fails or is interrupted.
How deep it goes
Defines fallback processing and walks through Hystrix annotation and method-signature requirements with a placeholder response.
Examples
Illustrates general recommendations from another data source and a licensing response containing placeholder information.
What you can do after
Apply it via Spring Cloud and Netflix Hystrix by configuring and defining a fallback method.

Read how Spring Microservices in Action explains fallback →

Designing AI Systems

A fallback is a failure-handling strategy that switches to an alternative provider or execution path when the primary one fails.

How it is used
Provides configurable recovery when model providers fail, while keeping execution inside the model service.
How deep it goes
Explains failure-specific retry and fallback configurations, operational tradeoffs, and the limits of recovery during streaming.
Examples
Contrasts a patient-facing cloud-to-local chain, a batch pipeline without fallbacks, and cheaper alternatives for rate-limited requests.
What you can do after
Operate and configure fallback chains and retry policies for availability, batch processing, or cost-sensitive workloads.

Read how Designing AI Systems explains fallback →

The Coder Cafe

A fallback is an alternative behavior or result used when a preferred operation or dependency is unavailable.

How it is used
Keeps services useful when load or dependency failures prevent normal operation.
How deep it goes
Explains fallback choices through load shedding, queue ordering, and dependency classification, but does not specify a fallback implementation.
Examples
Uses database overload during Kubernetes autoscaling and FIFO-to-LIFO request handling under heavy load.
What you can do after
Practice/perform dependency classification and continuous fallback testing to keep service available when a dependency fails.

Read how The Coder Cafe explains fallback →

Effective Conversational AI

A fallback path is a conversational handling route for input that cannot be understood or handled by the primary flow.

How it is used
Routes unrecognized or unsupported requests to rephrasing, search, generative AI, or human assistance.
How deep it goes
Compares routing choices and gives a threshold example, while leaving platform-specific agent integrations unexplored.
Examples
Uses a Cake Bot response threshold, inadequate retrieval results, and utility-company routing for out-of-scope requests.
What you can do after
Apply fallback routes by limiting repeated prompts, offering agents, or directing requests to search or another suitable handler.

Read how Effective Conversational AI explains fallback →

React Hooks in Action: With Suspense and Concurrent Mode

A fallback is alternate user-interface content displayed while the intended content is unavailable or an error has occurred.

How it is used
Provides alternate UI while lazy components, data, images, or other promise-backed resources load or fail.
How deep it goes
Explains boundary selection, replacement behavior, and custom error handling, but treats data fetching through Suspense as experimental.
Examples
Uses loading calendars, messages, user avatars, and customizable error screens with reload instructions.
What you can do after
Build and configure loading and error states with Suspense, fallback props, and ErrorBoundary components.

Read how React Hooks in Action: With Suspense and Concurrent Mode explains fallback →

Tiny CSS Projects

An image fallback is an alternative presentation or behavior provided when an image resource fails to load.

How it is used
Keeps image content and image-based styling usable when resources fail or browser features are unavailable.
How deep it goes
Works through broken and restored image states with onerror, then explains CSS color alternatives for image backgrounds and text effects.
Examples
Uses a deliberately broken newspaper image, an image-filled heading, and a credit-card background with a blue fallback.
What you can do after
Build it from scratch using meaningful alt text for content images, onerror for decorative images, and CSS fallback colors.

Read how Tiny CSS Projects explains fallback →

AI Model Evaluation

An alternative system behavior or response used when a preferred processing path or primary component is unavailable or fails.

How it is used
Protects user-facing AI experiences when preferred serving paths fail or miss performance requirements.
How deep it goes
Defines fallback triggers and observability needs, then stops short of prescribing a specific fallback implementation.
Examples
Uses default or static recommendation rankings when real-time predictions cannot be fetched or processed acceptably.
What you can do after
Diagnose fallback frequency by correlating paths with latency, errors, bottlenecks, and downstream user behavior.

Read how AI Model Evaluation explains fallback →

Grokking AI Applications

A prompt instruction that specifies an alternative response when the model cannot complete the requested task or find the requested information.

How it is used
Uses fallback instructions to make prompting more reliable and prevent inaccurate or misleading responses.
How deep it goes
Defines the technique and demonstrates its wording, but does not develop implementation steps or model internals.
Examples
Uses a text-query example that returns “not found” when the requested answer is absent.
What you can do after
Apply it via a prompt instruction that specifies what the model should say when evidence or task completion is unavailable.

Read how Grokking AI Applications explains fallback →

Quarkus in Action

A fallback is a fault-tolerance pattern that supplies an alternate result or behavior when an operation fails.

How it is used
Protects client-facing operations by returning an alternative result when a dependent service remains unavailable.
How deep it goes
Defines the pattern and demonstrates annotation configuration, but does not discuss imperative fallback APIs or extensive operational policy design.
Examples
Uses a Reservation-to-Inventory availability call that returns an empty car list after retries fail.
What you can do after
Apply it via MicroProfile annotations and a named fallback method in a Quarkus service.

Read how Quarkus in Action explains fallback →

AI Agents in Action, Second Edition

A fallback is an alternative action or implementation used when the preferred operation cannot complete successfully.

How it is used
Keeps agents useful when tools, models, or supporting services fail, time out, or exceed an operational budget.
How deep it goes
Explains fallback triggers, alternatives, retry limits, and coordination with circuit breakers, but does not specify implementation code.
Examples
Uses best-effort answers, smaller models, omitted images, text-only responses, delayed image links, and uncertainty-marked partial information.
What you can do after
Apply fallback routing to preserve useful agent behavior while limiting retries and clearly marking uncertain results.

Read how AI Agents in Action, Second Edition explains fallback →

LLMs in Production

A fallback response is a predefined response returned when processing a user request fails.

How it is used
Improves chatbot resilience and keeps users informed when an LLM request fails.
How deep it goes
Defines fallback behavior and its chat-history rationale, but does not specify a concrete error-handling implementation.
Examples
Uses connection failures, overwhelmed servers, and instructions to try again in a few minutes as concrete cases.
What you can do after
Operate/configure a chatbot that returns guidance after failed requests and maintains clean conversational history.

Read how LLMs in Production explains fallback →

Build AI-Enhanced Web Apps

A user-facing fallback is an alternative interface response or recovery option presented when the intended operation fails.

How it is used
Provides a recoverable interface response for failed AI generations and unavailable external services.
How deep it goes
Explains classification, centralized messaging, request IDs, rendering, and retry, but does not enumerate every provider error.
Examples
Uses AIErrorTracker, continueConversation, ChatBubble, request IDs, retry controls, and predefined MCP responses.
What you can do after
Build it from scratch by catching provider errors, classifying them, rendering stable messages, and wiring recoverable cases to retry.

Read how Build AI-Enhanced Web Apps explains fallback →

Machine Learning Platform Engineering

A fallback strategy defines an alternative provider, model, or execution path used when the preferred path fails or cannot satisfy a request.

How it is used
Supports high-availability LLM applications by switching providers when throttling or other failures affect the preferred service.
How deep it goes
Defines provider fallback and places it alongside retry, monitoring, and graceful degradation, but gives no configuration procedure.
Examples
Uses OpenAI or Claude as backup options for Gemini and pairs fallback with throttling retries and token monitoring.
What you can do after
Apply it by selecting backup providers alongside retry and monitoring controls for high-availability LLM services.

Read how Machine Learning Platform Engineering explains fallback →

Generative AI in Action

A fallback mechanism is an alternative execution or service path invoked when the preferred path fails or becomes unavailable.

How it is used
Maintains GenAI application availability and retrieval quality when preferred paths fail, exceed limits, or produce weak results.
How deep it goes
Explains trigger conditions, alternate chunking paths, feedback loops, monitoring, and cost considerations without detailing implementation code.
Examples
Uses alternate chunk sizes, different chunking strategies, user feedback, automatic recovery, alerts, and distributed tracing as fallback-related mechanisms.
What you can do after
Operate/configure retrieval and distributed GenAI systems with alternate paths, confidence triggers, recovery plans, and monitoring.

Read how Generative AI in Action explains fallback →

Learn AI Data Engineering

A fallback strategy is an approach that specifies an alternative method when the preferred method fails or cannot produce a result.

How it is used
Supports resilient extraction pipelines when sites expose inconsistent fields, selectors, access conditions, or rendering behavior.
How deep it goes
Demonstrates selector-level fallback and missing-element guards, but stops short of a general framework for maintaining many domain-specific rules.
Examples
Uses product-page title extraction, sale-versus-regular price selection, and multi-site scraping with requests and BeautifulSoup.
What you can do after
Build resilient field extraction that returns available values, preserves missing fields as None, and accommodates common page differences.

Read how Learn AI Data Engineering explains fallback →

AI Governance

Fallback logic is a programmed alternative behavior invoked when a primary operation fails, is unavailable, or cannot safely proceed.

How it is used
Routes uncertain dermatology-image results to clinicians instead of allowing unsupported model responses.
How deep it goes
Defines low-confidence, unclear-result, and unavailable-approved-message triggers for clinician escalation.
Examples
Uses Derm-Cam image results and approved patient messages to illustrate when clinician review takes over.
What you can do after
Configure clinician escalation for low-confidence, unclear, or unhandled outputs.

Read how AI Governance explains fallback →

Also covered in

What to know first

Related concepts

Questions about fallback

What is fallback?

A fallback is an alternative behavior, result, resource, or processing path selected when a preferred option fails, is unavailable, or is inadequate.

Which Manning books explain fallback?

The Art of Code, Grokking Software Architecture, Natural Language Processing in Action, Second Edition, Prompt Engineering in Practice, CSS in Depth, Second Edition, Vanilla Web, Microservices Patterns, Second Edition, Machine Learning System Design and 16 more.

What should I know before learning fallback?

Manning books that teach fallback usually introduce contract, language model, caching and latency first.

What is the difference between fallback and routing?

A fallback is an alternative behavior, result, resource, or processing path selected when a preferred option fails, is unavailable, or is inadequate. Routing is the process of directing an item, request, or task to a destination or processing path according to relevant rules or characteristics.

What kinds of fallback are there?

Kinds of fallback include FP32 fallback and model fallback.

What is fallback a kind of?

Fallback is a kind of client resiliency pattern. A client-side design pattern that helps a service consumer manage failures or performance problems when calling a remote service.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.