System Design: Ad-Insertion Platform for Live and On-Demand Video
Context
You are designing an end-to-end ad-insertion platform for a consumer video streaming app that serves both live and on-demand (VOD) content on mobile and TV clients. The platform must support client-side and server-side ad insertion, integrate with external ad exchanges, and operate globally with strict latency and reliability goals.
Requirements
-
Functional
-
Targeting: by user segments, device, geo, time, content metadata, context.
-
Pacing and Budgeting: ensure line items spend smoothly over time and do not overspend.
-
Frequency Capping: per-user and cross-device caps at creative/line-item/advertiser levels.
-
Brand Safety: content classification, blocklists/allowlists, competitive separation, IVT/fraud detection.
-
Ad Formats and Standards: VAST, VPAID, OMID; video/mid-roll/pre-roll/post-roll; skippable or not.
-
Ad Podding: construct multi-ad breaks with duration constraints and category separation.
-
RTB Integration: OpenRTB to demand-side platforms (DSPs) with strict timeouts.
-
Delivery: SSAI for seamless playback and CSAI for interactive units; HLS/DASH manifests through CDNs.
-
Measurement: impressions, quartiles (25/50/75/100), clicks, viewability (OMID), IVT filtering.
-
Deduplication: identity across devices for frequency and measurement.
-
Experimentation: A/B testing of ad policies (e.g., frequency caps, auction rules, pod policies).
-
Non-Functional
-
Low-latency ad selection: p99 < 100 ms at the edge.
-
High availability: fault tolerance, multi-region active-active, graceful degradation.
-
Privacy and Compliance: GDPR/CCPA/COPPA; consent-aware targeting; data minimization, regional data residency.
-
Scale: tens of millions of DAU, high QPS, live-event spikes.
-
Assumptions
-
Clients support HLS/DASH; mobile/TV SDKs can send OMID signals.
-
For SSAI, we control a stitcher/manifest manipulator; for CSAI, clients can render VAST/VPAID.
Deliverables
Design components including the ad decision engine, metadata store, user/segment service, content signals pipeline, and delivery through CDNs/players with VAST/VPAID/OMID support. Explain:
-
Low-latency selection at the edge (<100 ms), fault tolerance, and multi-region failover.
-
Privacy compliance and measurement (impressions, quartiles, clicks).
-
RTB exchange integration, ad podding, cross-device deduplication, and A/B experimentation on ad policies.