Lesson 3.28mIntermediate9.4k students

Rate limiting

Rate limiting protects you from clients and clients from themselves. Token bucket is the usual answer; the hard part is the key you limit on.

This lesson sits in API Design at Scale, part of System Design Foundations. It assumes what came before it and leads directly into the next lesson in the module.

In this lesson you will

  • Implement token bucket and sliding window limits
  • Choose the right key: user, tenant, or IP
  • Return limits and retry hints in the response

Resources