TLDR Web Dev · ARTICLES & TUTORIALS

VISUALIZING ALGORITHMS FOR RATE LIMITING

smudge.ai8 min read

Summary from the TLDR Web Dev newsletter

Rate limiting is used to control traffic on a service by blocking requests that exceed a set limit. Three common algorithms for rate limiting are fixed windows, sliding windows, and token buckets. Fixed windows are easy to understand and implement, sliding windows are better for high traffic, and token buckets allow for bursts of traffic while enforcing a long-term average rate.