Catalogue / figma-2017-rate-limiter

Figma's homegrown rate limiter counts requests in Redis hashes of small fixed windows and shadow-bans spammers instead of returning 429

Figma, 2017. Web application rate limiter.

Organisation
Figma
Evidence
Reported from production
Source
An alternative approach to rate limiting

Figma blog, published 2017-04-12

Records

Decision#d1

Count requests in many small fixed windows per sender instead of a token bucket, one fixed window or a per-request log

Decision#d2

Keep rate-limit counters in Redis, not in the PostgreSQL database

Decision#d3

Err on the harsh side by summing one extra small window when checking mid-window

Decision#d4

Answer rate-limited spammers with a normal 200 and silently drop their invitations

Sign in to read what was chosen, what was rejected and what it cost, each with its place in the source. An account is free. The job-queue cards are open without one.