Ch.25: System Design: The Ad That Won but Never Appeared
Outline
- 0:00 A win and an empty page
- 0:42 Two paths through one auction
- 1:20 The contract before the boxes
- 2:08 The clock includes the network
- 2:58 The bill behind the blank page
- 3:35 The budget is being promised elsewhere
- 3:59 Winning is still an intermediate state
- 4:33 The page leaves first
- 5:28 The same bill twice
- 6:02 The missing money has a location
- 6:30 What the winning bid actually bought
Transcript
0:00 Picture this: our bid won auction A 17's ad slot on a news article. The reader closed the page before our ad appeared. Now our bidder holds 1 dollar, and the seller wants 60 cents. What gets charged? My first thought is to give the dollar back if the slot stayed blank. Why should the advertiser pay for an empty page? I think you're right about the page. But our browser trace says blank while the seller's billing flag says delivered. Both records matter. So the win is real, the bill might be wrong, and the buyer's dollar is stuck between them?
0:34 Exactly. We'll trace the seller's claim to its auction before charging or freeing the dollar. The advertiser needs more than our hunch. First, what did we actually receive for A 17? Our bid went to the exchange, the system running the auction. Its result says we won; the page capture is blank; E nine asks for 60 cents. Three records about one slot. I assumed the win meant the ad showed. Isn't that what the notice tells us? No. Winning means the exchange picked our bid, not that the ad appeared. The IAB guide is linked below.
1:07 This fictional agreement requires a delivery row matching A 17. I asked for it. The attached row carries a different auction ID. Oh, then their proof is for somebody else's slot. Why is E nine still billing ours? Now that mismatch lets us dispute E nine, but the claim remains open and the dollar stays held. Take a set of 20 bidder shards that all treat that dollar as free. What happens? Each could bid against it. I was ready to return the money because the first proof was wrong, but another valid row might still arrive.
1:39 That is an uncomfortable hold. I felt the same. If we free that dollar and a valid row arrives, we have promised it elsewhere. The functional requirements do not end with A 17's bid; we still owe a truthful ledger for E nine. Could every shard check one central balance? But the non-functional requirements are the trap: stay within budget and answer before cutoff. A central round trip worries me. Does the exchange wait for us? Next, the network trip eats into the bid deadline. Suppose A 17's shard asks for budget after the request arrives.
2:14 Approval comes after cutoff; the exchange ignores its bid. Ah, then give the shard spending authority before the request lands. The coordinator could grant a capped envelope, and the shard could reserve locally without waiting on a round trip. Would that work? Yes. That is our design choice. The reservation must be bounded by the envelope, so concurrency cannot promise the same dollar repeatedly. Right. The coordinator has to subtract a granted envelope from what other shards can claim, even before this shard bids.
2:46 Does an unfunded shard no-bid or time out? It says no-bid. A 17 reached a funded machine, reserved the dollar, and answered on time. Now the seller must justify the 60-cent demand. Next, the seller acknowledges the ID mismatch. Does that end E nine? No. Its billing system still says “delivery confirmed.” The delivery team is checking A 17, and the claim stays open until a final correction. Hold on. Admitting the bad attachment did not retract the bill. Our browser saw a blank slot; their only attached row points elsewhere.
3:18 I would show 60 cents disputed, zero paid. Yes. 1 dollar held, no settled spend. Releasing it on that non-final reply could leave us short if valid evidence arrives later. So the bad join has trapped real budget. Let's see which auction loses it. With E nine unresolved, finance shows zero spend but the campaign has no free dollar. For example, A 18 arrives on another bidder shard while A 17 holds the only dollar. That shard blocks the bid because it cannot reserve another cent. A 18 expires. The manager sees zero spend, one reader gone, and no clue where her dollar went.
3:56 That is a rotten call to take. Now A 18 is gone, but her dashboard still says zero spent. We owe the manager an explanation. Imagine the campaign manager: “You spent nothing, then refused to show my ad?” I need a screenshot before I call her, or she will think the bidder was down. What should it show? We have all seen a dashboard hide the resource that is actually stuck. Give her HELD $1 and AVAILABLE $0 beside SPENT $0, with A 18 marked expired. I'd still be furious about that loss. What did the seller find in A 17's actual delivery system?
4:32 With the wrong auction row rejected, the seller searches its delivery system for A 17. The preliminary lookup finds no render row. Oh, that sounds close. But their first attachment fooled the billing flag. Is an empty first search enough to close the claim? No. This fictional contract allows a late row, so the hold remains until the full log check ends. Our blank browser capture supports the dispute; it cannot settle it alone. Okay, the first search is a lead, not a final no-charge. But what if the seller never finishes?
5:06 Can E nine freeze the dollar forever? No. We would set a final claim deadline in the seller contract. If it passes without valid proof, the claim is ineligible and the hold is released. Until that deadline, E nine stays disputed and the dollar unavailable. Before that window closes, could another notice change the pending 60 cents? Now the retry risk becomes real: an identical E nine notice arrives. The next copy keeps the event ID but changes the amount. Oh, that is no longer just a retry. Which version can touch our ledger?
5:41 Neither changes final spend. The exact retry maps to the pending claim; the altered copy goes to a conflict queue. We know this trap from other incidents: the retry handler looks spotless while the user-facing failure is still there. Here, the page is blank. If we never check the seller's render log, we have solved the wrong incident. And the seller's full render log answers the page question: no render record for A 17. Its initial row was misjoined. Their final withdrawal closes E nine; our ledger releases the whole dollar and leaves spend at zero.
6:15 Oh. That billing flag never described this slot. The browser observation raised the alarm; the seller's own log and withdrawal closed it. A 18's lost auction stays lost, though. That is the cost the spend chart hides. So with that withdrawal, we can return the dollar and show the wrong row, altered retry, and closed claim. What if valid delivery proof had arrived? Then we would settle 60 cents once and release 40. The final notice and proof of display would stay beside that charge. If an auditor asked why this case cost money and the other did not, we could show the exact evidence.
6:54 The auction chose our ad; the evidence decided the bill. Thanks for listening to Learning Podcasts.