Scrivio Interview library
ConceptFoundations6 min read · updated 12 November 2026

What makes a good fallback, and why is a fallback that calls another remote service often a bad idea?

A good fallback is fast, local and safe: it returns cached data, a sensible default, or a clear error, without depending on anything that might be failing too. A fallback that calls another remote service can fail for the same reason as the original call and adds load to the system exactly when it is under stress. A fallback must never return wrong data that looks correct, such as a zero balance, and because fallbacks run rarely, they must be logged, counted and tested regularly.

Why this question is asked

Fallbacks are the part of resilience that users actually see. When a dependency fails, the fallback decides whether the user gets a slightly reduced page, a clear message, or something misleading. Interviewers ask what makes a good one because many teams write fallbacks quickly and never look at them again, and a careless fallback can turn a small outage into a big one or into wrong decisions. In this answer, we will recap what a fallback is, list the properties of a good one, see why remote fallbacks are risky, look at the danger of plausible wrong data, and make fallbacks visible and tested.

1A Quick Recap of Fallbacks

A fallback is the code that runs when a protected call fails: the dependency timed out, threw an error, or the circuit breaker is open. Instead of passing the failure to the user, the fallback provides an alternative result. In Resilience4j it is the method named in fallbackMethod or the function given to withFallback.

The fallback runs at the worst possible moment, during an incident, when the system is already under stress. So the question is not only what it returns, but what it costs and what it depends on.

2What Makes a Good Fallback

A good fallback has three properties. It is fast: it answers in microseconds or milliseconds, because the user has already waited for the failed call. It is local: it depends only on things inside our own process or on resources we know are healthy, such as an in-memory cache, a default value or a static response. And it is safe: whatever it returns must not lead the user or another system to a wrong decision.

The usual good choices follow from that. Recent cached data, labelled as such, works when slightly stale information is still useful, for example a product description or yesterday's exchange rate for display. A default works when a neutral value is honest, for example an empty list of recommendations. And a clear error, such as a message saying the balance is temporarily unavailable, is often the best fallback of all, because it tells the truth.

Java
@CircuitBreaker(name = "recommendations", fallbackMethod = "noRecommendations")
public List<Product> recommendations(String userId) { return recoClient.forUser(userId); }
private List<Product> noRecommendations(String userId, Exception e) {
fallbackCounter.increment(); // visible in metrics
return List.of(); // fast, local, honest: the section is simply hidden
}
// recommendations service down -> empty list in under 1 ms, page renders without the section

3Why a Remote Fallback Is Often a Bad Idea

It is tempting to fall back from one service to another: if the primary pricing service fails, call the legacy one; if the cache cluster fails, query the database. The trouble is that remote dependencies often fail for shared reasons. If the network between our service and the data centre is degraded, both calls fail. If the database behind both services is slow, both are slow. Then the user waits for two timeouts instead of one, and still gets an error.

The second problem is load. During an incident, every failing request now makes two remote calls. If the primary failed because of overload, the fallback sends the same traffic to the secondary, which was never sized for it, and it falls over too. The classic example is a cache outage that sends all reads to the database, which was only ever sized for the cache misses.

Fallback options compared
FallbackSpeedRisk during an incident
In-memory cached valuemicrosecondsmay be stale; label it
Static default (empty list)microsecondsnone, if honest
Clear error messagemicrosecondsnone, user knows the truth
Call a second remote serviceanother network callfails for the same reason, doubles load
Plausible fake value (zero balance)fastwrong decisions by users or systems

4Never Return Wrong Data That Looks Correct

The most harmful fallback is one that returns a value that looks real. If the balance service fails and the fallback returns 0.00, the user sees an empty account, panics, calls support, or makes a decision based on a number that is false. If a fraud check fails and the fallback returns not fraudulent, we approve payments we should have checked. If a price lookup fails and the fallback returns a default price, we may sell at the wrong price.

The rule is simple: if we cannot get a correct value, we say so. Return an explicit unavailable state that the caller and the user interface must handle, not a value of the normal type that pretends everything is fine.

Java
// broken: indistinguishable from a real empty account
private Balance balanceFallback(String accountId, Exception e) {
return new Balance(accountId, BigDecimal.ZERO); // shows 0.00 as if it were true
}
// better: the caller must handle an explicit state
private BalanceView balanceFallback(String accountId, Exception e) {
return BalanceView.unavailable(accountId); // UI shows: balance temporarily unavailable
}

5Make Fallbacks Visible and Test Them

A fallback that works perfectly can still hide a serious problem. If the recommendations service has been down for three days and the fallback silently hides the section, nobody may notice, and the business loses whatever those recommendations earned. So every fallback should log at a sensible level and increment a metric tagged with the dependency, and dashboards and alerts should show the fallback rate. A fallback rate above a few percent for more than some minutes is an incident, even if users see no errors.

Fallbacks also run rarely, which means they break silently: a refactoring changes a signature, a cache is renamed, a default no longer makes sense. We test them regularly, with unit and integration tests that force the dependency to fail, and in game days where we switch a dependency off and watch the page and the metrics.

6Follow-up questions

Is it ever acceptable for a fallback to call another service?

Yes, when that service is independent and sized for the extra load, for example a second payment provider on separate infrastructure, kept warm with real traffic. Even then the fallback call needs its own timeout and circuit breaker, so a failure in both cannot double the user's wait.

How stale may cached data be in a fallback?

It depends on the data. A product description can be days old, stock levels minutes, and prices perhaps not at all for checkout. We decide a maximum age per use case and treat older cache entries as missing, returning an unavailable state instead.

Should the fallback rethrow the exception sometimes?

Yes. If there is no safe alternative, rethrowing or returning a clear error is the right fallback. A fallback exists to give a better answer than an error, and when no better answer exists, the error is the honest one.

7Conclusion

In this answer, we saw that a good fallback is fast, local and safe, returning cached data, an honest default, or a clear error. A fallback that calls another remote service can fail for the same reason and doubles load during an incident, and one that returns plausible but wrong data, such as a zero balance, is worse than an error. Fallbacks should be logged, counted and alerted on, and tested regularly because they run so rarely.

What to say in the interviewAbout 90 seconds aloud

Open with

A good fallback is fast, local and safe. Fast because the user has already waited for the failed call; local because it should not depend on anything else that might be failing, so an in-memory cache, a default value or a static response; and safe because what it returns must not mislead anyone.

Then, if they want more

In practice that means recent cached data labelled as such, an honest default like an empty recommendations list, or a clear error that says the data is temporarily unavailable. A fallback that calls another remote service is risky for two reasons.

Remote dependencies often fail for shared reasons, the same network, the same database, the same overload, so the fallback fails too and the user waits for two timeouts.

And during an incident it doubles the number of remote calls, sending all the traffic to a secondary system that was never sized for it, like a cache outage pushing every read onto the database.

The worst fallback is one that returns wrong data that looks right, like a zero balance or a not-fraudulent result; I would always return an explicit unavailable state instead. Finally, fallbacks must be visible: logged, counted in a metric per dependency and alerted on, because a silent fallback can hide a dependency being down for days.

And because they run rarely, I test them regularly by forcing the dependency to fail in tests and game days.

About this answer

Last updated
12 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "What makes a good fallback, and why is a fallback that calls another remote service...": https://scrivio-interview-library.netlify.app/spring-boot/resilience/87c02e69f1/