System design lab
Rate limiter
Run one stream of requests through fixed window, sliding log, sliding counter and token bucket limiters side by side.
On window-edge traffic the fixed window admits 10 requests within about two seconds against a limit of 5, while the sliding log never exceeds 5 in any 10-second span. On the burst, the token bucket admits a full bucket at once and then throttles to its refill rate.
Learn the concept
The lesson this lab comes from, with the explanation, a practice task and a quiz.
- Quick read:
- Rate-limiting algorithms
More labs
All labs- System designQuorum reads and writesPick N, W and R, take replicas down, and see exactly when a read misses the latest write.
- System designBloom filterAdd words to a bit array, check membership, and watch false positives appear as it fills.
- CSSBox modelChange padding, border, margin and box-sizing and watch the rendered size of an element change.