Strategies

Absolute

Strict sliding-window limiting with deterministic allow or reject decisions.

Choose the absolute strategy when your application wants a hard admission boundary.

What it does

Absolute limiting counts requests inside the current sliding window and returns one of two outcomes:

  • Allowed
  • Rejected

There is no probabilistic behavior.

When to use it

  • request admission for APIs
  • hard quotas for expensive operations
  • any path where a binary yes/no answer is easier to reason about than gradual shedding

What you get back

On rejection, Trypema can return best-effort hints such as retry_after_ms. These are useful for backoff, but they are not strict guarantees under concurrency.

Where it fits

  • Local absolute: simplest and fastest
  • Redis absolute: shared remote state with one Redis round-trip per call
  • Hybrid absolute: local fast-path with Redis sync lag

If your system prefers graceful degradation instead of a hard cutoff, the suppressed strategy is usually a better fit.