Sell It Lesson 18 of 27

The Photo Flood

The Story

Narrated

Your trip planner is humming along. Users sign up, generate itineraries with streaming, and process photos in the background with QStash from Lesson 17. Each photo gets its own callback, retries happen automatically, and nobody stares at a spinner. Things are good.

Then your app gets popular.

Five users upload photos at the same time. User A uploads 20 photos from Barcelona. User B uploads 15 from Tokyo. User C uploads 10 from Paris. That’s 45 QStash callbacks hitting your server in rapid succession. Each one calls your AI captioning service, each one resizes a photo, each one writes to storage.

And your AI captioning service has a rate limit. Ten requests per minute. You just sent it 45 requests in the span of a few seconds. Requests 1 through 10 succeed. Requests 11 through 45 get rejected with “rate limit exceeded.” QStash retries them, but they fail again because the rate limit hasn’t reset yet. Eventually some succeed on retry, some don’t. Users see random failures. Some photos get captions, some get errors.

But it gets worse. While your server is drowning in photo callbacks, another user tries to generate a trip. Their request is competing for the same serverless function resources. Everything slows down. One burst of uploads just degraded the experience for everyone.

This is the photo flood. And the solution is something you encounter every single day in the real world: a queue.


This lesson continues with the full course

The story intro above is free to read. The full lesson — prompts, explanations, and adapt-it exercises — requires the Build It Right ($149) tier or above.

Audio narration coming soon