In a system of services, databases and third-party APIs, something is always slow or failing. The question is whether a failure stays contained or cascades until the whole application is down. A few patterns make the difference.
Timeouts everywhere
Every network call needs a timeout. Without one, a slow dependency ties up threads and connections until the calling service runs out and fails too. Set timeouts from what users can tolerate, not from library defaults, which are often very long or unlimited.
Retries, carefully
- Retry only operations that are safe to repeat, or make them idempotent
- Use exponential backoff with random jitter, so retries do not arrive in waves
- Limit both the number of attempts and the total time spent
- Retry at one layer only, or a single failure multiplies into dozens of requests
Circuit breakers and fallbacks
A circuit breaker notices when a dependency keeps failing and stops calling it for a while, returning a fallback straight away. A fallback can be cached data, a simpler response or a clear message that a feature is briefly unavailable, which is far better than a page that hangs.
Practise failure
Slow down a dependency in a test environment, cut a connection, fill a disk. Each experiment shows whether timeouts and fallbacks behave the way you expect.
Our engineers and consultants write about what they see in real projects. Have a question about your own systems?






