Design a video streaming database like Netflix
PremiumDatabase designMedium
- Watch progress
- Content catalog
- Regional licensing
Quick answer
This database design interview question asks you to design a video streaming database like Netflix. Aim for a design that stores data correctly and serves its main queries well, then explain the schema, keys, indexes and trade-offs. Interviewers want to see how you model entities, choose keys and design for the real access patterns.
The problem
Design the database for a video streaming service like Netflix. It stores films and series with seasons and episodes, up to 5 profiles per account and per-country licences. The hard part is resuming an episode at the exact second it was paused, on any device, at 1.5 million progress writes per second.
Each episode has several audio and subtitle tracks. Each profile has a watch list, a continue-watching row and a viewing history. Titles are licensed per country with start and end dates. Video files live on a CDN; you design the metadata and state tables.
What must a video streaming database like Netflix do?
- Play and resume: When playback starts, read the last position; while playing, save the position every 10 seconds; mark an episode finished at 95 percent and advance continue-watching to the next episode.
- Title page: A film or series with seasons, episodes in order, runtime, maturity rating, cast and available languages, filtered to the viewer's country.
How well must it do it?
- Resume accuracy: A report that arrives late must never overwrite a newer one (a deliberate rewind, being newer, is saved), and the saved position must survive a device crash.
- Regional correctness: A title must never be shown as playable in a country where its licence has ended.
What scale should you design for?
Use these numbers in your estimates.
The scale numbers unlock with this questionUnlock
Key concepts
- Watch progress
- Content catalog
- Regional licensing
- User profiles
- Hot writes
How you’ll practise
- Access patterns
- Entities
- Schema
- Indexes and queries
- Scale and consistency
- Wrap-up
Lala, personalized to you, gives a hint when you ask and reviews your design when you are ready.
What do interviewers look for?
In any database design round.
- Lists the entities and how they relate before writing tables
- Designs the schema around the main access patterns
- Chooses primary keys, foreign keys and indexes with reasons
- Explains where to normalise and where to denormalise
- Considers integrity, transactions and concurrent writes
- Plans for growth: partitioning, archiving and migrations
Questions people ask about this interview question
- Which design type is this question?
- It is a database design question. You design a video streaming database like Netflix and explain your choices the way you would in an interview.
- Is this question asked at entry level?
- It is marked Medium. Entry-level engineers can practise it, but it expects you to reason about requirements and trade-offs, not only list components.
- What should I cover first?
- Start with the entities and the main queries the database must answer. Agree on scope with the interviewer before you design anything.
- Can I practise it for free?
- It is a premium question. Sign up and unlock it once for 10 credits; it then stays unlocked. When you finish, Lala, your personalized AI mentor, can review your design for 30 credits.
Related questions
Updated · Written by the SevyDevy team