Uploads Through the API
Easy · system design problem
Every 200 MB video upload holds an API thread for 1.5 seconds. Upload traffic is about to multiply by 2.5 — and new instances take two minutes to boot.
upload-api receives each video from the mobile app and streams it to S3: 1,000 uploads/s, each holding a request thread for ~1.5 s. Threads are limited by memory (each in-flight upload buffers its chunks) and new instances take 2 minutes to boot. At T+20s a creator challenge goes viral and uploads rise 2.5× for ten minutes. S3 takes up to 55,000 requests/s; the app can upload directly to it with a pre-signed URL.
Topics
More
Codelays runs in your browser: turn on JavaScript to use it.