Providers

Hybrid

Local fast-path admission with periodic Redis synchronization for very high throughput distributed workloads.

The hybrid provider combines local admission speed with Redis-backed shared state.

Why choose Hybrid

  • local-speed admission decisions
  • much lower Redis load than pure Redis mode
  • distributed limiting without paying a Redis round-trip on every request

What to expect

  • methods are async
  • keys use RedisKey
  • local state is flushed to Redis every sync_interval_ms
  • decisions can temporarily lag behind the latest remote state

The main tuning knob

sync_interval_ms sets the local-to-Redis flush cadence.

  • smaller values reduce lag and increase Redis pressure
  • larger values improve throughput and reduce Redis pressure

Best fit

Choose hybrid for high-throughput APIs where distributed visibility matters, but the pure Redis provider is too expensive on the hot path.

If you need every decision to read remote state directly, use Redis instead.