AWS in 1 Min · Episode 189

Designing for failure on AWS: timeouts, retries and fallbacks

Assume every call can fail. Watch the one-minute video, then read the details.

David Gomez1:24 video · 2 min read

"Good systems don't fail." Everything fails, all the time: disks, networks, whole data centers, and the services you call. Good systems aren't the ones that never fail; they're the ones that expect failure and keep working. Designing for failure means asking, for every component: what happens when this breaks?

1. No single point of failure

If one component's failure takes the app down, it's a single point of failure. On AWS:

2. Timeouts

Never wait forever on another service. A call with no timeout, or a very long one, holds a thread or connection while it waits; enough stuck calls and your whole app stops responding, even though only one dependency is slow. Set connection and read timeouts on every network call, sized to what that call normally needs.

3. Retries with backoff and jitter

Many failures are brief: a dropped connection, a throttled request. Retrying fixes them, if you retry well:

  • Exponential backoff: wait a little, then longer after each failure.
  • Jitter: randomize the wait, so a thousand clients don't all retry at the same instant.

AWS SDKs retry for you with exponential backoff and jitter; in the standard retry mode the default is three attempts in total (one request plus two retries). For your own service-to-service calls, use a library that does the same.

4. Cap retries and make them safe

Retries have a dark side. If every layer retries three times, one failing call at the bottom can become dozens of requests, turning a small outage into a flood. So:

  • Cap the number of attempts and the total time spent.
  • Retry only errors that are retryable (throttling, timeouts, 5xx), not validation or permission errors.
  • Make operations idempotent, safe to run twice, for example with an idempotency key on "create payment", so a retry after a timeout doesn't charge a customer twice.

5. Fallbacks

When a dependency is down, a degraded answer beats an error screen: a cached result, a simpler page, default recommendations, or a queue that processes the request later (SQS).

Where AI fits

Model calls fail like any other dependency, and in two ways that matter: throttling (quota or capacity limits) and slow responses (long answers take time). Amazon Bedrock's own guidance:

  • Set read timeouts that fit long inference; a timeout shorter than a valid response causes pointless retries and duplicate work.
  • Retry throttling and capacity errors with backoff and jitter, within a bounded retry budget, and honor a Retry-After header when one is returned.
  • If errors persist, fall back: use cross-Region inference profiles so Bedrock can route to other Regions, switch to another or smaller model, or show a friendly "try again shortly" message.

Quick recap

  • No single point of failure: two or more copies across AZs, with health checks.
  • Timeouts and capped retries with backoff and jitter; idempotent operations.
  • Always have a fallback, including for model calls.
AWS in 1 Min #189 · 1:24

Need an AWS expert on your team?

I'm David, an AWS expert and fractional cloud consultant. I work alongside your team to run your cloud and infrastructure: architecture, security, cost and day-to-day operations. You get senior AWS experience when you need it, without the cost of a full-time hire.

  • Architecture reviews and a clear plan for what to fix first
  • Security hardening: IAM, networking, audits
  • Lower AWS bills without slowing your team down
  • Hands-on help with AI workloads on AWS