What is rate limiting and where should it live?
AdvancedConceptLoad Balancers, Proxies & CDNs
Answer
Controlling request rate per client key to protect backends and ensure fairness. Algorithms: token bucket, leaky bucket, fixed and sliding window. Respond with 429 and Retry-After.
Layers: CDN/WAF for coarse abuse, API gateway or ingress for per-API-key quotas, application for business rules. nginx: limit_req_zone $binary_remote_addr zone=api:10m rate=10r/s; plus limit_req zone=api burst=20 nodelay;.
More on Load Balancers, Proxies & CDNs
What is a load balancer and why do we use one?BeginnerWhat is the difference between L4 and L7 load balancing?IntermediateCompare ALB, NLB, GWLB and Classic Load Balancer in AWS.IntermediateWhat load-balancing algorithms are common?BeginnerWhat are health checks and how should they be designed?AdvancedWhat is connection draining (deregistration delay)?Intermediate