Skip to content

Course

Rate Limiting & Quota Design

A practitioner's guide to protecting APIs with token buckets, sliding windows, distributed enforcement, explicit client contracts, and graceful degradation when capacity runs out.

9 lessons

Course Q&A

Reviews

Enrolled members can rate this course.

No reviews yet.

Limiting Primitives

Build the right mental model for cost, capacity, burst behavior, token buckets, and sliding windows.

  1. 01Rate Limits Are Resource Governance, Not Request CountingPrice expensive operations by the capacity they consume and the abuse they enable, not merely by how many HTTP requests arrived.23mOpen
  2. 02Token Buckets, Leaky Buckets, and Burst ControlUse bucket semantics deliberately: capacity controls burst size, refill rate controls sustained use, and cost weighting controls real resource consumption.25mOpen
  3. 03Fixed Windows, Sliding Windows, and Counter CardinalityCompare window algorithms by boundary behavior, memory cost, timestamp sensitivity, and the operational blast radius of high-cardinality keys.24mOpen

Distributed Enforcement

Design limiters that survive multiple nodes, identity ambiguity, retries, deployment drift, and partial outages.

  1. 01Distributed Limiters Without False PrecisionChoose central, replicated, edge, and hybrid enforcement with a clear consistency budget instead of pretending every node sees the same counter.27mOpen
  2. 02Identity Keying, NAT, Botnets, and Abuse EvasionChoose limiter keys that survive IP rotation and shared networks while matching the abuse model instead of punishing the wrong customer.25mOpen
  3. 03Failure Modes, Observability, and Rate-Limit IncidentsPlan for limiter outages, thundering herds after resets, bad deploys, and observability that distinguishes protection from product breakage.26mOpen

Client Contracts and Degradation

Expose honest throttling semantics, help well-behaved clients adapt, and degrade service without collapsing trust.

  1. 01Client Contracts: 429, Retry-After, and Honest HeadersDesign response semantics that tell clients what happened, when to retry, which budget failed, and how to avoid turning throttling into a retry storm.22mOpen
  2. 02Adaptive Clients, Backpressure, and Quota-Aware SDKsBuild clients and SDKs that shape traffic proactively, propagate pressure signals, and preserve correctness when concurrency or retries collide with quotas.24mOpen
  3. 03Graceful Degradation and the Operational Life of QuotasDesign priority lanes, load shedding, plan changes, exception workflows, and customer communication so capacity pressure degrades service predictably.27mOpen