

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
Throttling and rate limiting are often used interchangeably... but when we get super picky about definitions, they're a bit different.
Throttling is useful when expensive work or a fragile downstream system can saturate under traffic spikes. For example, on Boot.dev we generate preview images for profile pages, but if 1000 users all request a new image at the same time, our image service throttles the requests to avoid becoming overwhelmed.
Imagine a report generation service that's only allowed to start five jobs per second across all clients. Rotating IP addresses doesn't help an attacker because everyone shares the same ceiling.
Rejected requests should get 429 Too Many Requests with a Retry-After header so clients know when to try again.
Product search is Bearly Secure's expensive public query surface.
Add a shared throttle to GET /search.
createRateLimiter already tracks requests and adds the standard rate-limit and Retry-After headers. Configure one limiter, then pass it to the search route before its existing handler.
This in-memory throttle creates one shared ceiling per Bearly Secure process. A multi-instance production deployment needs a shared limiter at the edge or in a shared store.
With Bearly Secure still running, run and submit the CLI tests from the project root.