Chapter 8 of 10All chapters
Chapter 8 of 10
Rate limits and retries
Being a good client and a good server.
Rate limiting
A server limits how often one client may call so that nobody can overwhelm it. It replies 429 and usually says when to try again.
- Retry with exponential backoff and a little randomness, never in a tight loop.
- Only retry idempotent calls, or supply an idempotency key so repeats are ignored.
Timeouts
Every outgoing call needs a timeout. Without one, a slow dependency turns into your own outage as connections pile up waiting.