Concepts

Sliding Windows

Trypema uses sliding windows instead of fixed windows, with configurable bucket coalescing.

Trypema counts traffic over a moving time window instead of resetting everything at fixed boundaries.

Why sliding windows

Sliding windows avoid the common fixed-window problem where traffic can burst at the end of one window and the start of the next.

That gives you smoother enforcement and more realistic backoff behavior.

How Trypema keeps it efficient

Trypema groups nearby timestamps into buckets using rate_group_size_ms.

  • smaller buckets give finer timing and retry hints
  • larger buckets reduce overhead and memory pressure

The main trade-off

SettingEffect
smaller rate_group_size_msmore precision, more bucket churn
larger rate_group_size_msless precision, lower overhead

Practical defaults

For many applications, a small bucket size like 10ms or the default grouping is enough. Reach for tighter values only when you truly need sharper timing.

What readers should remember

  • Sliding windows smooth bursts better than fixed windows.
  • Bucket coalescing is the main precision-versus-overhead knob.
  • This trade-off matters most at high throughput or very large key counts.