CURRICULUM PREVIEWRevision 1 · Open for reviewReview the full course
CONNECTING THE PIECES10 min read

Retry with a budget

Repeat transient work without multiplying damage.

Before you begincache-aside

The problem and the pattern

A short network interruption may justify retrying a read. Invalid input or a permission denial will not improve with repetition. Bound attempts, add backoff with jitter, honor the operation deadline, and verify that a write is safe to repeat before retrying it.

Follow the flow

Make it concrete

This excerpt isolates the concept. Connect it to the booking API as you work through the exercise.

Focused example
text
Attempt 1 → transient failure
Wait: bounded exponential backoff + jitter
Attempt 2 → success
Stop when total deadline or attempt budget is exhausted

Trade-offs

  • Retries improve resilience only for appropriate transient failures.
  • They consume latency and downstream capacity.
  • Use a single policy owner where possible and expose retry metrics.

When to avoid it

Avoid retrying non-idempotent writes when the previous result is unknown.

Your turn

A handler, repository, and HTTP client each retry three times. What can happen to downstream load?

Reveal a worked answer

Nested policies can multiply attempts rather than add them. Put retry ownership at a deliberate boundary, propagate one deadline, and measure total attempts and latency. A retry storm can turn a short outage into overload.

Keep exploring

One more piece connected.

Mark this lesson complete when you can explain the idea.