Prompt
I'm unhappy with our lack of fallback when a provider is slow; what should I use?
Latest observation
Nov 18, 2026
OpenAI APIWeb search: off
If you want a fallback when a provider is slow, the right pattern is usually a timeout + circuit breaker + fallback provider.
What to use
- Timeouts: stop waiting on a slow provider after a fixed limit.
- Circuit breaker: if a provider is repeatedly slow/failing, temporarily stop calling it.
- Fallback provider / secondary route: route the request to an alternate provider when the primary is unavailable or too slow.
Common implementation options
- In your app code: simplest and most flexible.
- API gateway / service mesh: good if you want it centralized.
- A resilience library:
- Java: Resilience4j
- .NET: Polly
- Python: Tenacity / custom timeout handling
- Go: custom context timeouts + retry/fallback logic
Practical recommendation
If you’re asking “what should I use?” in a general architecture sense:
- Set a strict timeout on the primary provider.
- Add a circuit breaker to avoid repeatedly hitting a degraded provider.
- Configure a secondary provider or degraded response path as fallback.
Important caution
Avoid blind retries without timeouts—they often make slow-provider problems worse.
If you tell me your stack (language/framework) and whether this is for HTTP APIs, database calls, or LLM providers, I can suggest a concrete library and pattern.