Rebuilding a mobile ad platform's bidding engine in Go
The platform's bidder ran in a single region and answered in about 200ms, four times the 50ms window ad exchanges allow.
Bids timed out, impressions went to competitors, and every traffic spike made it worse. Scaling the old service up only raised the cloud bill. We had to rebuild the engine for global, sub-50ms bidding without pausing a single live campaign. It took two and a half months with a team of three.
Five layers, one latency budget.
- 01 · LATENCY-CRITICAL PATH
Anycast load balancing across 8 PoPs into a Go ad-request gateway, then an auction orchestrator with an 80ms hard timeout: OpenRTB 2.6 fan-out to 50+ DSPs and a second-price auction, on bare metal.
- 02 · CAMPAIGNS & ADVERTISERS
Campaign service, targeting engine and token-bucket budget pacing in Go, plus the advertiser portal and demand-side API.
- 03 · PUBLISHERS & SUPPLY
Mobile SDK, SDK analytics, publisher portal and supply-side API for app publishers.
- 04 · DATA & ANALYTICS
Kafka at the centre; Flink for spend pacing and anomaly detection; ClickHouse for sub-second campaign dashboards.
- 05 · FRAUD DETECTION
Invalid-traffic detection, device reputation and click-fraud analysis, with a quarantine before anything is billed.
Is latency costing you revenue?
A Scale Audit shows where every millisecond goes, and which ones are worth winning back first.