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

AspectRate LimiterCadence
PurposeLimit request frequencySlow down repeated failures
Applies toEvery requestOnly after consecutive failures
Behavior on successContinues countingImmediately resets backoff state
State resetSlides over time windowClears 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

  1. No unnecessary delays - Successful operations are never throttled
  2. Progressive protection - Delays increase with consecutive failures
  3. Immediate recovery - One success clears all backoff state
  4. Flexible strategies - Choose from multiple backoff algorithms
  5. Jitter support - Reduce thundering herd with optional randomness