Home › Blog › Third-party API failover

Third-party API failover

The short answer: decide per dependency whether its failure may fail your request. Everything else - circuit breakers, fallbacks, second providers - follows from that classification, and doing it in advance is most of the work.

Classify the dependency first

ClassOn provider failureExample
Critical, no alternativeFail the request honestlyPayment authorisation at checkout
Critical, alternative existsFail over to second providerEmail and SMS sending
Important, deferrableQueue and retry laterReceipt email, webhook delivery
EnhancingDegrade silentlyRecommendations, avatars, analytics

Most incidents where a minor dependency took down a product trace to a dependency in the bottom row being treated, in code, as if it were in the top row - usually because nobody ever classified it and the default was a blocking call with no timeout.

The controls, in order of value

Worth saying out loud in a design round: "a circuit breaker protects the provider as much as us - continuing to retry a service that is failing is how a brownout becomes an outage."

Multi-provider: the real costs

A second provider sounds like the obvious answer and is frequently the wrong one. The honest accounting:

It is worth it for high-volume commodity services where providers are genuinely interchangeable - email, SMS, object storage. It is rarely worth it for anything with deep product semantics.

What to monitor

The retry mechanics that sit underneath this are in retry strategies and backoff, and the broader architecture in microservices interview questions.

Where CoPilot Interview fits

Disclosure: we build an interview assistant, so treat this as a disclosed pitch. CoPilot Interview is a native Windows and macOS app that puts suggested answers on your own screen in about two seconds, across coding, system design and behavioral rounds, with a permanent free tier that needs no credit card.

Frequently asked questions

How do you handle a third-party API outage?

Classify the dependency first: critical with no alternative fails honestly, critical with an alternative fails over, deferrable work queues for later, and enhancing features degrade silently. Then apply timeouts, a circuit breaker, bulkheads and a pre-defined fallback for each.

What does a circuit breaker do?

After a failure threshold it stops calling the dependency for a cooldown period and fails fast, then allows a single probe request to test recovery before reopening. It protects your own workers from being consumed by a hanging dependency and protects the struggling provider from continued load.

Is it worth integrating a second provider for redundancy?

For high-volume commodity services where providers are genuinely interchangeable - email, SMS, object storage - often yes. For anything with deep product semantics, rarely, because the abstraction collapses to the intersection of both feature sets and the failover path rots unless it carries continuous live traffic.

What is the most common cause of cascading failure?

A call without a timeout. A hung dependency silently occupies every worker or connection until the whole service stops responding, which is why timeouts shorter than your own SLA are the highest-value control before circuit breakers or bulkheads.

Walk into the round with a second pair of eyes

CoPilot Interview is a native Windows and macOS app that puts suggested answers on your own screen in about two seconds, across coding, system design and behavioral rounds. The free tier is permanent: 15 minutes a day, no credit card.

Try it free