Storage is blocked in this browser, so progress will not be saved. Everything else still works.
Module 4 · Dec 14 to Dec 20
AWS reliability
Timeouts, retries with jitter, idempotency and DLQs, so a retried payment is never a duplicate.
0 of 5 bursts done
Concept in plain words
Every call needs a timeout, every retry needs backoff with jitter and a cap, and every write that can be retried needs an idempotency key. Pick a timeout from the false-timeout rate you can accept: for 0.1%, set it at the downstream p99.9 latency. Retry at one layer only; five layers each trying three times can hit the database 243 times for one user action. Jitter adds randomness to the wait so clients don't retry in lockstep. With idempotency, the caller sends a unique key and the server returns the same answer for the same key, rejecting the same key with different parameters. Lambda reading from SQS can process a message twice, so the second run must be harmless. A DLQ holds messages that failed too often; any message there is a bug, so alarm on it.
Payments analogy: An idempotency key is the check number on a paper check. If the same check is presented twice, the bank pays it once and rejects the copy. Without the number, it would have to guess.
Banking scenario
What the source says
At 7:30 AM PST, an automated activity to scale capacity of one of the AWS services hosted in the main AWS network triggered an unexpected behavior from a large number of clients inside the internal network.
This resulted in a large surge of connection activity that overwhelmed the networking devices between the internal network and the main AWS network.
AWS's networking clients have well tested request back-off behaviors, but a latent issue prevented these clients from adequately backing off during this event. The code path had been in production for many years.
Source: AWS summary of the Dec 7, 2021 us-east-1 event needs internet
Illustrative scenario
A card processor's fraud-scoring dependency slows down. Thousands of authorization Lambdas time out and retry immediately with no jitter, the API gateway also retries, and the client SDK retries on top. The scoring service, which was only slow, is now flattened by retry traffic, and authorizations fail across the board.
What an SRE would have seen first: Downstream latency climbing past p99.9, then request volume to the dependency multiplying while upstream traffic stayed flat: the signature of a retry storm.
The control that would have caught it: Retries at one layer only, exponential backoff with full jitter and a cap, a retry budget under 10% of requests, and an alarm on the ratio of dependency calls to incoming requests.
Made-up payments translation for study. Not a real event at any company.
Thresholds
| Setting | Starting value | Source |
|---|---|---|
| Client timeout | Downstream p99.9 latency (for 0.1% false timeouts), plus padding if p99.9 is close to p50 | Builders' Library needs internet |
| Attempts per request | Up to 3 attempts | SRE book ch. 21 needs internet |
| Retry budget per client | Retries under 10% of requests | SRE book ch. 21 needs internet |
| Backoff | Exponential with full jitter, capped | AWS Architecture blog needs internet |
| Lambda async retries | 2 (default); retries on throttles and 5xx for up to 6 hours | Lambda async error handling needs internet |
| SQS visibility timeout | At least 6 times the function timeout, plus the batching window | Lambda SQS docs needs internet |
| maxReceiveCount | At least 5 | Lambda SQS docs needs internet |
| DLQ retention | Longer than the source queue's retention | SQS DLQ docs needs internet |
| DLQ alarm | Any message in the DLQ; also alarm on age of oldest message | Builders' Library needs internet |
| Idempotency record lifetime | Powertools default 1 hour; Stripe keeps keys at least 24 hours Stripe figure: docs.stripe.com/api/idempotent_requests (listed on the Sources page). | Powertools idempotency needs internet |
| Idempotency window for payments | At least as long as your longest retry path, including the 6-hour async window | estimate |
Rows marked estimate have no published source. Test them against your own traffic.
Quiz
Try it
Phone Sketch a made-up flow: EventBridge rule, then a Lambda, then DynamoDB, then a third-party API. Build a failure-mode table with one row per hop.
- Columns: timeout, retries, what a duplicate does, where failed events land, and the alarm you would set.
- Fill in one row per hop.
- Circle the hop that has no alarm and write what you would alarm on.
You keep: The failure-mode table. It feeds the capstone runbook.
Verify notes
- The full-jitter backoff formula appears only as an image in the AWS blog post, so it is not quoted here.
- The payments idempotency window is an estimate, not a published standard.
Read these
- Timeouts, retries, and backoff with jitter needs internet
- Exponential Backoff and Jitter needs internet
- Making retries safe with idempotent APIs needs internet
- Avoiding insurmountable queue backlogs needs internet
- Creating an SQS event source mapping needs internet
- Powertools for AWS Lambda: Idempotency needs internet
- Stripe: idempotent requests needs internet
From your Sourced Reading Guide. Reading times in that guide are estimates.
Companion book estimate
Becoming a Rockstar SRE needs internet, Jeremy Proffitt and Rod Anami (Packt Publishing, April 28, 2023)
- Publisher's summary: "Employ reliable architecture and deployments with serverless, containerization, and release strategies". Serverless architecture and release strategies, the AWS side of this module.
- Ch. 3: Imperfect Habits - Duct Tape Architecture and Spaghetti Code. Fragile design habits are where missing timeouts and retries tend to hide.
Mapped from chapter titles and the publisher's feature list only; I have not read the book, so treat each link as an estimate. Chapters 8 to 17 were not listed on the pages I opened. The book is from April 2023, so it predates the 2025 incidents and API docs used here; its code repo's software list names Prometheus and Grafana and does not name Dynatrace.