Problem
Design a data model for an online advertising system that supports creating ads and analyzing delivery/performance.
Core product needs
The system should support:
-
Advertisers with multiple
campaigns
.
-
Campaigns containing
ad groups
(or similar grouping) and
creatives/ads
.
-
Targeting
(e.g., geo, device, interests, custom audiences).
-
Budgeting and pacing (daily/lifetime budgets).
-
Reporting/analytics on delivery events:
impressions, clicks, conversions
.
Tasks
-
Propose a relational schema (tables + key columns) for the “source of truth” entities.
-
Decide how to represent targeting in the model (normalized tables vs JSON/kv vs hybrid), and justify.
-
Design how event logs (impression/click/conversion) should be stored for high volume and how they join back to ads/campaigns for reporting.
-
List the most important indexes/partition keys.
-
Provide 2–3 example queries the business will need (e.g., campaign spend yesterday, CTR by creative, conversions by audience).
Assumptions
-
You may assume a typical ads hierarchy: Advertiser → Campaign → AdGroup → Ad/Creative.
-
Event volume is large (analytics-scale). State any additional assumptions you need.