Shreyash @webdevcaptain.com · May 13

6/ 4. Sliding Window Log Store a timestamp for every single req. On new req, drop anything older than the window & count the rest. Superpower: Most accurate – no boundary tricks possible. Catch: Memory explodes at scale (millions of timestamps = pain) Only when absolute fairness is non-negotiable.

1 likes 1 replies

?

Replies

Shreyash · May 13

7/ 5. Sliding Window Counter (Big Tech’s default) Hybrid genius. Keep counters for previous + current window + smart weighted math. Example: 100 req/min limit, 30s into the minute. Previous window: 80 Current: 20 Weighted = (80 × 0.5) + 20 = 60 → still under limit.