Problem statement
Design the service that stores subtitle and caption tracks for a streaming catalog, keeps them time-aligned with the correct video version, and delivers the right track to each player. The hard part is not storage; it is keeping cues in sync when the video timeline shifts and serving many languages and formats at scale.
Operating context. Each asset has several tracks across languages and types (subtitle, closed caption, SDH). A track is authored against a specific asset version and timeline. When the video timeline changes — a trimmed intro, an inserted ad break, a re-edit — cues must be re-timed so they stay aligned. Players request tracks in different formats (WebVTT, TTML) and expect a sensible fallback when their language is missing.
Out of scope. Automatic speech-to-text caption generation, machine translation between languages, the video transcode, and how the player renders and positions text on screen. Assume separate teams own those.
What to produce. A high-level architecture covering: the track data model and its versioning, how a track is bound to an asset version and timeline, how cues are re-timed when the timeline shifts, on-delivery format conversion, language selection and fallback, and the caching and delivery path. Sketch the components and the request flow; we will probe specifics during checkpoints.
Functional requirements
- Store multiple tracks per asset, each tagged with language and type (subtitle, closed caption, SDH).
- Bind every track to a specific asset version and timeline so cues stay aligned to the video.
- Convert a track to the format the requesting player needs (WebVTT or TTML) on delivery.
- Re-time cues when the video timeline changes, such as an inserted ad break or a trimmed intro.
- Deliver the correct track for a language and version, falling back to a default language when absent.
Non-functional requirements
- Serve 80,000 subtitle-track requests/sec at peak.
- Delivery p99 under 50 ms on a cache hit and under 150 ms on a miss requiring conversion.
- Catalog of 30,000,000 assets averaging 6 tracks each.
- A published edit to a track is visible to new sessions within 30 seconds.
- 99.95% availability for the subtitle read path.
- Cue timing accurate within 100 ms of the associated video timeline.
Topics
- System Design HLD
- Media Subtitles
- Media Streaming
- Data Versioning
- Data Cache