Design Per-Tenant and Per-App Throttling for Microsoft Graph API

Last updated: November 29, 2026

Quick Overview

Design the throttling layer for an API gateway like Microsoft Graph that enforces limits per app, per tenant and per user across many backend services, returns proper retry guidance, and protects backends during overload.

Microsoft
System Design
Software Engineer
Microsoft
November 29, 2026
Software Engineer
System Design Round
System Design
Medium

0

0

0 solved


Design the throttling layer for an API gateway like Microsoft Graph that enforces limits per app, per tenant and per user across many backend services, returns proper retry guidance, and protects backends during overload.

Graph fronts Outlook, SharePoint, Teams and directory services for millions of apps, so throttling is a core Microsoft problem. The interviewer checks multi-dimensional limits, distributed counting across gateway nodes, and how 429 with Retry-After fits client behavior.

What the Interviewer Expects
  • Defines limit dimensions: app across all tenants, app per tenant, user, and resource-specific limits
  • Picks an algorithm (token bucket or sliding window) and justifies it
  • Counts across gateway instances with a shared store or local plus sync approach
  • Returns 429 with Retry-After and explains client backoff
  • Adds adaptive load shedding driven by backend health
  • Discusses cost-based limits where some requests are heavier than others
Key Topics to Cover
Token bucket
Distributed rate limiting
Retry-After
Adaptive load shedding
Request cost
How to Approach This
  1. Start by clarifying functional and non-functional requirements with the interviewer.
  2. Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
  3. Draw a high-level architecture first, then deep dive into 1-2 critical components.
  4. Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
  5. Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
  • A single gateway node sees 1/200th of an app's traffic. How do you enforce a global limit without a store call per request?
  • How should a batch request with 20 sub-requests count?
  • How do you stop one tenant's runaway script from hurting others in the same mailbox database?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice System Design Problems
Sample Answer
Requirements

Graph receives millions of requests per second through regional gateways. Limits exist at several scopes: per app across all tenants, per app per tenant, per user, plus backend-specific limits (Outloo...

High-Level Design

Request path: client -> regional gateway -> throttle module -> router -> backend service. The throttle module evaluates a list of policies matched by (appId, tenantId, userId, resource). Each po...


Submit Your Answer
Markdown supported