Design: Watched-Video and Resume Playback Service
Context
Design a backend service that records each user’s watched video list and lets them resume any title from the last watched timestamp across devices. Assume a large-scale, consumer-facing video platform with millions of users and multiple device types (mobile, web, TV).
Requirements
-
Core features
-
Store a per-user list of watched videos with last-watched timestamp and status (playing/paused/completed).
-
Resume playback on any device from the last saved timestamp.
-
APIs
-
Define read/write APIs for single and batch operations, idempotent progress updates, and cross-device sync notifications.
-
Data model
-
Schema for progress per (user, video) and a browsable watch history list.
-
Idempotent updates
-
Handle network retries and out-of-order events from multiple devices/sessions.
-
Cross-device synchronization
-
Near-real-time updates when a user pauses/stops on one device and resumes on another.
-
Privacy and controls
-
Support “hide from history,” data minimization, deletion/export, encryption, and access control.
-
Scale
-
State read and write access patterns and how to scale storage, throughput, and latency.
What to deliver
-
High-level architecture.
-
API definitions (endpoints, request/response shapes, idempotency semantics).
-
Data model (including indexes/keys) and storage choices.
-
Update semantics and conflict resolution across devices.
-
Privacy controls and compliance considerations.
-
Read/write scale estimates and capacity strategies.