Design a real-time ad stack that runs auctions in milliseconds, enforces budgets and frequency caps, and logs impressions for billing. Integrate with exchanges and protect the hot path from heavy offline jobs.
Functional requirements
- Real-time auction and ranking for each eligible placement
- Campaign budgets, pacing, and frequency caps per user or device
- Creative hosting, policy scanning, and approval workflows
- Idempotent impression and click logging with dedupe for billing
- Forecasting APIs for reach, inventory, and deal packaging
Non-functional requirements
- Sub-100ms decisioning including partner round-trips where applicable
- Very high write throughput for logs and streaming analytics
- Fault isolation so one advertiser cannot stall the whole auction
- Auditable records for disputes and regulatory review