Design an Ad Inventory Forecasting System

Medium45 min
1 / 30
understanding10 min read

Problem Statement: Selling Impressions That Do Not Exist Yet

Frames ad inventory forecasting as a supply-prediction and risk problem for guaranteed ad sales, not a generic analytics dashboard.

Problem statement

Design an ad inventory forecasting system that predicts how many ad impressions will be available to sell and serve over upcoming days and weeks, per segment (geography, device, ad format, placement, time of day), factoring seasonality, trend, promotions, and current traffic patterns. The output is consumed by sales and yield teams to price and commit guaranteed delivery (GD) deals: contracts that promise an advertiser N impressions of a target segment by a flight date, with penalties or makegoods when the platform under-delivers.

The defining tension is asymmetric risk. Over-forecasting sells inventory that does not exist: deals under-deliver, triggering makegoods, penalties, and advertiser churn. Under-forecasting leaves impressions unsold (remnant inventory sold at a fraction of guaranteed CPMs) and directly destroys revenue. The system therefore must not output a single hopeful number; it must output a distribution per segment and horizon, and the business must choose a conservative sellable quantile (for example P25) that explicitly trades fill rate for delivery safety.

Why this is a distinctive big-data problem

A naive answer treats this as 'run ARIMA on a few series'. The reality is a data-platform problem with four planes:

  1. Ingestion plane: billions of ad-request and serve events per day, late arrivals, duplicates, invalid traffic filtering, schema evolution.
  2. Aggregation plane: rolling raw events into segment×time cubes fast enough that forecasts see today's traffic by tomorrow's run, with hierarchical rollups that stay mathematically coherent.
  3. Modeling plane: tens of thousands of correlated series with daily, weekly, and yearly seasonality, promo spikes, and heavy tails; a mix of statistical baselines, gradient boosting, and probabilistic deep models; nightly batch training plus intraday re-forecast triggers.
  4. Serving and consumption plane: interactive forecast queries from sales tools, batch availability checks against already-booked deals, versioned forecasts with prediction intervals, and alerting when booked demand approaches predicted supply.

Public scale context versus design assumptions

Public, company-reported figures establish the category's scale. The Trade Desk states its AI analyzes up to 15 million ad opportunities each second [[1]]. PubMatic reports processing over 100 billion ads and bid requests each day, and separately describes ~80 million bids per second generating ~100 terabytes of data daily [[57]][[59]]. Google's ad auctions resolve in roughly 100-300 milliseconds and occur billions of times daily [[18]][[23]]. Spotify maintains a dedicated Ads Forecasting squad whose charter is predicting future ad inventory, demand, and performance [[66]]. These are cited context, not requirements for our design.

For capacity planning this answer explicitly assumes a publisher network with 3.6 billion eligible ad requests per day, ~41.7K requests/second average, a 2.4× peak factor (~100K/s), ~18,500 active leaf segments, and a 120-day horizon. Every uncited number in this answer is a stated assumption, budget, or target.

The one-sentence invariant

Forecast supply as a distribution, reconcile it across the segment hierarchy, publish it as an immutable version, and let sales consume a conservative quantile minus already-booked demand — never a raw point estimate.

Key Highlights

  • Guaranteed-delivery economics make over-forecasting (under-delivery) and under-forecasting (unsold inventory) both expensive.
  • The system outputs distributions and sellable quantiles, not single point estimates.
  • Four planes: ingestion, aggregation, modeling, serving/consumption.
  • Public scale: TTD up to 15M ad opportunities/sec; PubMatic 100B+ requests/day; Google auctions in 100-300ms billions of times daily.
  • Design assumptions: 3.6B eligible requests/day, ~100K/s peak, 18.5K active leaf segments, 120-day horizon.
Lead With the Sellable Quantile
State in the first two minutes that the system sells a conservative quantile (e.g. P25) of a reconciled distribution, not a point forecast. This single sentence separates a revenue-aware answer from a generic time-series tutorial.
Do Not Design a Dashboard
A design that only charts historical impressions fails the brief. The product is a decision input: availability = forecast supply quantile minus booked demand, per segment, per day, with versions and alerts.

Section Rescue Kit

Buzzwords to use:

Guaranteed DeliverySell-Through Rate

Safe statements:

  • "Let me separate supply forecasting from demand booking first, then define availability as the difference."
  • "Before choosing models, I want the segment hierarchy and the risk posture (which quantile we sell) explicit."
Design an Ad Inventory Forecasting System - System Design | WinJob | WinJob