Your service starts receiving 429 responses during traffic spikes. Which handling is correct?
Why D is the answer
Back off with jitter, respect the retry-after header, and cap the attempts
A 429 means slow down. Backoff with jitter stops clients from retrying in lockstep, and retry-after tells you how long to wait. Tight loops make it worse, and rotating keys to dodge a limit is not a fix.
In detail
- A 429 means you are over a limit, so the client must slow down.
- The retry-after header says how long to wait, and jitter stops workers from retrying in lockstep.
- A cap on attempts keeps one failure from becoming an endless loop.
- Queue work on your side during known peaks, so fewer requests hit the limit.
Use case
An illustrative scenario, not a real incident.
A marketing tool sends a burst of requests each hour and gets 429s. Each worker waits for retry-after plus a little random time, so the retries spread out and the burst clears.
See it in different ways
flowchart TD
A{"Which status?"} -->|"429, 500, 529"| B["Back off with jitter and retry"]
A -->|"400, 401, 403, 404, 413"| C["Fix the request or credentials"]
B --> D{"Still failing?"}
D -->|Yes| E["Contact support with the request ID"]stateDiagram-v2 [*] --> Failed Failed --> Backoff: 429 or 529 Backoff --> Failed: still failing Backoff --> Done: success Failed --> FixRequest: 400 Failed --> FixKey: 401 FixRequest --> [*] FixKey --> [*] Done --> [*]
flowchart LR S0["Request"] --> S1["429 received"] --> S2["Wait retry-after plus jitter"] --> S3["Retry"] --> S4["Stop at the cap"]
Key point: On a 429, wait as told, add jitter, and cap attempts.
Why the other options are wrong
- A. Rotate between several API keys so each one stays under the rate limit
- Using extra keys to dodge a limit does not fix the load.
- B. Retry immediately in a tight loop across all workers until each request succeeds
- A tight loop adds traffic at the moment you were told to reduce it.
- C. Fail the user request right away and page on-call every time it happens
- A short spike is expected, so failing at once and paging people is too severe.

