Senior Track Roadmap

System Design: rate limiting algorithms

This course examines rate limiting through the nine throttles of one real application. It starts with what each limit protects (capacity, a secret, a scarce resource or human time) and how that sets the number. It then covers the fixed window counter, the boundary burst that lets it allow twice its limit, the token bucket, and the sliding window log and counter, all compared on the same traffic. It closes with discriminators, key normalization, safelisting the health check and a token bucket implementation challenge.

What you'll learn

  • ✓How the thing a limit protects decides its number
  • ✓How a fixed window counter works and why it allows twice its limit at the boundary
  • ✓How a token bucket separates burst size from sustained rate
  • ✓The costs and accuracy of the sliding window log and the sliding window counter
  • ✓How to choose and normalize the discriminator a request is counted against
  • ✓The difference between a rate limit and a quota
Free preview · Lesson 1 4 min read

What a limit protects

A rate limit isn't one idea. Every limit in a real application protects a different thing, and the thing it protects decides the algorithm, the number, and what the request is counted against.

Read the full lesson free →

Curriculum

7 lessons
Type to start searching...