All Questions
Api Design medium

Your API has free (100 req/min) and paid (10,000 req/min) tiers. How should you implement this?

  1. A Use a centralized rate limiting service with tier-specific quotas stored in a fast key-value store like Redis, keyed by the client's API token.
  2. B Deploy physically isolated clusters of API servers for each tier, using DNS-level routing to direct free and paid users to their respective hardware.
  3. C Embed the specific rate limit values directly into the application's source code to ensure that every request undergoes strictly local validation logic.
  4. D Enforce a uniform rate limit for all users across the system to maintain fairness and prevent any single client from monopolizing the shared thread pool.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions