Video catalogue (Netflix-style)
Titles, profiles, playback and recommendations: modelling content, per-profile state and a swappable recommendation strategy.
On the roadmap:Software Design · step 6: Low-level design: games and apps
Lesson 16 of 16 · 10 min read · quiz · exercise
The problem
Subscribers have accounts with several profiles. They browse a catalogue of movies and series, play titles, resume where they stopped, and see recommendations. This lesson models the domain. The streaming infrastructure (transcoding, CDN) is in the video-streaming lesson of the classic designs course.
Entities
Figure SDA-LLD-16-1 · Video catalogue classes · © forcsguy.com
A playable unit is a movie or an episode; the player only needs an asset id and a duration.
Playback and resume
Figure SDA-LLD-16-2 · Playback state · © forcsguy.com
class Player {
state: "STOPPED" | "PLAYING" | "PAUSED" | "FINISHED" = "STOPPED";
constructor(private profile: Profile, private progress: ProgressStore) {}
play(unit: Playable) {
if (!canPlay(this.profile, unit)) throw new Error("not allowed"); // rating and plan rules, one place
this.state = "PLAYING";
this.seek(this.progress.get(this.profile.id, unit.id) ?? 0);
}
tick(unit: Playable, pos: number) {
this.progress.save(this.profile.id, unit.id, pos); // every few seconds, not every frame
if (pos >= unit.duration * 0.95) this.state = "FINISHED";
}
}
Recommendations as a strategy
interface Recommender { forProfile(p: Profile, n: number): Title[] }
const popularInGenre: Recommender = {
forProfile: (p, n) => catalog.byGenres(topGenresOf(p)).filter(t => !watched(p, t) && allowed(p, t)).sort(byPopularity).slice(0, n),
};
Start with a simple strategy (popular in the genres you watch, not yet seen, allowed for the profile). Replace it later with collaborative or learned models behind the same interface.
Design notes
- One rule for access:
canPlayandallowedcombine plan limits, region licensing, maturity rating and device limits, and are used everywhere. - Concurrent streams: the plan limits simultaneous streams; track active sessions and refuse extra ones with a clear message.
- Progress writes are frequent and approximate; buffer and save periodically, and let the latest write win.
- Catalogue changes (titles added or removed by region and date) are data, not code.
- Extensions: downloads, parental controls, ratings, search, and "because you watched" rows.
Real-world reading
Related reading
- ByteByteGo: System Design Video SeriesAlex Xu · ByteByteGoYouTube
- Performance Optimization on Image, Video, Page LoadGoogle engineers · GoogleCase Studies
- Netflix: What Happens When You Press Play?High Scalability engineers · High ScalabilityBlogs
- SVE: Distributed Video Processing at Facebook Scale (paper)Huang et al. · Facebook ScalePapers
Show 6 moreShow fewer
- CS Video CoursesDeveloper-Y · GitHubGitHub
- Deterministic Aperture: A Distributed, Load Balancing Algorithm at TwitterTwitter engineers · TwitterCase Studies
- The Google File System (paper)Ghemawat, Gobioff and Leung · GooglePapers
- Aroma: Using ML for Code Recommendation at FacebookFacebook engineers · FacebookCase Studies
- Wealthfront Engineering BlogWealthfront engineers · WealthfrontBlogs
- Xero BlogXero engineers · XeroBlogs
Check your understanding
Question 1 of 3
0 correct so far
Where does 'continue watching' progress belong?
Practise it: Social feed
Everything below is already set up for this lesson: change the design, run the traffic, and see whether you meet the goal.
- 1The task
- 2Build and test
Mixed reads and writes, busy in the evening.
Add or remove parts, move traffic up and down, and break something to see what gives way first.
Try it yourself
Add parental controls and a download-for-offline feature. What do they touch?
Click what a strong design here would need:
More in Design practice
© 2026 forcsguy.com. Original lesson text and diagrams. Books and sites linked above belong to their authors.