Exponential Backoff with Jitter

1. What exactly is Exponential Backoff with Jitter?

Your Notification service goes down for a moment, then comes back online within seconds.

Every caller is waiting with the same fixed retry delay, so they all retry at the exact same moment.

Notification gets hit with the full flood the instant it's back, and it goes right back down again.

Everyone retrying at the same instant recreates the exact spike that just went down. This is the thundering herd problem, and it's exactly what exponential backoff with jitter is built to avoid.

2. How would you fix it in .NET?

Exponential backoff with jitter spreads the load back out: make each retry wait longer than the last, 1 second, then 2, then 4, and so on, and add a small random amount to each wait so different callers don't land on the exact same instant. Your retries arrive spread out over time instead of all at once.

Use: Microsoft.Extensions.Http.Resilience (Polly)

Space retries out, and randomize them, so recovery doesn't get flooded by the very callers waiting for it.

3. How can you visualize it in everyday terms?

After a neighborhood-wide blackout, the power company doesn't switch every house back on at the same instant.

Every home's air conditioner and appliances kicking in together would spike demand right back to outage levels. Homes are reconnected a few at a time instead.

Same idea: come back staggered, not all at the same instant.