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 wordsAbout 2 minutes

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 scenarioAWS us-east-1, Dec 7, 2021: back-off that didn't back off

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.

ThresholdsStarting points to tune, never mandates
SettingStarting valueSource
Client timeoutDownstream p99.9 latency (for 0.1% false timeouts), plus padding if p99.9 is close to p50Builders' Library needs internet
Attempts per requestUp to 3 attemptsSRE book ch. 21 needs internet
Retry budget per clientRetries under 10% of requestsSRE book ch. 21 needs internet
BackoffExponential with full jitter, cappedAWS Architecture blog needs internet
Lambda async retries2 (default); retries on throttles and 5xx for up to 6 hoursLambda async error handling needs internet
SQS visibility timeoutAt least 6 times the function timeout, plus the batching windowLambda SQS docs needs internet
maxReceiveCountAt least 5Lambda SQS docs needs internet
DLQ retentionLonger than the source queue's retentionSQS DLQ docs needs internet
DLQ alarmAny message in the DLQ; also alarm on age of oldest messageBuilders' Library needs internet
Idempotency record lifetimePowertools 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 paymentsAt least as long as your longest retry path, including the 6-hour async windowestimate

Rows marked estimate have no published source. Test them against your own traffic.

Quiz3 scenario questions
1. A Lambda that posts ACH credits times out after the bank partner accepted the request but before the response came back. Lambda retries. What prevents a double credit?

2. Your function timeout is 30 seconds with no batching window. What SQS visibility timeout should you start with?

3. Three messages land in the card-settlement DLQ overnight. Correct response?

Try itPhone exercise

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.

  1. Columns: timeout, retries, what a duplicate does, where failed events land, and the alarm you would set.
  2. Fill in one row per hop.
  3. 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

Read these

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)

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.