Labs โบProtect a public API from a traffic surge0 / 9 steps
Step 1 of 9 ยท Intro
Protect a public API from a traffic surge
Absorb a viral spike at the edge so your quotas hold, and throttle the right clients.
How it works
โบAPI Gateway uses a token bucket: once request submissions exceed the steady-state rate and burst limits, clients receive HTTP 429 Too Many Requests and should retry with backoff.
โบThrottling can be set lower than the account limit per stage, per method, or per client through a usage plan. AWS describes these as best-effort targets, not guaranteed ceilings.
โบCloudFront caches only GET responses. Writes and uncacheable requests always reach the origin.
โบLimits come from AWS documentation (default quotas in us-east-1). Where AWS publishes no figure, such as how many requests a container or database handles, the lab states its assumption on the component.
What you'll build
A serverless backend at 2,000 requests a second
CloudFront in front for a 40,000 requests a second surge
What clients see when the throttle is exceeded
How to limit one noisy client without limiting everyone