Free sample lesson ยท Real-Time Ad Event Pipelines: Lessons from Netflix

What is the critical path in ad serving?

Lesson 1 of the Wondering course Real-Time Ad Event Pipelines: Lessons from Netflix

The critical path, defined

Every time an ad appears on a page or in an app, a chain of operations has to run first.

The critical path is the sequence of must-succeed operations between the ad decision and the ad actually being shown.

A chain of links running from the ad decision to the ad being shown

Notice that the ad only reaches the screen when every link between the decision and the display is connected.

The ad decision is the moment a system picks which ad to serve. The ad being shown is the finish line.

Everything in between must work, in order, for the viewer to see anything.

Walking the path step by step

Picture a news site loading an ad slot.

First, the ad server decides which ad wins. Then it sends that answer back to the page.

Next, the page fetches the ad's creative files, such as an image or video. Finally, the browser renders the ad on screen.

From decision to display
  • Decide: The ad server decides which ad wins.
  • Respond: The answer is sent back to the page.
  • Fetch creative: The page fetches the image or video files.
  • Render: The browser draws the ad on screen.

Each of these is a separate operation, often run by a separate system.

Why every link can break it

The steps run in a series. Each one depends on the one before it.

So if any single step fails, the ad is not shown. A perfect decision is wasted if the creative never loads.

Any failure ends the path
  • Ad decision made
  • Answer reaches page?
  • Creative loads?
  • Ad renders?
  • Ad shown
  • No ad shown: The earlier work is wasted.
  • Yes
  • No
  • Yes
  • No
  • Yes
  • No

This is why every system on the critical path is a potential failure point.

A healthy path needs all of them working at the same moment.

On the path or off it

Not every system in ad serving sits on the critical path.

Ask one question: if this fails, does the ad still appear? If the answer is no, it is on the path.

Some work, like writing records for later reports, can happen after the ad is shown. A delay there does not stop the viewer from seeing the ad.

Does the ad still appear if it fails?
  • On the path
  • Off the path

Mixing these up leads teams to protect the wrong systems.

Longer paths, more risk

Each operation you add to the path is one more thing that must succeed.

A new check or extra system call may look small. On the critical path, it becomes another potential failure point.

That is why teams look hard at what truly needs to happen before the ad appears.

The question becomes: does this step belong on the path, or can it move off?

Is every step worth its risk?

Using the idea at work

You can apply this to any ad setup you work on.

Start by listing every operation between the ad decision and the ad being shown.

For each one, ask whether a failure would stop the ad. Those are your critical-path systems. Before adding a new step, ask if it must sit there.

A quick critical path check

Then explain it plainly to colleagues: the ad shows only if every link holds.

Check yourself

In ad serving, the critical path runs from the _____ to the ad actually being shown.

  • ad decision
  • report writing

Answer: ad decision

The critical path starts at the ad decision (when the system picks which ad to serve) and ends when the ad is shown. Report writing happens later and is not the start of the path.

When a news site loads an ad slot, the ad server first _____ which ad wins. It then _____ that answer back to the page. The page then _____ the creative files. Finally, the browser _____ the ad on screen.

Answer: When a news site loads an ad slot, the ad server first decides which ad wins. It then sends that answer back to the page. The page then fetches the creative files. Finally, the browser renders the ad on screen.

The path runs in order: decide the winning ad, send the answer to the page, fetch the creative (image or video), then render it. Each is a separate operation, often run by a separate system.

An ad server makes a perfect decision, but the ad's image file fails to load. What happens?

  • The ad is not shown at all
  • The ad shows because the decision succeeded
  • The ad shows after the reporting step retries
  • The browser renders the ad without the image

Answer: The ad is not shown at all

Critical-path steps run in series, each depending on the one before. If any single step fails, the ad is not shown, so a perfect decision is wasted if the creative never loads.

Keep going

This is lesson 1 of 13 in Real-Time Ad Event Pipelines: Lessons from Netflix. Next up:

  1. The Metadata Registry bottleneck at Live scale
  2. Fire-and-forget logging vs. synchronous write-and-wait
  3. How Flink stateful stream processing works
  4. KeyedCoProcessFunction: owning the join at the lowest API level
  5. The 60-minute match window and long-tail recovery

Start this course free

Wondering turns any topic into short lessons you can read, watch, or listen to, with practice questions and an AI tutor.