Clearing Stale Entries in Sliding Window

video locked
Enroll to watch

5 mins

In this video, Gaurav Sen explains how to implement a rate limiter algorithm with back pressure and forward pressure.

The algorithm checks whether a request should be accepted or rejected based on a sliding window of timestamps.

If a timestamp is older than the current timestamp minus the time unit, it is removed from the sliding window.

The algorithm is divided into a client and a server to optimize for speed and consistency.

The client handles the fast reaction of the rate limiter, while the server manages the configurations and consistency through the update and read keys.

Please take some time to provide feedback and ask questions in the comments section!