Live Streaming System Design Template
RTMP, SRT and WHIP ingest, transcoding ladder, LL-HLS and LL-DASH, origin and edge fan-out, latency budget, chat and event sync, VOD archive
사용법: Use it when you design a Twitch-style live platform or answer that interview question. Fill concurrent channels, viewers and bitrates first, then write the glass-to-glass latency budget before picking segment and part durations. The main pitfall is letting per-viewer playlist and part requests reach the origin instead of collapsing them at edge and shield.
미리보기
System Design: [Live streaming platform name]
Reference design for a Twitch-style live streaming platform: RTMP, SRT and WHIP ingest, real-time transcoding into an adaptive bitrate ladder, low-latency delivery with LL-HLS (HTTP Live Streaming 2nd Edition draft, which updates RFC 8216) and low-latency DASH with CMAF chunks, an origin and edge tier that collapses millions of viewer requests, chat kept in step with video, a glass-to-glass latency budget, and a VOD archive. It follows the structure of the System Design Document template, adds a 45-minute interview path, and is pre-filled with a worked design to adapt. Replace every
[bracketed]value and every row marked Example; numbers marked Example are assumptions to recompute.
Document control
| Field | Value |
|---|---|
| Document ID | [SDD-LIVE-001] |
| System / feature | [Live ingest, transcoding, delivery, chat sync, VOD] |
| Version | [0.1] |
| Status | [Draft / In review / Approved / Implemented / Superseded] |
| Owner | [@owner] |
| Author(s) | [@author] |
| Approvers / reviewers | [@reviewer-1], [@reviewer-2] |
| Last updated | YYYY-MM-DD |
| Classification | [Internal / Confidential] |
| Protocols in scope | [RTMP / Enhanced RTMP, SRT, WHIP ingest; LL-HLS, LL-DASH delivery] |
| Related | Video Streaming System Design (system-design/design-video-streaming), Chat System Design (system-design/design-chat-system), Content Delivery Network System Design (system-design/design-cdn) |
Approvals
| Role | Name | Decision | Date |
|---|---|---|---|
| Tech lead | [@name] | [Approved / Changes requested] | YYYY-MM-DD |
| Staff / principal engineer | [@name] | [Decision] | YYYY-MM-DD |
| Video engineering lead | [@name] | [Decision] | YYYY-MM-DD |
| SRE / network | [@name] | [Decision] | YYYY-MM-DD |
| Finance (transcode and egress) | [@name] | [Decision] | YYYY-MM-DD |
Revision history
| Version | Date | Author | Change summary |
|---|---|---|---|
| 0.1 | YYYY-MM-DD | [@name] | First draft for design review |
| 0.2 | YYYY-MM-DD | [@name] | Example: Full ladder only for channels above 20 viewers or partners |
| 0.3 | YYYY-MM-DD | [@name] | Example: LL-HLS parts of 0.5 s; latency target 3 s at p50 |
| 1.0 | YYYY-MM-DD | [@name] | Example: Approved |
Contents
1. Overview
1.1 Problem statement
[Example: The platform delivers live video with standard HLS at 10 to 15 seconds of latency, so viewers react to moments long after chat has discussed them and interactive features (polls, predictions) feel broken. Every channel is transcoded into a full ladder, although most channels have fewer than five viewers, and a single popular channel recently overloaded the origin when two million viewers joined within a minute.]
1.2 Proposed solution
[Example: Broadcasters connect to the nearest ingest edge over RTMP, Enhanced RTMP, SRT or WHIP. The edge authenticates the stream key and forwards the stream over the backbone to a transcoder in a regional origin. Channels above a viewer threshold get a full ladder produced by one decoder feeding several scalers and encoders; small channels get the source plus two low renditions. A packager writes CMAF segments with 0.5 s parts and publishes LL-HLS playlists and a low-latency DASH manifest from the same media. A mid-tier shield and edge caches collapse identical requests, so the origin sees load per edge, not per viewer. Chat and interactive events carry stream timestamps so clients can align them with the frame on screen. Sources are archived for VOD and transcoded on first view.]
1.3 Decisions requested from reviewers
| ID | Question | Recommended option | Section |
|---|---|---|---|
| Q-01 | Example: Which ingest protocols? | RTMP and Enhanced RTMP for compatibility, SRT for unstable networks, WHIP for browsers | 7.1 |
| Q-02 | Example: Full ladder for every channel? | No: by viewer threshold and partner status | 7.1, 3.3 |
| Q-03 | Example: Delivery format and latency target? | LL-HLS and LL-DASH from shared CMAF media; 3 s at p50 | 7.2, 7.3 |
| Q-04 | Example: Chat alignment? | Show chat live; align timed events to media time | 7.4 |
| [Q-nn] | [Question] | [Option] | [Section] |
1.4 45-minute interview path
| Minutes | Cover | Output on the whiteboard |
|---|---|---|
| 0 to 5 | Core requirements (2.1) and below the line (2.3) | Go live, watch with ABR, chat, VOD; latency target |
| 5 to 10 | Estimates (3) with consequences | Ingest Gbit/s, transcode servers, egress Tbit/s |
| 10 to 15 | API (4) and data model (5) | Stream keys, channel state, segment naming |
| 15 to 25 | High-level design (6) | Ingest edge, transcoder, packager, origin, shield, edge, player |
| 25 to 40 | One or two deep dives | 7.3 (latency budget) by default; 7.2 (origin fan-out) if scale comes up; 7.1 (transcoding) if cost comes up |
| 40 to 45 | Failure modes and 10x (9.1, 10.1) | What breaks first and the fix |
Say early that live is different from VOD: segments exist for seconds before they are needed, so caching works by collapsing simultaneous requests, not by long retention.
2. Requirements
2.1 Core functional requirements
| ID | Requirement | Priority |
|---|---|---|
| FR-01 | Example: Broadcaster goes live with a stream key from common encoder software | Must |
| FR-02 | Example: Viewers watch with adaptive bitrate on web, mobile and TV apps | Must |
| FR-03 | Example: Low-latency mode by default, with a standard-latency fallback for older players | Must |
| FR-04 | Example: Live chat per channel with moderation | Must |
| FR-05 | Example: Timed interactive events (polls, ad markers) aligned with video | Should |
| FR-06 | Example: Past broadcasts available as VOD for 14 days | Must |
| FR-07 | Example: Viewer count shown on the channel | Must |
| [FR-nn] | [Requirement] | [Must / Should / Could] |
2.2 Non-functional requirements
| ID | Quality | Target | Measured as |
|---|---|---|---|
| NFR-01 | Glass-to-glass latency | Example: 3 s at p50, 5 s at p95 in low-latency mode | Embedded clock overlay test streams |
| NFR-02 | Startup time | Example: First frame within 2 s at p75 | Player telemetry |
| NFR-03 | Rebuffering | Example: Under 0.5% of watch time | Player telemetry |
| NFR-04 | Ingest availability | Example: 99.95% of go-live attempts succeed | Ingest logs |
| NFR-05 | Join storm | Example: 1 million viewers join one channel within 60 s without origin overload | Load test |
| NFR-06 | Stream key security | Example: No stream hijack via leaked keys after rotation | Security test |
| [NFR-nn] | [Quality] | [Target] | [Measurement] |
2.3 Below the line (out of scope)
- [Example: sub-second interactive video (video calls, co-streaming rooms), which needs WebRTC delivery end to end]
- [Example: DRM for premium live events; see Video Streaming System Design (
system-design/design-video-streaming)] - [Example: clip editing and highlights]
- [Example: chat service internals; see Chat System Design (
system-design/design-chat-system)] - [Example: recommendation of live channels]
- [Item deferred, with the release that will take it]
3. Capacity estimation
3.1 Assumptions
| Input | Value | Source |
|---|---|---|
| Peak concurrent live channels | Example: 100 000 | Platform metrics |
| Average concurrent live channels over a day | Example: 50 000 | Platform metrics |
| Peak concurrent viewers | Example: 10 million | Platform metrics |
| Largest single channel | Example: 1 million viewers | Event history |
| Average source bitrate | Example: 6 Mbit/s | Ingest metrics |
| Average delivered bitrate | Example: 3 Mbit/s | Player telemetry |
| Channels with full ladder | Example: 20% | Viewer threshold policy |
| Transcoder capacity per server | Example: 8 full ladders or 40 light ladders | Benchmark |
3.2 Ingest
- 100 000 x 6 Mbit/s = 600 Gbit/s at peak. Consequence: ingest is terminated at regional edges close to broadcasters and carried on the backbone; a single central ingest site would put all of it on transit.
3.3 Transcoding
- Full ladders: 20 000 / 8 = 2 500 servers.
- Light ladders: 80 000 / 40 = 2 000 servers.
- With 30% headroom: 4 500 / 0.7 = about 6 430, so plan 6 500 servers.
- If every channel got a full ladder: 100 000 / 8 / 0.7 = about 17 900 servers. Consequence: the viewer-threshold policy cuts transcode capacity by about 64%; decode-once pipelines (7.1) cut it further.
3.4 Egress and origin fan-out
- 10 million x 3 Mbit/s = 30 Tbit/s at peak. Consequence: delivery
needs several CDN providers or an owned edge; see Content Delivery
Network System Design (
system-design/design-cdn). - For the 1 million viewer channel with 0.5 s parts, viewers make about 2 million playlist requests/s and 2 million part requests/s. If 500 edge servers each fetch every part of 6 renditions once: 500 x 6 / 0.5 s = 6 000 requests/s to the shield, and the shield sends 6 / 0.5 = 12 requests/s to the origin. Consequence: request collapsing at edge and shield is mandatory; the origin must never see per-viewer traffic.
3.5 Chat
- A channel with 1 million viewers and 1 000 messages/s would need 1 billion deliveries/s; at 100 bytes per message that is 100 KB/s, about 800 kbit/s of chat per viewer, more than a low video rendition. Consequence: cap the displayed rate per viewer (Example: 50 messages/s through sampling and slow mode), which brings one channel to 5 KB/s x 1 million = 5 GB/s, about 40 Gbit/s, fanned out by chat edges.
3.6 VOD archive
- Source only: 50 000 channels x 6 Mbit/s = 300 Gbit/s = 37.5 GB/s, times 86 400 s = about 3.24 PB/day.
- 14-day retention: about 45 PB. Consequence: archive the source only and produce the VOD ladder on first view; most past broadcasts are never watched, so pre-transcoding them would waste most of the compute.
3.7 Summary
| Quantity | Estimate | Design consequence |
|---|---|---|
| Ingest | 600 Gbit/s | Regional ingest edges on the backbone |
| Transcode | ~6 500 servers | Ladder by viewer threshold; decode once |
| Egress | 30 Tbit/s | Multi-CDN or owned edge |
| Origin fan-out | 12 requests/s per rendition set at origin | Request collapsing at edge and shield |
| Chat | 40 Gbit/s for the biggest channel | Displayed-rate cap, batched delivery |
| VOD | ~45 PB at 14 days | Archive source, transcode on demand |
4. API design
4.1 Control plane endpoints
| Method and path | Purpose | Notes |
|---|---|---|
POST /v1/channels/{id}/stream-keys | Create or rotate a stream key | Old key revoked immediately; returned once |
GET /v1/channels/{id}/live | Live state, viewer count, playback URLs | Cached 2 s |
POST /v1/ingest/auth | Called by ingest edges to validate a key | Internal; returns channel id and ladder policy |
POST /v1/channels/{id}/events | Publish a timed event (poll, ad marker) | Stamped with media time by the packager |
GET /v1/videos/{vod_id} | VOD metadata and playback URL | Triggers on-demand transcode if needed |
4.2 Ingest and playback URLs
Broadcasters and players see only these URL shapes; the internal layout can change behind them.
rtmps://ingest-{region}.example.com/app/{stream_key}
srt://ingest-{region}.example.com:7000?streamid={stream_key}
https://ingest-{region}.example.com/whip/{channel_id} (Bearer token)
https://live.example.com/{channel_id}/master.m3u8 (LL-HLS)
https://live.example.com/{channel_id}/manifest.mpd (LL-DASH)
4.3 Errors and limits
| Case | Behaviour |
|---|---|
| Invalid or revoked stream key | Ingest edge closes the connection; broadcaster dashboard shows the reason |
| Bitrate above tier limit (Example: 8 Mbit/s) | Accept but warn; above 1.5x the limit, disconnect |
| Unsupported codec | Reject at handshake for RTMP; WHIP returns problem details with 415 |
| Second ingest on the same key | Reject unless the first connection has been idle for 10 s |
5. Data model
5.1 Entities
Control-plane state is small; media is large and short-lived on the live path.
5.2 Storage choices
| Data | Store | Key | Why |
|---|---|---|---|
| Channels, keys, broadcasts | Example: Relational database | channel_id | Small, transactional, audited |
| Live segments and parts | Origin memory and local disk, ring buffer of Example: 60 s | (channel, rendition, sequence, part) | Needed for seconds; speed matters more than durability |
| VOD source | Object storage | broadcast_id/source/{sequence} | Durable, cheap, lifecycle rules |
| Live channel routing | Distributed key-value store | channel_id -> transcoder, origin | Read on every edge miss |
| Viewer counts | Approximate counters from edge logs | channel_id | Exact counts are not needed |
5.3 Access patterns
| Query | Served by | Key or index | Partition rationale |
|---|---|---|---|
| Validate a stream key | Key table via cache | key_hash | Keys are stored hashed; lookup by hash |
| Which origin serves channel X | Routing store | channel_id | One entry per live channel |
| Latest playlist for rendition R | Origin, then shield and edges | /{channel}/{rendition}/playlist.m3u8 with blocking reload parameters | All renditions of a channel on one origin |
| A part or segment | Origin ring buffer, cached at edge | /{channel}/{rendition}/{seq}.{part}.m4s | Immutable once written |
| VOD playlist for a past broadcast | Object storage index | broadcast_id | Built at end of broadcast |
| Timed events for current media time | Packager inserts into playlist and media | broadcast_id, media_time_ms | Travels with the media, no extra request |
6. High-level design
| Component | Responsibility | Scales by |
|---|---|---|
| Ingest edge | Terminate protocols, validate key, forward with small jitter buffer | Regions and connections |
| Transcoder | Decode once, scale and encode the ladder with aligned keyframes | Channels per server |
| Packager | Cut CMAF segments and parts; write playlists and manifest | With transcoder (same host) |
| Origin | Hold the last Example: 60 s per rendition; answer blocking playlist requests | Channels per origin |
| Shield tier | Collapse edge requests per object; hold parts briefly | Regions |
| CDN edges | Serve viewers; collapse viewer requests | Provider capacity |
| Chat edge | Hold viewer connections, fan out batched messages | Connections |
7. Detailed design
7.1 Deep dive 1: ingest and transcoding ladder
Problem. Broadcasters use many encoders and unstable home networks, and transcoding every channel into a full ladder is the largest compute cost.
| Option | Effect | Drawback |
|---|---|---|
| A. Full ladder for every channel | Best viewer experience | About 17 900 servers (3.3) |
| B. Source passthrough only | Cheapest | No ABR; mobile viewers rebuffer |
| C. Ladder by policy: full above a viewer threshold or for partners, light otherwise | Bounded cost | Switching policy mid-stream must not glitch |
| D. Ask broadcasters to send several renditions (simulcast or multitrack) | Shifts compute to the broadcaster | Upload bandwidth many lack |
Choice. C, with D accepted when the broadcaster's encoder sends multiple tracks through Enhanced RTMP or WHIP simulcast.
Reason. Most channels have few viewers. One decoder feeds all scalers, and renditions of the same resolution share one scaler, which removes duplicate work. Keyframes are forced at the same timestamps in every rendition (Example: every 2 s) so players can switch at segment boundaries; source passthrough is used as the top rendition only when the source keyframe interval matches.
| Rendition (Example) | Resolution and frame rate | Video bitrate |
|---|---|---|
| Source | As received (often 1080p60) | As received |
| 720p60 | 1280x720, 60 fps | 3 500 kbit/s |
| 720p30 | 1280x720, 30 fps | 2 500 kbit/s |
| 480p30 | 852x480, 30 fps | 1 200 kbit/s |
| 360p30 | 640x360, 30 fps | 700 kbit/s |
| 160p30 | 284x160, 30 fps | 250 kbit/s |
Light ladder: source, 480p30 and 160p30. Ingest protocol choice:
| Protocol | Use | Note |
|---|---|---|
| RTMP / RTMPS | Default for desktop encoders | Adobe specification (December 2012); classic RTMP carries H.264 and AAC |
| Enhanced RTMP | HEVC, AV1, multitrack from newer encoders | Veovera specification; pin the version you support |
| SRT | Lossy or long-distance contribution links | Open-source protocol; the IETF draft expired, so pin the library version |
| WHIP | Browser and mobile WebRTC publishing | RFC 9725 (2025) |
7.2 Deep dive 2: low-latency delivery and origin fan-out
Problem. Low latency needs small units of media, which multiplies requests, while one popular channel can draw a million viewers at once.
| Option | Latency | Scale through CDNs |
|---|---|---|
| A. Standard HLS, 2 s segments, 3 segments buffered | 8 to 12 s | Excellent |
| B. LL-HLS parts with blocking playlist reload and preload hints | 2 to 4 s | Good with request collapsing |
| C. LL-DASH with chunked CMAF over chunked transfer | 2 to 4 s | Good; needs CDN support for chunked responses |
| D. WebRTC delivery (WHEP-style) | Under 1 s | Hard and costly at millions of viewers |
Choice. B and C from one set of CMAF media; A as automatic fallback for players without low-latency support.
Reason. One encode and one set of CMAF fragments serve both manifests.
With LL-HLS, the packager publishes each 0.5 s part as soon as it is
complete (EXT-X-PART), announces the next one in advance
(EXT-X-PRELOAD-HINT), and holds playlist requests until the requested
media sequence and part exist (blocking reload, advertised with
CAN-BLOCK-RELOAD in EXT-X-SERVER-CONTROL). Delta playlist updates keep
playlist responses small. These features are defined in the HTTP Live
Streaming 2nd Edition draft (draft-pantos-hls-rfc8216bis); RFC 8216 itself
has no low-latency mode. For DASH, the manifest signals that segments can
be fetched before they are complete, and the CDN streams chunks as they
arrive, following DASH-IF low-latency guidance.
Request collapsing makes this scale: when 10 000 viewers on one edge ask for the same part, the edge sends one request upstream and answers all of them from that response. Blocking playlist requests are collapsed the same way, keyed by the requested sequence and part.
7.3 Deep dive 3: latency budget
Problem. "3 seconds" is only reachable if every stage has a budget and the player buffer is set on purpose.
| Stage (Example) | Budget |
|---|---|
| Capture and broadcaster encoder | 300 ms |
| First mile to ingest edge | 150 ms |
| Ingest edge to transcoder over backbone | 50 ms |
| Decode, scale, encode with low-latency settings | 400 ms |
| Waiting for a 0.5 s part to complete | 500 ms |
| Origin, shield, edge to player | 150 ms |
| Player buffer (part hold-back, 3 parts) | 1 500 ms |
| Total | 3 050 ms |
Options. Smaller parts (Example: 0.25 s) cut both the part wait and the hold-back but double request rates; shorter keyframe intervals ease channel switching but cost bitrate; a smaller buffer cuts latency but raises rebuffering on mobile.
Choice. 0.5 s parts, 2 s segments, keyframes every 2 s, part hold-back of 1.5 s, and catch-up playback (Example: up to 1.1x speed) when the player drifts beyond 5 s.
Reason. This keeps request rates at the levels in 3.4 and lands at the
3 s target at p50: the table uses the worst-case 500 ms part wait, and the
average wait is half a part (250 ms), which brings the typical total to
about 2.8 s. The draft requires PART-HOLD-BACK to be at least
twice the part target duration and recommends at least three times, so 1.5 s
matches the recommendation for 0.5 s parts; check the revision you pin.
7.4 Deep dive 4: chat and event sync
Problem. Chat travels in real time while video is 3 s (low latency) or 10 s (fallback) behind, so viewers see reactions before the moment, and a poll can open before the broadcaster announces it on screen.
| Option | Effect | Drawback |
|---|---|---|
| A. Show chat immediately | Simple; broadcaster and chat stay in step | Viewers on slow players see spoilers |
| B. Delay chat per viewer by measured latency | Chat matches the frame on screen | Broadcaster sees replies later; complexity |
| C. Timed metadata for events only | Polls and ad markers appear on the right frame | Chat itself not aligned |
Choice. A for chat, C for interactive events, B as an option for fallback-latency players.
Reason. With 3 s latency, chat feels live; aligning it would delay the
broadcaster's conversation. Events matter at frame accuracy, so the
packager stamps them with media time and inserts them as EXT-X-DATERANGE
in playlists and as event messages in CMAF, and the player fires them when
playback reaches that time. Players compute their own latency from
EXT-X-PROGRAM-DATE-TIME against a synchronised clock and report it in
telemetry. Chat delivery itself follows Chat System Design
(system-design/design-chat-system), with batching every 200 ms and the
displayed-rate cap from 3.5.
How real systems do it (paraphrased from Twitch Engineering, "Live Video Transmuxing/Transcoding: FFmpeg vs TwitchTranscoder, Part I", October 2017; inspiration only). The post describes broadcasters sending RTMP to Twitch and viewers watching HLS in several quality variants. It explains why running one independent encoder process per variant wastes work: the decoding step is identical for every variant, so a single decode should feed the scalers and encoders, and variants of the same resolution can share scaling. It stresses that keyframes must line up across variants for smooth switching, which a pure pass-through of the source cannot guarantee when the source keyframe interval varies, and it describes features such as frame rate reduction and metadata insertion that motivated an in-house transcoder. Check the post for its exact settings and results.
7.5 VOD archive
At broadcast start the packager also writes the source rendition to object
storage. At the end, a job writes a VOD playlist that points at the archived
source. On the first VOD view the ladder is transcoded faster than real
time in parallel chunks, and the full VOD then follows Video Streaming
System Design (system-design/design-video-streaming). Archived sources
expire after 14 days unless the broadcaster saves the video.
8. Scalability and performance
| Concern | Approach | Limit before redesign |
|---|---|---|
| Ingest connections | More edges per region; anycast or DNS steering to the nearest | Backbone capacity per region |
| Transcode capacity | Policy ladder; hardware encoders where quality allows | Power and rack space per origin site |
| Join storms | Request collapsing; pre-warm shields when a channel trends | Edge provider capacity in one metro |
| Playlist rate | Delta updates; collapsed blocking requests | Origin connections per channel |
| Chat fan-out | Batching, displayed-rate cap | Chat edge connections per metro |
Viewer count is computed from edge playback logs every 10 s and smoothed; exact counts would need per-viewer state the delivery path does not keep.
9. Reliability, security and operations
9.1 Failure modes
| Component | Failure | Detection | Blast radius | Mitigation | RTO |
|---|---|---|---|---|---|
| Broadcaster network | Packet loss or disconnect | Ingest bitrate drop | One channel | SRT retransmission; reconnect grace of 10 s with a slate | Broadcaster dependent |
| Ingest edge | Crash | Health check | Channels connected to it | Encoders reconnect; DNS points to a healthy edge | Example: 15 s |
| Transcoder | Crash | Heartbeat from packager | Channels on that server | Hot standby for partners; restart elsewhere for others; player sees a gap | Example: 10 s partners, 30 s others |
| Origin | Overload | Request latency | Channels on that origin | Shield collapsing; shed fallback-latency playlists first | Example: 1 min |
| CDN provider | Regional outage | Player error rates | Viewers in that region | Multi-CDN switch at playback URL issuance | Example: 2 min |
| Clock drift | Wrong program date time | Clock monitor | Event alignment and latency metrics | Disciplined clocks on packagers | Minutes |
| Chat edge | Overload in a big channel | Queue depth | Chat in that channel | Lower displayed-rate cap; slow mode | Example: 1 min |
9.2 Security and abuse
| Threat | Control |
|---|---|
| Leaked stream key used to hijack a channel | Keys stored hashed; rotation revokes immediately; alert on new ingest location |
| Unencrypted contribution | RTMPS, SRT encryption, or WHIP over HTTPS required for partners |
| Restreaming of paid content | Signed playback URLs with short expiry; DRM for premium events (out of scope) |
| Illegal or harmful live content | Automated classification on sampled frames; fast takedown that stops ingest and purges edges |
| Chat abuse | Moderation tools, rate limits per user; see Rate Limiter System Design (system-design/design-rate-limiter) |
| [Threat] | [Control] |
9.3 Observability
| Signal | Metric | Alert threshold |
|---|---|---|
| Latency | Player-reported latency p50 and p95 | p50 above 4 s for 10 min |
| Rebuffering | Rebuffer ratio by rendition and CDN | Above 1% for 10 min |
| Ingest health | Dropped frames and bitrate variance per channel | Partner channel above 1% dropped |
| Transcoder lag | Encode time vs real time | Below 1.0x for 30 s |
| Origin requests | Requests per channel at origin | Above 100/s per rendition set |
9.4 Cost estimate
| Item | Unit cost | Quantity | Monthly cost |
|---|---|---|---|
| Transcoding servers | [USD per server-month] | Example: 6 500 | [USD] |
| CDN egress | [USD per GB] | Example: peak 30 Tbit/s, use daily volume from billing | [USD] |
| Backbone for ingest | [USD per Gbit/s-month] | Example: 600 Gbit/s | [USD] |
| VOD archive storage | [USD per TB-month] | Example: 45 PB | [USD] |
| On-demand VOD transcoding | [USD per hour transcoded] | [Hours] | [USD] |
| Total | [USD] |
10. Trade-offs and alternatives
10.1 Decisions
| Decision | Options | Chosen | Why | What we give up |
|---|---|---|---|---|
| Ladder | Full for all; passthrough; policy | Policy by viewers | 64% less transcode capacity | Small channels get fewer renditions |
| Delivery | Standard HLS; LL-HLS and LL-DASH; WebRTC | LL-HLS and LL-DASH, HLS fallback | CDN scale at 3 s latency | Not sub-second |
| Part duration | 0.25 s; 0.5 s; 1 s | 0.5 s | Balance of latency and request rate | About 1 s more latency than 0.25 s (longer part wait plus a three-part hold-back) |
| Chat sync | Align chat; live chat with timed events | Live chat, timed events | Broadcaster conversation stays live | Spoilers for fallback players |
| VOD | Pre-transcode; transcode on view | Transcode on view | Most broadcasts are never watched | First viewer waits briefly |
| At 10x (100 million viewers, 1 million channels) | Owned edge in ISPs for the largest markets; hardware encoders; regional origins per channel group | Capital spend and peering contracts | ||
| At 0.1x (1 million viewers, 10 000 channels) | A managed live video service plus one CDN; full ladder for all channels may be affordable | Less control over latency and cost per hour | ||
| [Decision] | [Options] | [Chosen] | [Why] | [Cost] |
10.2 Alternatives considered
- WebRTC for all viewers. Sub-second latency, but every viewer needs a stateful media session, which scales far worse through commodity CDNs. Keep it for co-streaming and interactive rooms.
- Managed live video service. Fastest to launch; becomes the main cost line at scale and limits ladder and latency tuning.
11. Delivery plan and risks
11.1 Milestones
| Milestone | Scope | Exit criterion | Target date |
|---|---|---|---|
| M1 | Ingest edges with RTMP, SRT; policy ladder | Ingest success 99.95% for 14 days | YYYY-MM-DD |
| M2 | CMAF packager with LL-HLS for 5% of viewers | Latency p50 under 4 s, rebuffer not worse than control | YYYY-MM-DD |
| M3 | LL-DASH, shield collapsing, join-storm test | 1 million synthetic viewers on one channel | YYYY-MM-DD |
| M4 | Timed events, WHIP ingest, on-demand VOD | Events within 100 ms of target frame | YYYY-MM-DD |
11.2 Rollout and rollback
[Example: Low-latency playback is enabled per player version and per country with a flag. Rollback serves the standard playlist from the same media, which every player supports, so no re-encoding is needed.]
11.3 Risks
| ID | Risk | Likelihood | Impact | Mitigation | Owner |
|---|---|---|---|---|---|
| R-01 | Example: CDN provider handles blocking requests poorly | Medium | High | Provider certification test before traffic | [@name] |
| R-02 | Example: LL-HLS draft changes between revisions | Medium | Medium | Pin revision, follow player vendor guidance | [@name] |
| R-03 | Example: Low latency raises rebuffering on mobile | High | Medium | Adaptive hold-back per network type | [@name] |
| [R-nn] | [Risk] | [L / M / H] | [L / M / H] | [Mitigation] | [@name] |
12. Appendices
12.1 Open questions
| ID | Question | Owner | Due |
|---|---|---|---|
| OQ-01 | Example: Do we offer AV1 renditions to supporting players? | [@name] | YYYY-MM-DD |
| OQ-02 | Example: Viewer threshold for the full ladder: 20 or 50? | [@name] | YYYY-MM-DD |
| [OQ-nn] | [Question] | [@name] | YYYY-MM-DD |
12.2 Glossary
| Term | Meaning |
|---|---|
| Glass-to-glass latency | Time from camera capture to display on the viewer's screen |
| Ladder | The set of renditions (resolution, frame rate, bitrate) offered for ABR |
| Part | A partial segment in LL-HLS, published before the full segment is complete |
| Blocking playlist reload | A playlist request the server holds until the requested media exists |
| CMAF | Common Media Application Format, fragmented MP4 media usable by HLS and DASH |
| Request collapsing | A cache sending one upstream request for many identical concurrent client requests |
| [Term] | [Meaning] |
12.3 References
Inspiration only; no text, diagrams or figures are copied.
| Reference | Use |
|---|---|
| RFC 8216 HTTP Live Streaming (August 2017, Informational) | Base HLS playlist and segment model |
| draft-pantos-hls-rfc8216bis, "HTTP Live Streaming 2nd Edition" (revision 22, May 2026, Internet-Draft) | Low-latency mode: parts, preload hints, blocking reload, delta updates |
| Apple Developer, "Enabling Low-Latency HTTP Live Streaming (HLS)" | Implementation guidance for LL-HLS |
| DASH-IF low-latency guidelines (dashif.org) and ISO/IEC 23009-1 (MPEG-DASH), ISO/IEC 23000-19 (CMAF) | Low-latency DASH and shared CMAF media; check the current editions |
| Adobe Real-Time Messaging Protocol specification (December 2012) | RTMP ingest |
| Veovera Enhanced RTMP (v2) | Modern codecs and multitrack over RTMP; pin the revision |
| RFC 9725 WebRTC-HTTP Ingestion Protocol (WHIP), 2025 | Browser ingest |
| SRT Alliance and Haivision SRT open-source project | SRT ingest |
| Twitch Engineering, "Live Video Transmuxing/Transcoding: FFmpeg vs TwitchTranscoder, Part I" (October 2017) | Decode-once ladder and keyframe alignment (paraphrased in 7.4) |
Video Streaming System Design (system-design/design-video-streaming) | VOD pipeline |
Chat System Design (system-design/design-chat-system) | Chat delivery |
Resilience and Load Shedding Design (system-design/resilience-load-shedding-design) | Shedding order during join storms |
Standard and licence note
Based on RFC 8216, the HTTP Live Streaming 2nd Edition Internet-Draft, RFC 9725 and the other public specifications listed in 12.3; the LL-HLS draft is not a published RFC and its details can change between revisions. The engineering write-ups are cited as inspiration only. This is a reference design to adapt, with illustrative numbers. Original text written for this collection; check the current official versions before you implement. Template licence: MIT.
관련 템플릿
Video Streaming System Design Template (Reference Design)
Video upload and ABR streaming: chunked transcoding, renditions ladder, CMAF HLS/DASH, CDN, DRM note, view counts, storage tiers
시스템 설계Agent Orchestration Platform System Design Template
Agent run platform design: durable step journal, resume, MCP tool broker with Tasks, A2A calls, human approvals, tenant budgets, evaluation hooks
시스템 설계Agent Code Execution Sandbox System Design Template
Code execution sandbox for agents: microVM vs gVisor vs containers, egress proxy, credential broker, quotas, snapshot restore, warm pools, abuse detection