Skill 1.1.3

Create and maintain fault-tolerant and resilient applications (for example, by configuring retry with backoff, graceful degradation).

Key Concepts

Transient errors such as throttling (HTTP 429 or ThrottlingException) and 5xx server errors should be retried using exponential backoff with jitter: wait longer after each failed attempt and add randomness so many clients do not retry at the same moment. The AWS SDKs do this automatically, and you can tune the retry mode and maximum attempts. Client errors (4xx such as validation or access denied) should not be retried because they will fail again.

Every remote call should have a sensible timeout so a slow dependency cannot tie up resources indefinitely. Because retries can repeat an operation, handlers should be idempotent, producing the same result when run more than once, for example by recording processed request IDs with a DynamoDB conditional write. Work that keeps failing should be moved aside to a dead-letter queue rather than retried forever.

Calls to external services should use timeouts and retries with exponential backoff and jitter, honouring any rate-limit headers the provider returns. A circuit breaker tracks recent failures and, once a threshold is reached, stops calling the service for a period and fails fast or returns a fallback response, then lets a few trial requests through to check whether the service has recovered. This prevents threads, connections and Lambda concurrency from being used up waiting on a failing dependency.

Putting a queue between your application and the third party lets you absorb outages and control the request rate, with failed messages moved to a dead-letter queue for later reprocessing. Step Functions can implement retry, catch and circuit-breaker logic as part of a workflow, and API keys or credentials for the provider should be stored in Secrets Manager.