STAGE 07 / LESSON 05
Timeouts, retries and rate limits
Failure is normal in distributed systems; decide how the application responds.
THE IDEA
Understand it.
A timeout bounds how long a caller waits. Retries can recover from transient errors, but repeated retries can overload a struggling dependency or repeat an unsafe operation.
Use bounded retries with backoff and jitter where appropriate, and make retried operations idempotent. Rate limits protect a system from excessive requests; they should return understandable feedback to clients.
SEE IT IN CONTEXT
A bounded retry idea
Attempt 1 → temporary failure
Wait with backoff + jitter
Attempt 2 → temporary failure
Wait longer
Attempt 3 → success, or stop and report failureOnly retry operations and errors where retrying is appropriate; a payment or other side effect needs a safe idempotency strategy.
LEARN FROM REAL WEBSITES
See it in the real world.
These simplified structures come from public sources. Company systems change, and the sources may describe only one project or an earlier design.
Stripe
Stripe engineering, 2017Limit excessive requests
Stripe described rate limiters used to protect its API and keep the service available under heavy load.
- API request
- Rate limiter
- Accept or reject
What to learn: Rate limiting protects shared capacity; a client should handle a limit response instead of retrying aggressively.
Read the source: Stripe rate limitersAmazon
Amazon Builders' Library, checked November 2026Bound retries with backoff
Amazon's Builders' Library discusses timeouts, retries, exponential backoff and jitter for service calls.
- Service call
- Timeout or failure
- Bounded retry with backoff
What to learn: A retry policy should limit extra load and consider whether the operation is safe to repeat. This is engineering guidance, not a full Amazon.com architecture diagram.
Read the source: Amazon Builders' Library: retriesTRY IT YOURSELF
Practice.
Why can retrying a payment request without an idempotency key be dangerous?
Show one possible answer
The first attempt may have succeeded even if its response was lost, so a retry could create a second charge.
GO DEEPER