Skip to content
Theory · Rate limiter · lesson 6 of 10

Token bucket and sliding window

To decide whether a client has used up its limit, the limiter counts its requests over some stretch of time. There are four ways to count, and the interviewer expects you to compare at least two. There are four properties to compare: what passes at a window boundary, how a burst is treated, the memory per client and the cost of one request.

In this lesson

  • Fixed window
  • Request log
  • Sliding window counter
  • Token bucket
  • What to choose
  • Common mistake
  • Key points