nestjs-sliding-window-throttler
A new NestJS library called nestjs-sliding-window-throttler addresses performance and accuracy issues with the standard @nestjs/throttler. The standard throttler makes 3 separate Redis calls per request, causing ~2-3ms latency and potential race conditions, while fixed-window algorithms allow up to 2x burst traffic at window boundaries. This drop-in replacement uses a single atomic Redis operation with true sliding window timestamp tracking, achieving ~1ms latency, 99% accuracy, and 2-3x higher throughput. It leverages Redis 7.0+ Functions with automatic Lua fallback for older versions, making it suitable for security-critical endpoints like login attempts and password resets.