CSE Roadmap

Core tier · about 3 hours · 12 parts

Part 4 of 12 · 1 min read

Fallbacks: what actually restores success

The breaker protects the dependency; only a fallback protects the user.

Think of a spare tyre in the boot. Not drawing on the flat tyre any further (the circuit breaker's job) keeps the car from getting worse, but you still need the spare to actually keep driving.

In plain words: a circuit breaker stops a failing dependency from being hammered, but by itself it does nothing for the user's success rate. Only an alternative path, tried once the primary is blocked, restores that.

A worked example. Breaker alone during the outage: 68.3 percent success. Breaker plus a fallback to a second, independent provider: 99.7 percent success, with 31 percent of all requests served by the fallback. The p95 latency is 1.5 seconds, higher than the undisturbed 1.0 second, but far better than failing outright.

The key lines.

# from code/mini-reliability/reliability.py
if not done and policy.get("fallback"):
    if rng.random() < 0.99: out["fallback_ok"] += 1; done = True; lat += 1.5
if not done: out["failed"] += 1

Read it as: only once the primary attempt has given up does the fallback get tried, at the cost of its own latency. Which fallbacks are actually allowed matters too. A regulated task may not be permitted to answer with a different model or a cached response. An untested fallback is the one that turns out to be broken exactly when the outage hits.

Fallback, graceful degradation

A fallback is an alternative path tried when the primary fails; graceful degradation is offering reduced but still useful service rather than failing outright.

Example: the second provider above, restoring 99.7 percent success instead of 68.3 percent, with the user told the answer came from a fallback.