Course contentsShow
← System Design
Lesson 957 of 1,91925. Rate Limiting and ThrottlingFree lesson

Rate Limiting vs Throttling

Distinguish rate limiting (hard limits) from throttling (gradual slowdown) and when to apply each approach.

Rate Limiting vs Throttling

You'll learn: How rate limiting and throttling differ in controlling traffic, and when to choose each strategy.

Both rate limiting and throttling protect systems from overload, but they handle excess requests differently—understanding the distinction helps you pick the right tool for each scenario.

Rate Limiting: Hard Stop

Rate limiting enforces a strict ceiling: "You get N requests per time window." Once you hit that limit, additional requests are rejected outright, typically with an HTTP 429 (Too Many Requests) response. Think of it like a nightclub with a capacity limit—once full, the bouncer turns people away at the door.

Use rate limiting when:

  • You need predictable resource consumption
  • Abuse prevention is critical (blocking bots, scrapers)
  • Hard SLA guarantees matter (free tier: 100 req/day)
  • Fair allocation across tenants is required

Throttling: Gradual Slowdown

Throttling doesn't reject requests—it delays them or processes them more slowly. Requests still succeed, but they queue or execute at a reduced rate. Imagine a highway on-ramp with metering lights: cars still enter, but at a controlled pace.

Use throttling when:

  • You want to accept all requests but spread them over time
  • User experience matters (avoid outright failures)
  • Background or batch jobs can tolerate delays
  • System needs breathing room during traffic spikes

The Key Difference

Rate limiting says "no" after the limit; throttling says "wait" or "slower." Rate limiting protects your system decisively. Throttling provides graceful degradation.

Many systems use both: rate limit malicious actors with hard caps, throttle legitimate bursts with queuing.

Key Takeaway:
Rate limiting enforces hard request caps and rejects excess traffic; throttling slows requests down without rejection—choose rate limiting for strict control, throttling for graceful degradation.