SlideShare a Scribd company logo
Ad Serving at Spotify Scale
A journey of incremental full stack overhaul
Kinshuk Mishra, Director of Engineering
kinshuk@spotify.com
@_kinshukmishra
A lucky mistake
Expected consequences
Sarcastic empathy
Some valuable feedback
The unintended consequence
Artist engagement
for exposed users went up
The unintended consequence
Promising insights about
content promotion use-case
The unintended consequence
Confirmation that the
ad server is a powerful
messaging platform
Why should you care?
Introduction
Ad
technology
stack
Architecture
Evolution
Introduction
Ad
technology
stack
Architecture
Evolution
What I do
● Founded ads engineering team at Spotify in 2011
● Build all things ads engineering - team & software
● Major focus areas :
○ Ad delivery (Backend and Web)
○ Multi-platform native ads (Client Platform)
○ Ad performance (ML and Data)
3 noteworthy things
Full stack refactor
Evolution at scale
Pragmatic choices
100,000,000+
MAU
50,000,000+
Subscribers
30,000,000+
Songs
2,000,000,000+
Playlists
$5,000,000,000+
Revenue paid to rightsholders
60 Markets
Platform Ubiquity
Freemium business model
Ad
Qcon London 2017 -  Architecture overhaul - Ad serving @ Spotify scale
Qcon London 2017 -  Architecture overhaul - Ad serving @ Spotify scale
Qcon London 2017 -  Architecture overhaul - Ad serving @ Spotify scale
Introduction
Ad
technology
stack
Architecture
Evolution
Beauty of Ad Server
Relevancy Pacing Unique View Sequence Optimization
Complexity of Ad tech ecosystem
In essence it is pretty simple
Client
User Profile database
Ad Server
Campaign Management
Portal
Billing/
Reporting
Ad campaign
database
Data
Collection
System
Spotify Ads infrastructure in 2011
Edge
Service
Desktop
Log
Delivery
HDFS
User
Profile
Batch
Basic Ad Server
Campaign
Management
Billing/
Reporting
Spotify Ads infrastructure in 2017
iOS
Edge
Service
Android
Ads SDK
Desktop
Web
Chromecast/
Playstation/
FireTV
Ad
Aggregation
Service
Log
Delivery
GCS
User
Profile
Targeting
Service
DMP
Stream Batch
Ad Server
Decision Delivery
Ad
Exchanges
Campaign
Management
Optimization
Modeling
Self-Serve Portal
Creative
Generation
Payments
Billing/
Reporting
Multi-platform clients
iOS
Edge
Service
Android
Ads SDK
Desktop
Web
Chromecast/
Playstation/
FireTV
Ad
Aggregation
Service
Log
Delivery
GCS
User
Profile
Targeting
Service
DMP
Stream Batch
Ad Server
Decision Delivery
Ad
Exchanges
Campaign
Management
Optimization
Modeling
Self-Serve Portal
Creative
Generation
Payments
Billing/
Reporting
Data collection
iOS
Edge
Service
Android
Ads SDK
Desktop
Web
Chromecast/
Playstation/
FireTV
Ad
Aggregation
Service
Log
Delivery
GCS
User
Profile
Targeting
Service
DMP
Stream Batch
Ad Server
Decision Delivery
Ad
Exchanges
Campaign
Management
Optimization
Modeling
Self-Serve Portal
Creative
Generation
Payments
Billing/
Reporting
Intelligence
iOS
Edge
Service
Android
Ads SDK
Desktop
Web
Chromecast/
Playstation/
FireTV
Ad
Aggregation
Service
Log
Delivery
GCS
User
Profile
Targeting
Service
DMP
Stream Batch
Ad Server
Decision Delivery
Ad
Exchanges
Campaign
Management
Optimization
Modeling
Self-Serve Portal
Creative
Generation
Payments
Billing/
Reporting
Ad Delivery
iOS
Edge
Service
Android
Ads SDK
Desktop
Web
Chromecast/
Playstation/
FireTV
Ad
Aggregation
Service
Log
Delivery
GCS
User
Profile
Targeting
Service
DMP
Stream Batch
Ad Server
Decision Delivery
Ad
Exchanges
Campaign
Management
Optimization
Modeling
Self-Serve Portal
Creative
Generation
Payments
Billing/
Reporting
Demand fulfillment
iOS
Edge
Service
Android
Ads SDK
Desktop
Web
Chromecast/
Playstation/
FireTV
Ad
Aggregation
Service
Log
Delivery
GCS
User
Profile
Targeting
Service
DMP
Stream Batch
Ad Server
Decision Delivery
Ad
Exchanges
Campaign
Management
Optimization
Modeling
Self-Serve Portal
Creative
Generation
Payments
Billing/
Reporting
Now you know too
Ad server is a powerful
messaging platform
Introduction
Ad
technology
stack
Architecture
Evolution
Architecture overhaul is hard
● While keeping the business running
● While innovating on new products
● When you should have done it yesterday
Why did Spotify evolve Ads
architecture?
Future needs
●
● Growth in scale
● Emergence of new client platforms
● Cheap cloud computing
● New products to meet business objectives
● Technical debt
The 3 stories
Fixing the legacy mess
Story 1
Original ad server design
Edge Service
Router
hash(userid)
Ad server ring with
partitions
Ad server instance
Memcache
Memcache
Memcache
Memcache
Campaign DB
User DB
Desktop
Rendering Ad trigger
decisioning
Ads
Ranking
Ads
Caching
Ad batching & fetch communication
Problems
Stateful service with faulty
persistence
Cache as a data store
Service cluster as a hashed ring
Ad decisioning in Client
Batch Client-Server Calls
Fix strategy
Fix strategy tactic
Isolate refactor to one system at
a time
The ad server transition
Edge
Service
Log
Delivery
HDFS
User
Profile
Batch
Smart Ad
Server
Campaign
Management
Billing/
Reporting
Ad Server
Proxy
(routing) Basic Ad
Server
Gradual transition from basic to smart ad
serving
Desktop
Rendering Ad trigger
decisioning
Ads
Ranking
Ads
Caching
Ad batching & fetch
communication
After the ad server transition
Proxy
Service
Log
Delivery
HDFS
User
Profile
Batch
Campaign
Management
Billing/
Reporting
Smart Ad Server
Desktop
Rendering Ad trigger
decisioning
Ads
Ranking
Ads
Caching
Ad batching & fetch
communication
Lean, mean and fast
Story 2
Division of responsibilities
Desktop iOS
Android
Ads SDK
Desktop
Web
Rendering
Ad trigger
decisioning
Ads
Ranking
Ads
Caching
Ad batching & fetch communication
Ad
decisioning
Ad fetch
orchestration
Client context
Ad Trigger & Render
Before After
Problems
Thick Clients
Logic duplication
Tightly coupled monolith
Fix strategy
Reduce State Management
Break monolith into services
Isolate platform independent
logic into a lib
Fix tactic
Design your systems to be
master of one thing
Remember division of responsibilities?
Desktop iOS
Android
Ads SDK
Desktop
Web
Rendering
Ad trigger
decisioning
Ads
Ranking
Ads
Caching
Ad batching & fetch communication
Ad
decisioning
Ad fetch
orchestration
Client context
Ad Trigger & Render
BAD GOOD
Multiplatform Client design
iOS
Proxy
Service
Android
Ads SDK
Desktop
Web
Chromecast/
Playstation/
FireTV
Ad
Aggregation
Service
Log
Delivery
GCS
User
Profile
Targeting
Service
DMP
Stream Batch
Ad Server
Decision Delivery
Ad
Exchanges
Campaign
Management
Modeling
Self-Serve Service
Creative
Generation
Payments
Billing/
Reporting
Knowledge is power,
Unreliable data is your enemy
Story 3
Event
Stream
Historical
ETL1 ETL2 ETL3
UserEntity1(attribute1, attribute2) UserEntity1(attribute1, attribute3) UserEntity1(attribute1, attribute3’)
Qcon London 2017 -  Architecture overhaul - Ad serving @ Spotify scale
Problems
Duplicate, undiscoverable and
fragmented datasets
Metric inaccuracy
Overloaded Data Infra
Fix strategy
Focus on reliable and timely log
delivery
Qcon London 2017 -  Architecture overhaul - Ad serving @ Spotify scale
Data engineering with SLA
Dataset canonicalization
Some useful lessons learnt from
architectural overhaul
Test with minimal impact radius
Mistakes are inevitable
Speed up build decisions
Think for tomorrow, Solve for today
Thank You!
kinshuk@spotify.com
@_kinshukmishra

More Related Content

PDF
Evolution of Spotify's ad architecture (Qcon 2016 Shanghai)
PDF
Scaling Continuous Delivery to minimize risks (Delivery of Things 2016)
PDF
Ad Yield Optimization @ Spotify - DataGotham 2013
PPT
SaaSPlex Overview
PDF
Platform_Technical_Overview
PDF
10 Hacks for Successful Google AdWords Campaigns
PPT
SaaSPlex Telco/Cellco/ISP
PPTX
SAP HANA Marketplace
Evolution of Spotify's ad architecture (Qcon 2016 Shanghai)
Scaling Continuous Delivery to minimize risks (Delivery of Things 2016)
Ad Yield Optimization @ Spotify - DataGotham 2013
SaaSPlex Overview
Platform_Technical_Overview
10 Hacks for Successful Google AdWords Campaigns
SaaSPlex Telco/Cellco/ISP
SAP HANA Marketplace

What's hot (6)

PDF
Using Google AdWords for SEO
PDF
Cmpute AWS Cost Optimization Platform
PPT
SaaSPlex Cloud MSP/SI
PDF
How to Partner and Profit from the Coming Hyperscale Wave
PPTX
adsparx_intro3
PDF
Conversie Optimalisatie als continu proces
Using Google AdWords for SEO
Cmpute AWS Cost Optimization Platform
SaaSPlex Cloud MSP/SI
How to Partner and Profit from the Coming Hyperscale Wave
adsparx_intro3
Conversie Optimalisatie als continu proces
Ad

Viewers also liked (20)

PDF
Machine Learning and Big Data for Music Discovery at Spotify
PDF
The Spotify Playbook
PDF
Algorithmic Music Recommendations at Spotify
PDF
Activation: From thinking to tweaking it, how we do it at Spotify
PDF
Scaling Operations At Spotify
PDF
Quality Built In @ Spotify
PDF
Big Data At Spotify
PDF
A Spotify Presentation - Case studies
PDF
Growing up with agile - how the Spotify 'model' has evolved
PDF
How Spotify Builds Products (Organization. Architecture, Autonomy, Accountabi...
PDF
Testing at Spotify
PDF
Real time ads personalization @ Spotify
PDF
How Spotify scales Apache Storm Pipelines
PDF
Spotify presentation
PDF
Ad Personalization at Spotify: Iterative Enginering and Product Development -...
PDF
Obvious and Non-Obvious Scalability Issues: Spotify Learnings
PDF
Ads Personalization at Spotify - NYC Data Engineering 10/23
PDF
Spotify Chords - Creating Music Moments
PDF
Spotify's business model and copyright infringement issue
PDF
Playlists at Spotify - Using Cassandra to store version controlled objects
Machine Learning and Big Data for Music Discovery at Spotify
The Spotify Playbook
Algorithmic Music Recommendations at Spotify
Activation: From thinking to tweaking it, how we do it at Spotify
Scaling Operations At Spotify
Quality Built In @ Spotify
Big Data At Spotify
A Spotify Presentation - Case studies
Growing up with agile - how the Spotify 'model' has evolved
How Spotify Builds Products (Organization. Architecture, Autonomy, Accountabi...
Testing at Spotify
Real time ads personalization @ Spotify
How Spotify scales Apache Storm Pipelines
Spotify presentation
Ad Personalization at Spotify: Iterative Enginering and Product Development -...
Obvious and Non-Obvious Scalability Issues: Spotify Learnings
Ads Personalization at Spotify - NYC Data Engineering 10/23
Spotify Chords - Creating Music Moments
Spotify's business model and copyright infringement issue
Playlists at Spotify - Using Cassandra to store version controlled objects
Ad

Similar to Qcon London 2017 - Architecture overhaul - Ad serving @ Spotify scale (20)

PPT
Citihub IDC Event 2009 Cloud Mark Ellis
PPTX
Service Architectures at Scale
PPTX
Service Architectures At Scale - QCon London 2015
PPTX
Real World Transformation Experiences at StubHub
PPT
What if you're the SaaS?
PDF
Accenture Liquid Architectures (for Master EMSE UPM-FI - April 2017)
PPTX
Cloud Services Powered by IBM SoftLayer and NetflixOSS
PDF
Infographic: Steps to Becoming a Next Gen Service Provider
PPTX
Modernization of your AWS based SaaS platform - Short
PPTX
Web apps
PPTX
A perspective on cloud computing and enterprise saa s applications
PPTX
Carrier As A Service15102009
PDF
Evolving to Cloud-Native - Anand Rao
PPTX
Designing Modern Web Applications
PPTX
Event-Driven Serverless Architecture - the next big thing in the cloud (Cleme...
PPTX
Cloud to hybrid edge cloud evolution Jun112020.pptx
PPTX
Introducing Windows Azure
PPT
Cloud Providers Public 030909 V2
PPT
Peter Coffee 20100923 AITP Cloud Computing Con SD
PDF
Connecting Above the Cloud
Citihub IDC Event 2009 Cloud Mark Ellis
Service Architectures at Scale
Service Architectures At Scale - QCon London 2015
Real World Transformation Experiences at StubHub
What if you're the SaaS?
Accenture Liquid Architectures (for Master EMSE UPM-FI - April 2017)
Cloud Services Powered by IBM SoftLayer and NetflixOSS
Infographic: Steps to Becoming a Next Gen Service Provider
Modernization of your AWS based SaaS platform - Short
Web apps
A perspective on cloud computing and enterprise saa s applications
Carrier As A Service15102009
Evolving to Cloud-Native - Anand Rao
Designing Modern Web Applications
Event-Driven Serverless Architecture - the next big thing in the cloud (Cleme...
Cloud to hybrid edge cloud evolution Jun112020.pptx
Introducing Windows Azure
Cloud Providers Public 030909 V2
Peter Coffee 20100923 AITP Cloud Computing Con SD
Connecting Above the Cloud

Recently uploaded (20)

DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Electronic commerce courselecture one. Pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Encapsulation theory and applications.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPT
Teaching material agriculture food technology
PPTX
Big Data Technologies - Introduction.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Modernizing your data center with Dell and AMD
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Chapter 3 Spatial Domain Image Processing.pdf
The AUB Centre for AI in Media Proposal.docx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Building Integrated photovoltaic BIPV_UPV.pdf
Electronic commerce courselecture one. Pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Encapsulation theory and applications.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Teaching material agriculture food technology
Big Data Technologies - Introduction.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Spectral efficient network and resource selection model in 5G networks
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Modernizing your data center with Dell and AMD
Reach Out and Touch Someone: Haptics and Empathic Computing
Chapter 3 Spatial Domain Image Processing.pdf

Qcon London 2017 - Architecture overhaul - Ad serving @ Spotify scale