Lesson 7 of 16
40. Design Video Upload and Streaming (YouTube)

40.6 How does the upload pipeline work?

3 min read+10 XP

Step 5: Deep dives (10 minutes)

  • Direct to storage: the API hands out a signed upload URL (Chapter 11); gigabytes never pass through app servers.
  • Resumable: the file goes in chunks (say 8 MB). If the connection drops, the client asks "what do you have?" and sends only the rest. In the chapter's code, a 2 GB upload that drops after 180 chunks resumes with the last 70, not from zero.
  • Validate early: check the format and duration before spending transcoding money; reject corrupt or disallowed files.
  • Status the creator can see: uploading → processing (with progress) → ready (or failed, with a reason).

Memory code: "Upload in pieces, resume from the gap, check before you spend."