Sign in to keep reading
“Design Sora” is free with an account. Your progress and bookmarks follow you across devices.
Sign in to continueNEW: ML Mock & Coaching with a 20+ year experience coach. Save $20 on sessions for Premium.ML Mock & Coaching now available
NEW: ML Mock & Coaching with a 20+ year experience coach. Save $20 on sessions for Premium.ML Mock & Coaching now available
Design Sora, a Text-to-Video Generation Platform - This looks like "yet another async job system" on the surface, but the staff-level signal comes from recognizing what's actually scarce — GPU-minutes — and letting that number pull the design toward scheduling, two-pass generation, and cost.
Written by a Staff+ Engineer and an Engineering Manager
12+ years of experience in distributed systems and real-time messaging. Tech lead for large-scale chat applications serving billions of users. Over 12 years of industry experience with 6 years in engineering leadership, building and scaling tech infrastructure teams that deliver end-to-end large-scale distributed systems.
“Design Sora” is free with an account. Your progress and bookmarks follow you across devices.
Sign in to continueWhat to Design?
Could you answer these today? Tick what you already know.
We'll scope to four FRs. Each one maps to exactly one flow in the High Level Design.
FR1 — Generate
A user submits a text prompt (optionally with an image or video as conditioning input) and generation parameters (duration up to 20s, resolution up to 1080p, aspect ratio) to create a video.
FR2 — Track
A user can see the status and progress of their generation, including a low-resolution preview before the final render completes.
FR3 — View & browse
A user can watch their finished videos and browse a public explore feed of videos shared by others.
FR4 — Remix
A user can take an existing video (theirs or a public one) and re-generate it with a modified prompt, preserving lineage back to the original.
Out of scope (say this out loud): model training and fine-tuning pipelines, billing/credits, mobile capture, editing timelines (storyboards), and recommendation ranking for the feed beyond a simple recency/popularity ordering. Each of these is its own interview.
NFR1 — Latency is asymmetric. Submission acknowledgment must be fast (< 500ms p99), but generation itself is minutes-scale and users accept that — if we give honest progress and a preview. Target: draft-quality preview within 30–60s; final 1080p render within 2–10 min depending on tier.
NFR2 — Cost efficiency over raw latency. GPU fleet utilization is the dominant cost line. We optimize for high utilization (target > 60–70%) and fair queueing over minimizing any single job's wait.
NFR3 — Availability with graceful degradation. The control plane (submit, status, view) targets 99.9%. The GPU data plane can degrade — under capacity crunch, queue times grow and free-tier resolution drops, but submissions never fail outright.
NFR4 — Durability. Generated videos are user-created content; once a generation succeeds, the asset must not be lost (11 nines object-store durability).
NFR5 — Safety is a hard gate, not best-effort. No video reaches the user or the public feed without passing prompt-level and frame-level moderation. This is a correctness requirement, not an optimization.
NFR6 — Provenance. Every output is watermarked and carries C2PA metadata identifying it as AI-generated.
Assume a successful consumer launch:
| Scale Assumptions | |
|---|---|
| Parameter | Value |
| Users | 10M MAU, ~1M DAU, avg 5 generations per active user per day |
| Generation volume | 5M generations/day ≈ 58 submissions/sec avg, ~175/sec peak (3× diurnal) |
| Draft pass cost | 5s @ 480p preview ≈ ~30 GPU-seconds on H100-class hardware |
| Final pass cost | avg job ~10s @ 720p–1080p ≈ ~3 GPU-minutes |
| Blended average | ~3 GPU-min per generation |
The GPU fleet math — the number that identifies the real system:
Daily demand = 5M generations × 3 GPU-min = 15M GPU-min/day
= 250K GPU-hours/day
→ ~10,400 GPUs running continuously
At 60% achievable utilization → provision ~17K H100s
This single number justifies the entire scheduling deep dive: a 5% utilization improvement is ~850 GPUs, i.e., tens of millions of dollars a year. The API tier, by contrast, is trivially small — a handful of stateless servers.
Interviewer signal: candidates who compute the GPU fleet size have identified the real system; candidates who dwell on API QPS have not.
Before drawing boxes, orient around three tensions that shape everything:
With minutes-long jobs and a fixed GPU fleet, you cannot buy your way out of a spike in real time (GPU capacity has procurement lead times of months). So the system's job is to shape demand: priority tiers (paid vs. free), fair scheduling per user, preview-first generation so users get value early, and honest progress so waiting feels acceptable. This is closer to designing a build farm or a render farm than a CRUD service.
Submissions, status reads, and feed browsing are cheap, high-QPS, stateless-friendly operations that should stay up even when the GPU fleet is saturated or partially down. Generation is expensive, stateful, and failure-prone. Different availability targets, different scaling models, different teams. The boundary between them is a durable queue.
Unlike a photo-upload product where moderation can be async-after-publish, a generative system creates the risky content itself. The moderation gates (prompt-time and frame-time) sit inline before delivery, which means their latency and availability budgets are part of the generation SLO.
The core recognition
This is a GPU-bound async job system wearing a consumer product's clothes. Size the fleet in the estimations, and let that number pull the interview toward scheduling, two-pass generation, and cost — while never forgetting that safety gates sit in the critical path and that immutable assets make delivery the easy part.
| Design Decisions | |
|---|---|
| Design choice | Reason |
| Durable queue between planes | Control plane stays up at 99.9% even when the GPU fleet is saturated |
| Two-pass generation (draft → final) | Preview in 30–60s converts an opaque wait into proof of intent; early cancels refund GPU-minutes |
| Storage |
| ~30MB avg output → 150TB/day ≈ 55PB/year before tiering |
| Egress | ~1.5PB/day if each DAU watches 50 videos/day → CDN offload mandatory |
| Tier × size-class queue matrix | Fair scheduling plus bin-packing — draft jobs fill fragmentation gaps between large renders |
| Inline safety gates | Rejecting a bad prompt in 100ms saves ~3 GPU-minutes of wasted render |
| Immutable assets + content-addressed keys | Infinite CDN TTLs, zero invalidation logic |