1 min readsystem designbackend

System design notes: rate limiter

Token bucket, fixed window, sliding window, and the tradeoffs that matter when the service grows.

Overview

A rate limiter is one of those small systems where simple APIs hide important design choices around fairness, burst handling, storage, and failure behavior.

The main tradeoff

Fixed windows are easy to explain, token buckets handle bursts better, and sliding windows give smoother limits at the cost of more bookkeeping.