Throttling, quotas, and cost-safe demand shaping
Select client, API, queue, concurrency, and downstream throttling from SLO, quota, fairness, retry, and budget constraints. Use bounded retries, backoff, buffering, admission control, and reserved capacity without shifting overload downstream.
LESSON GOALS
By the end, you can
- Select client, API, queue, concurrency, and downstream throttling from SLO, quota, fairness, retry, and budget constraints.
- Use bounded retries, backoff, buffering, admission control, and reserved capacity without shifting overload downstream.
01
Locate Limiting Admission Rate
Throttling design starts at the narrowest safe resource, not at the largest published service quota. Record incoming steady rate, burst size and duration, accepted-request latency, tenant fairness unit, API integration capacity, Lambda concurrency, queue age objective, database connection and transaction limits, and budget. A quota is an AWS account or service ceiling; a throttle is an admission policy; downstream safe capacity is the rate the complete path can sustain. These values can differ. If the database safely commits fewer transactions than the API can admit, raising the API ceiling increases failure and cost rather than throughput. Decide which work is synchronous and must receive an immediate result, which can be accepted asynchronously, and which should be rejected. Authenticate before enforcing tenant fairness so callers cannot evade per-tenant limits by changing an untrusted identifier. Reserve capacity for critical operations where the business contract requires it, and make rejection behavior explicit with stable errors and retry guidance.
02
Combine Token Bucket Queue And Concurrency
API Gateway uses token-bucket throttling concepts for rate and burst control under documented precedence and best-effort behavior. Apply an account, stage, method, usage-plan, or client boundary only after mapping it to fairness and downstream protection; current details belong to the direct throttling source. A queue smooths asynchronous bursts by converting request spikes into backlog, but it is valid only if retention and oldest-message age remain inside the SLO. Lambda reserved concurrency can cap a consumer and protect other functions or a database, while autoscaling adds workers after delay. Neither should be allowed to exceed downstream-safe concurrency. Caching removes repeated safe reads when keys, TTL, and authorization permit; it does not solve unique writes. Client retries must be bounded, use exponential backoff with jitter, honor retry guidance where available, and preserve idempotency. Immediate synchronized retries multiply offered load exactly when the system is least able to absorb it. Protective throttling should shed excess work before an expensive dependency, not after that dependency has already performed most of the work.
03
Diagnose First Failed Gate
Use the `saa-viz-network-path-lab` throttling preset to predict the first failed gate before reveal. Trace client, DNS, API entry, configured rate and burst admission, application, and downstream capacity in order. In the preset, routing and authorization can pass while the application-response-after-routing gate fails because offered rate exceeds the safe admitted rate; later database overload is a secondary consequence, not the first explanation. Repair the earliest gate by lowering or partitioning admission, queueing eligible writes, capping consumer concurrency, or increasing the actual bottleneck if budget and architecture allow. Then replay with bounded jittered retries and verify that retry traffic does not amplify the burst. Monitor admitted and throttled counts, 429 responses, integration latency, Lambda concurrency and throttles, queue depth and oldest age, database connections and TPS, retry attempts, and cost per successful request. A sustained backlog above its age target indicates permanent undercapacity or excessive admission, not a transient burst. Throttling loses when it rejects required throughput despite available safe capacity; quota increase becomes correct only when the AWS ceiling, rather than downstream or budget, is the measured bottleneck.
DECISION TABLE
Compare the architecture constraints
| requirement | choose | because | reject |
|---|---|---|---|
| fair public admission | API token bucket | protects SLO | unlimited quota |
| async burst | SQS buffer | smooths workers | direct DB fanout |
| function cap | reserved concurrency | protects downstream | quota raise |
| transient retry | bounded jitter backoff | avoids storm | immediate loops |
GUIDED WORKED SCENARIO
Reason from the stated constraints
This is a guided example, not a question to memorise. The knowledge check uses new situations to test the same reasoning.
A public API bursts to 5,000 requests/s; the database safely handles 500 transactions/s, p95 accepted latency is two seconds, queue age SLO is five minutes and one tenant may use at most 20%.
Requirements
- Protect 500 TPS database
- Fairness 20%
- Bound retries
- Stay within budget
Reasoning path
- For Throttling, quotas, and cost-safe demand shaping, eliminate any candidate that violates the explicit security or failure/performance dimension.
- Quantify the scale, operating burden, and complete cost horizon specific to Throttling, quotas, and cost-safe demand shaping before ranking valid choices.
- Select the lowest-total-cost valid design for Throttling, quotas, and cost-safe demand shaping, then change one decisive constraint and re-evaluate the loser.
Why it wins
- Protects actual bottleneck
- Fairness and SLO are measurable
- Retries cannot multiply demand without bound
Why the alternatives lose
Still overloads DB/budget
Becomes correct when: AWS quota is bottleneckShifts overload downstream
Becomes correct when: Downstream scales proportionallyAmplifies burst
Becomes correct when: Rare idempotent transient failure with bounded backoffARCHITECTURE VISUAL · TEXT MODE
Inspect the model
For Throttling, quotas, and cost-safe demand shaping, read a keyboard-ordered table of requirements, quantities, candidate path or service, first failed constraint, repair, winner, and changed-constraint result; animation and color are unnecessary.
saa-viz-network-path-labKNOWLEDGE CHECK
Answer one question at a time
Pass every question to complete this lesson. Each answer includes reasoning before you continue.
Load tests prove downstream headroom, but an AWS quota below that safe rate blocks admitted work. Which previously losing action becomes valid?
Reveal reasoning
A quota increase becomes appropriate because the AWS quota—not downstream capacity—is now the measured bottleneck.
A dashboard labels 429 responses as application failures even though no application handler ran. How should the populations be classified?
Reveal reasoning
Classify 429 responses rejected at admission separately from admitted requests; throttling is protective demand shaping, not an application execution failure.
Using preset net-api-throttling-overload, predict the two request populations before reveal: offered 1,200/s with a 900/s admission limit and 900/s downstream capacity.
Reveal reasoning
At admission-throttle-and-burst, 300 requests/s receive 429 without application execution; 900 requests/s are admitted and succeed within downstream capacity. Do not label either branch an application failure.
PRIMARY SOURCES
Verify the claims
- primaryWhat is Amazon API Gateway?aws-srv-apigw · retrieved 2026-07-29
- primaryLambda quotasaws-lambda-quotas · retrieved 2026-07-30
- primaryAmazon SQS standard queuesaws-sqs-standard-queues · retrieved 2026-07-30
- primaryTarget tracking scaling policies for Amazon EC2 Auto Scalingaws-asg-target-tracking · retrieved 2026-07-30
- primaryWhat is Amazon CloudWatch?aws-obs-cloudwatch · retrieved 2026-07-29
- primaryApi Gateway Throttlingaws-api-gateway-throttling · retrieved 2026-07-30