System Design · Senior · Question 16 of 75

How do you implement rate limiting when the API runs on 20 servers?

Explanation

Local counters give a limit ×20 and depend on load balancing. Shared storage with atomic operations (or a limiter at the API gateway/CDN) gives a global limit. Client-side limits are easily bypassed.

Further reading

Problem with a question

System Design · Senior · question 16

Test yourself

Take the System Design · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz