Skip to main content
Uploading a 500MB video to YouTube takes time. Processing it takes even longer. If your API client waits for a response, it will timeout.

The Shower Principle

Good architecture is like a shower thought: It happens in the background while you do something else.
  1. Fire and Forget: You send us the video. We say “Received”. You hang up.
  2. Background Worker: We transcode, upload, and verify the video with YouTube.
  3. Webhook: We call you back: “It’s done.”

Designing for Async

  • UI: Don’t show a spinner. Show a “Processing” state and let the user leave the page.
  • Database: Store a status field (pending, processing, published).
  • Webhooks: Always listen for post.failed. Background jobs fail silently if you don’t listen.