

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: DoS
incomplete
2: Rate Limiting
incomplete
3: Protecting Auth from Abuse
incomplete
4: Throttling Requests
incomplete
5: Queuing Work
incomplete
6: Resource Limits
incomplete
7: Timeouts
incomplete
8: Usage Quotas
incomplete
9: DDoS
incomplete
10: Mitigating DDoS
incomplete
11: Bot Detection
incomplete
12: CAPTCHA
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
A throttle limits how quickly work begins by delaying or rejecting excess requests. A queue accepts work now and holds onto it for later processing.
Throttling is the right answer when the client needs an immediate response, but queuing is usually the better choice when the work can be done asynchronously.
For example, a Google search probably needs an immediate response, so excess requests should get a 429. A PDF report export, on the other hand, can be queued. When it's ready, the system can email the user a download link.
With queuing, throughput matters more than latency. It's "how many PDFs can I generate per hour," not "how many minutes does an individual PDF take to generate."
The simplest queuing system is a database table that tracks work to be done, plus a background worker that processes it. More sophisticated options like RabbitMQ or Redis Streams exist as well.