Mario Ruiz Díaz
← All case studies

Case study · Distributed systems

Forecast-driven ad prefetch for Pluto TV's ad breaks

A statistical forecast picked the ad breaks expected to see the most demand, and the ads for them were fetched and processed ahead of time into Pluto TV's own storage, so those breaks did not depend on a burst of live calls the second they started.

Visit pluto.tv
Product
pluto.tv ↗
Client
Pluto TV
Industry
Free ad-supported streaming (FAST)
Role
Tech Lead · Solution designer
Period
2020 – 2024
Forecast-driven ad prefetch for Pluto TV's ad breaksAHEAD OF THE BREAKWHEN THE BREAK STARTSDemand signalsevent, day, outside forecastsForecastbreaks with most demandPrefetchask ad servers earlyPrepared adsprocessed and storedViewers at the breaksame second, same channelAd breakserved from storageActual demandfed back to the forecastready adswhat happenedadjusts

Scroll sideways to see the full diagram →

The prefetch loop at Pluto TV. A forecast fed by the event calendar, the day and outside forecasts picks the ad breaks expected to see the most demand; the ads for them are fetched and processed ahead of time and kept in storage, so the break is served from storage instead of a burst of calls when it starts. What actually happened feeds the forecast back.Download diagram (PNG) ↓

Context

Pluto TV is a free, ad-supported streaming service with linear channels: viewers on the same channel reach each ad break at the same moment. Its revenue services decide, fetch and prepare the ads for every break, calling third-party ad servers. The supply of ads was limited, and different platforms competed for the same ads.

The challenge

The moment of highest demand was also the moment when getting ads was hardest: every viewer of a channel reached the break in the same second, while other platforms were asking for the same limited ads. Filling those breaks could not depend on a burst of calls to the ad servers at the exact second each break started.

The solution

Get ahead of the break instead of racing it. A statistical forecast, fed with the event being streamed, the day and outside forecasts, picked the points expected to see the most demand. For those points, ads were fetched and processed ahead of time and kept in Pluto TV's own storage, so the break was served from storage. What actually happened was fed back into the statistics, so the forecast adjusted over time.

  • Demand forecast

    Statistical model that picks the points expected to see the most demand, using the event, the day and outside forecasts as inputs.

  • Prefetch

    For the points the forecast flags, asks for the ads and processes them ahead of the break.

  • Prepared-ads storage

    Pluto TV's own storage holding the ads already fetched and processed, ready to serve when the break starts.

  • Feedback loop

    What actually happened feeds the statistics back, so the forecast adjusts over time instead of staying a fixed guess.

Key decisions

  1. 01

    Do the work before the break

    When viewers arrive together, the cheapest request is the one already answered. Moving the calls to the ad servers and the processing ahead of time took them out of the second when every viewer of the channel arrived.

    Alternatives considered Fetch every ad live when the break starts.

  2. 02

    Prefetch where the forecast says, not everywhere

    Ads were limited and other platforms competed for them, so the prefetch targeted the points expected to see the most demand.

  3. 03

    A forecast that learns

    Demand depends on the event, the day and conditions outside the platform. Feeding actual results back into the statistics let the forecast adjust over time.

What I did

  • Designed the approach: forecast the breaks with the most demand and prefetch their ads ahead of time.
  • Designed the architecture: forecast, prefetch, prepared-ads storage and the feedback loop.
  • Led the team as Tech Lead.

Outcomes

  • For the breaks the forecast flagged, asking the ad servers and processing the ads happened ahead of time, on a schedule the team controlled, instead of in the same second as every viewer of the channel.
  • A forecast that adjusted over time with what actually happened, instead of a fixed guess.

Sources & press

Contact

Bring me a real problem.

A scaling issue, a risky migration, an AI workflow that must become reliable, or a team that needs sharper technical direction.

Founder-level conversation · Practical feedback · NDA available on request