Home / Learn Secure SQL / Rate Limiting Basics

Rate Limiting Basics

Slowing down or blocking an unusually high rate of requests.

The gistSlowing down or blocking an unusually high rate of requests.

The idea, explained simply

A rate-limited requestrequest arrivescheck: requests fromthis client in the…under the limit:proceed normallyover the limit:reject with 429 and…
A rate-limited request

What it is

Rate limiting restricts how many requests a single client (by IP, API key, or account) can make in a given time window, protecting against both abuse and accidental overload from a misbehaving client.

Why it matters

An attacker probing an application (or a buggy client retrying aggressively) often generates requests far faster than a normal user; rate limiting slows this down and can trigger alerts well before real damage occurs.

Mechanically speaking

Apply rate limiting at the API gateway or application middleware level, choose limits based on realistic normal usage patterns, and return a clear 429 ("Too Many Requests") response when a limit is hit.

Shows up in

  • Web application code review
  • Backend development
  • Database administration
A simple rate limiter (Express.js, express-rate-limit)
const rateLimit = require('express-rate-limit');
app.use('/api/', rateLimit({ windowMs: 60_000, max: 100 })); // 100 requests per minute per IP

Check yourself

1. Rate limiting mainly helps by...