Why Cadence?
Rate limiters controls how often an action can be performed.
Cadence controls how long the next attempt should wait after repeated failures.
Instead of limiting every request, Cadence progressively increases the delay between failed attempts and immediately resets the backoff state after a successful operation.
Rate Limiting vs. Progressive Backoff
| Aspect | Rate Limiter | Cadence |
|---|---|---|
| Purpose | Limit request frequency | Slow down repeated failures |
| Applies to | Every request | Only after consecutive failures |
| Behavior on success | Continues counting | Immediately resets backoff state |
| State reset | Slides over time window | Clears on successful operation |
When Cadence Shines
Cadence is ideal for scenarios where:
- You want to allow normal traffic without delay
- You need to discourage repeated failed attempts
- You want progressive delays that increase with each failure
- You need the backoff to reset immediately upon success
- You want to combine backoff with optional jitter for distributed retries
Key Benefits
- No unnecessary delays - Successful operations are never throttled
- Progressive protection - Delays increase with consecutive failures
- Immediate recovery - One success clears all backoff state
- Flexible strategies - Choose from multiple backoff algorithms
- Jitter support - Reduce thundering herd with optional randomness