Video session windowing

DesignHard45 minNetflix and Databricks style

Your task

Design real-time sessionization for a video-streaming product: group a user's events (play, pause, seek, buffer, ad-view) into 'viewing sessions' (gap of >30 min of inactivity ends a session), computing per-session metrics (watch time, rebuffer ratio, ads served) within ~1 minute of session end to feed live experiment dashboards and an anomaly detector. ~2M concurrent viewers, events arrive out of order and occasionally minutes late (mobile networks). Decide between a streaming and a batch approach and design the windowing and state.

It covers

  • Sessionization
  • Watermarks
  • State