# Rate limiting in plain words

> A rate limit caps how many requests one client can make in a period, so one heavy user cannot slow down everyone else. How a token bucket works, and what a client should do when limited.

Source: https://hintvo.com/blog/rate-limiting-in-plain-words | Last updated: November 20, 2026 | Reviewed: 2026-11-20

A rate limit is a cap on how many requests one client can make in a period of time. It exists so that one heavy user, one bug or one attacker cannot use up the capacity that everyone else needs.

## What it protects

- The service itself, from more work than it can do.
- Other customers, from one customer's traffic.
- Costs, when each request costs money to serve.
- Login and sign-up forms, from guessing and abuse.

## The token bucket, the most common design

Picture a bucket that holds up to ten tokens. Each request takes one token. Tokens are added back at a steady rate, say one per second, and the bucket never holds more than ten. A client that has been quiet can make ten requests at once. After that it is held to one per second.

- **Capacity** is the size of the burst you allow.
- **Refill rate** is the sustained speed you allow.

## What happens at the limit

The service refuses the request, usually with the HTTP status 429, Too Many Requests, and often says how long to wait. Nothing is queued unless someone built that. The client has to come back.

## What a good client does

1. Reads the wait time the service gives, if there is one.
2. Waits at least that long, with [backoff](https://hintvo.com/blog/retries-and-backoff-in-plain-words) if it happens again.
3. Does not retry immediately. That is what got it limited.

## Decisions someone has to make

- **Per what?** Per user, per API key, per IP address, per organization.
- **Where is the count kept?** In one server's memory it resets on restart and is not shared. In a shared store, every server sees the same count.
- **Different limits for different actions?** Reading is cheap. Sending email is not.
- **What does the customer see?** A clear message and a time to wait, or a mystery.

## Two bugs that show up again and again

- **Wrong units.** Elapsed time in milliseconds multiplied by a rate per second refills the bucket a thousand times too fast.
- **No cap.** If refilling never stops at the capacity, a client that waits an hour gets an hour of tokens at once.

Both are in the code example in [the debugging interview guide](https://hintvo.com/blog/debugging-interview-find-the-bug).

## Questions you will hear in a meeting

- What is the limit today, and where is it set?
- Is it per user or per key?
- What do we return when someone hits it?
- Do our own background jobs count against it?

> **Where Hintvo fits:** when a term like this comes up in a call, the In plain words card explains it in one sentence, in the context of your project. When someone asks how your own code handles it, the answer names the file and line.

## Related

- [Debugging interviews: finding a bug in code you have never seen](https://hintvo.com/blog/debugging-interview-find-the-bug.md): How do I find a bug quickly in a debugging interview?
- [Retries and backoff in plain words](https://hintvo.com/blog/retries-and-backoff-in-plain-words.md): What are retries and exponential backoff, in plain words?
- [Answer a customer's technical question on the call](https://hintvo.com/blog/customer-calls-technical-questions.md): How do I answer a customer's technical question during the call instead of following up by email?
