Video in progress

Strong Middle 🧩 Microservices

If every service in a chain retries 3 times, what happens when the lowest service is failing?

gateway -> order-service -> pricing-service -> tax-service
  (3 attempts)  (3 attempts)   (3 attempts)       (slow)

The retries multiply: in a four-layer chain, one user request reaches the lowest service as 3^3 = 27 or more requests. A service that's already struggling goes down completely under the load.

📖 Answer

Work it out. tax-service is timing out. pricing-service calls it 3 times. order-service gets an error from pricing and calls it 3 times too, and each time pricing tries 3 times again: that's 9. If the gateway also tries 3 times, it's 27. A normal load of 1,000 RPS turns into 27,000 RPS for tax-service, at exactly the moment it's weakest.

On top of that, the waits at every layer add up too, and the user waits a minute and still gets an error.

What I do:

  • Retry at only one layer. Usually the one closest to the dependency (here pricing → tax). The upper layers don't retry, or only do when the connection couldn't be established.
  • A retry budget. Retries shouldn't exceed a set share of total requests (say, 10-20%). If there are many errors, retrying switches itself off.
  • A circuit breaker inside the retry: if the dependency has clearly failed, you don't go out to the network at all.
  • A "don't retry" signal. When the lower service rejects because of load, it returns 503 and Retry-After, and the ones above respect that.

Diagnosis: in tracing you see the same span repeated many times within one trace, and in the metrics the incoming RPS to the lower service is several times higher than the upper one.