Skip to content
Preptima
hardDesignScenarioMidSeniorStaff

Your rate limiter runs in five regions with a cap of 100 requests a minute per user. One user gets 500 through. Where did the counting go wrong?

Global rate limiting fails when each region owns a local counter, because five regions each allowing 100 requests creates a 500-request ceiling. Use one atomic shared counter, route each user to an owning region, or lease regional budget deliberately. It also connects distributed counters to the point an interviewer is testing.

5 min readUpdated 2026-08-15

Answer

Short answer

A global rate limit cannot be enforced by five independent regional counters. Either every region mutates one shared atomic counter, requests for a user are routed to that user's owning region, or each region leases part of the global budget from a coordinator. Static per-region splitting is not equivalent; it under-limits users who stay in one region and still needs a story for failover and borrowing.

Was this answer helpful?

Likely follow-ups

  • If you route each user's requests to one owning region, what happens to a user whose owning region is being drained for a deploy?
  • How would you let a region borrow unused budget from the other four without a round trip on every request?
  • Does a 429 you returned count against the user's own limit, and does a client retry count twice?
  • Where would you put the limit if the expensive thing is not the request count but the size of the response?

Related questions

Further reading