CodePark/ questions / Rate limiter design
START PRACTICINGPRACTICE
Backend question · System design & architecture › Rate limiter design

A limit of 100 requests per minute lets a client send 100 requests at 12:00:59 and another 100 at 12:01:00. Which statement is correct?

This is the boundary problem of a fixed window counter; a sliding window algorithm prevents it

This is the boundary problem of a fixed window counter. A fixed window resets its counter at each clock boundary. So a client can use two full windows back to back within one second. Sliding window algorithms (log or counter) look at the last 60 seconds from now. So they would reject the second burst. "This only happens if the limiter is stored in Redis" is wrong: the storage backend has nothing to do with it.