Sub topic 1
Clarifying Requirements and Scope
Every design starts with a list of what the system must do and how well it must do it. This chapter shows how to turn the vague prompt "design a video streaming platform" into a requirements list that later chapters can build on: capacity estimates, architecture, and trade-offs.
Prerequisites
This chapter assumes you already know:
- Basic web architecture: clients, APIs, and databases.
- HTTP and caching at the level of cache headers and cache hits and misses.
- What object storage and message queues are, and roughly what each is used for.
- How to read short Python or shell snippets.
You do not need any video knowledge yet. The next chapters cover codecs, containers and bitrate.
Why requirements come first
"Design a video streaming platform" can mean a service like YouTube, where anyone uploads. It can mean Netflix, where a studio supplies a fixed catalog. It can mean a live sports service, or a video feature inside a corporate training tool. Each reading leads to a different design. An upload-heavy service needs a strong ingest path. A fixed catalog can be transcoded once and tuned carefully. A live service has hard latency limits that on-demand video does not.
Spend the first part of a design session asking questions. Write down the answers as assumptions, and keep them visible. When a later decision looks arbitrary, you can trace it back to a requirement.
Scoping questions to ask
Group your questions so you do not miss a category.
- Content source. Who uploads video? Open users, vetted creators, or internal staff? This sets the abuse risk and the upload volume.
- Content type. Is it on-demand only, or live too? Short clips or feature-length films?
- Audience. How many users, in which regions, on which devices (phones, browsers, smart TVs)?
- Features. Is search, recommendation, comments, or subtitles required, or only playback?
- Business rules. Is content free, paid, or region-restricted? Does it need DRM (digital rights management, which encrypts content so only licensed players can decode it)?
A short exchange might settle most of this:
| Question | Assumed answer |
|---|---|
| Who uploads? | Registered creators, not anonymous users |
| On-demand or live? | On-demand only for this design |
| Scale? | 50 million monthly active users, global |
| Devices? | Web, iOS, Android, smart TVs |
| Protection? | Signed URLs for all content, DRM for premium titles |
Functional requirements
Functional requirements describe what the system does. For an on-demand platform, a reasonable core is:
- A creator can upload a video file and attach metadata such as title and description.
- The system processes the upload into formats that play on all target devices.
- A viewer can browse or search the catalog and start playback.
- Playback adapts to the viewer's network conditions without the viewer doing anything.
- A viewer can pause, seek, and resume where they left off.
- A creator can see the processing status of an upload and can delete a video.
Requirement 4 is the one that shapes the whole design. A single file served over HTTP cannot change quality mid-stream. To adapt, the platform must prepare several versions of each video and cut them into small pieces. Chapters on the bitrate ladder, segmentation and adaptive playback explain how.
Non-functional requirements
Non-functional requirements describe how well the system behaves. Vague words like "fast" or "reliable" are not useful. Attach a number to each one.
| Quality | Example target | Why it matters |
|---|---|---|
| Startup time | Playback starts in under 2 seconds at the 95th percentile | Viewers abandon slow starts |
| Rebuffering | Under 0.5% of watch time spent stalled | Stalls are the most visible quality problem |
| Availability | 99.9% for playback, 99.5% for upload | Playback is the core product |
| Durability | No loss of uploaded source files | Source files are the master copy |
| Processing delay | Video is playable within 30 minutes of upload for a typical 10-minute clip | Creators expect quick publishing |
| Scalability | Handle a 3x traffic peak during popular releases | Demand is spiky |
| Cost | Delivery cost per hour watched stays under a set budget | Bandwidth is the largest expense |
Notice that the availability targets differ between playback and upload. It is common and reasonable to make the viewing path more reliable than the creation path, because viewers outnumber creators by orders of magnitude.
Read-heavy versus write-heavy
A streaming platform is extremely read-heavy. A video is uploaded once and watched many times. This one fact drives several decisions: processing can be slow and asynchronous, while delivery must be fast and cached close to viewers. Record this ratio as an assumption. For example, assume 1 upload for every 10,000 views, and later check your design against it.
Scope: in, out, and deferred
State clearly what you will not design. Scope boundaries stop a design from sprawling and give reviewers something to challenge.
- In scope: upload, transcoding, packaging, storage, CDN delivery, adaptive playback, basic quality monitoring.
- Briefly covered: catalog and search, content protection.
- Out of scope for now: live streaming, comments, payments, ad insertion, creator analytics dashboards.
"Out of scope" does not mean "ignored forever." Later chapters extend the design to live streaming and show where it fits. Naming it early lets you leave room for it. For example, if you expect live streaming later, you will prefer a segment-based format now, since live reuses the same segments.
Turning requirements into design constraints
Requirements are only useful if they change decisions. Walk through each one and ask what it forces.
| Requirement | Design consequence |
|---|---|
| Adaptive quality on varying networks | Multiple renditions, segmented packaging (HLS or DASH) |
| Global audience, startup under 2 s | CDN with edge caching close to viewers |
| Read-heavy traffic | Cache aggressively; keep the origin out of the hot path |
| Upload durability | Write sources to durable object storage before acknowledging |
| Processing within 30 minutes | Parallel, queue-driven transcoding workers |
| Many device types | Several codecs and container formats |
| Premium content | Encrypted segments and licence servers |
The diagram below shows how the requirements feed the other areas of the design.
Writing requirements as checkable statements
A good requirement can be tested. You can express targets in code and later compare them to measurements from monitoring. The Python below captures a few targets and checks a set of sample measurements against them.
TARGETS = {
"startup_p95_seconds": 2.0,
"rebuffer_ratio": 0.005, # 0.5% of watch time
"availability": 0.999,
}
def percentile(values, p):
ordered = sorted(values)
index = min(len(ordered) - 1, int(p / 100 * len(ordered)))
return ordered[index]
def check(startup_times, stalled_seconds, watched_seconds, successful, total):
results = {
"startup_p95_seconds": percentile(startup_times, 95) <= TARGETS["startup_p95_seconds"],
"rebuffer_ratio": stalled_seconds / watched_seconds <= TARGETS["rebuffer_ratio"],
"availability": successful / total >= TARGETS["availability"],
}
return results
print(check(
startup_times=[0.8, 1.1, 1.4, 1.9, 2.6, 1.0, 0.9, 1.2, 1.3, 1.5],
stalled_seconds=120,
watched_seconds=36_000,
successful=99_950,
total=100_000,
))Running this prints {'startup_p95_seconds': False, 'rebuffer_ratio': True, 'availability': True}. The slow 2.6 second sample lands at the 95th percentile of this small set, so the startup target fails while the other two pass. Turning requirements into checks like this keeps the discussion honest, and the same idea returns in the chapter on quality of experience.
Common mistakes
- Starting with technology. Naming Kafka, S3 or a specific CDN before you know the requirements locks in choices you cannot justify.
- Unmeasurable targets. "Low latency" gives no way to tell whether the design passed. Use percentiles and units.
- Using averages. An average startup time of 1 second can hide a tail of viewers who wait 10 seconds. Use the 95th or 99th percentile.
- Ignoring the long tail of devices. Smart TVs and older phones often support fewer codecs, which affects what you must transcode.
- Scoping silently. If you leave out live streaming or DRM without saying so, others may assume you forgot it.
What comes next
With requirements fixed, the next chapter converts them into numbers. You will estimate storage, bandwidth and transcoding load from the user counts and watch times assumed here.
Exercise
A product manager says, "The platform should be fast and reliable." Rewrite this as two measurable non-functional requirements, and name one design consequence of each.
Show answer
Example: (1) "Playback starts in under 2 seconds at the 95th percentile." Consequence: serve segments from a CDN edge close to viewers and keep the first segment small. (2) "Playback availability of 99.9% measured monthly." Consequence: run multiple origin replicas and CDN failover so a single component failure does not stop playback. Any measurable targets with a unit or percentile and a matching consequence are acceptable.
Exercise
Why is it reasonable to set a lower availability target for upload (99.5%) than for playback (99.9%)?
Show answer
The platform is read-heavy: many viewers watch each uploaded video. A playback outage affects every active viewer immediately, while a short upload outage affects a few creators who can retry. Spending on higher availability is better directed at the viewing path.
Exercise
You assume 1 upload per 10,000 views. Name two design choices that this ratio justifies.
Show answer
Transcoding can be asynchronous and queue-driven, because the write volume is low and a delay of minutes is acceptable. Delivery should rely on CDN caching so that most views never reach the origin, because reads vastly outnumber writes.