54
Building personalized ad experiences through iterative engineering and product development Ad Personalization at Spotify Kinshuk Mishra Noel Cody

Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

Embed Size (px)

DESCRIPTION

hakkalabs.co

Citation preview

Page 1: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

Building personalized ad experiences through iterative engineering and product development

Ad Personalizationat Spotify

Kinshuk MishraNoel Cody

Page 2: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody
Page 3: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody
Page 4: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody
Page 5: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

Music…

...is with you throughout the day.

...fits your mood.

...fits your activity.

Page 6: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

Music…

...is personal.

Page 7: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody
Page 8: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody
Page 9: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

If your day looks like this:

Wake up Work out Commute Focus at Work Relax at Home Sleep

Page 10: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

Ads should follow.

Wake up Work out Commute Focus at Work Relax at Home Sleep

Ads

Page 11: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

Ads should follow.

Wake up Work out Commute Focus at Work (Classical) Relax at Home Sleep

Electronic Music ad

Not bad. WTF?

Page 12: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

Why Personalization?

Page 13: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

“...it works well the advertisements are annoying though I am not a fan of mainstream music so hearing about pop bands is also driving me crazy”

“Great way to listen to whatever music you want. The ads can be really annoying though since they don't seem to be targeted. I HATE rap music, yet I seem to get a lot of ads for it.”

Why Personalization?

Page 14: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

Data confirms anecdotal evidence

Page 15: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody
Page 16: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody
Page 17: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

AD PERSONALIZATION

Page 18: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

User Stories

Hypotheses + Goals

Product MVPs + Experiments

Page 19: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

● Context-aware ads ● Music ads like music recommendations ● Ads that learn

User Stories to Hypotheses & Goals:

Page 20: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

● Real-time genre targeting

● Historic genre targeting

● Real-time moment targeting

Hypotheses to Products:

Page 21: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

(Product MVPs to Experiments)

Control Variation 1 Variation 2

Page 22: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

INFRASTRUCTURE

Page 23: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

Ad Targeting Architecture

Feedback Loop

Page 24: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

Ad Targeting Architecture

OSS Data Infrastructure

Spotify Backend Infrastructure

Page 25: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

Ad Targeting Architecture V1.0

COTS Data Infrastructure

Spotify Backend Infrastructure

Real-time Targeting

Page 26: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

Ad Targeting Architecture V2.0

Real-time + Batch Targeting(a.k.a. Lambda Architecture)

Page 27: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

Ad Targeting Architecture V2.5

Transition to Persistent User Profile

Page 28: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

Ad Targeting Architecture V3.0

Richer Profile Schema with Persistence

Page 29: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

Tech Choices

Page 30: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

Kafka

● Kafka is a distributed, partitioned, replicated commit log service.

● Guarantees

● Kafka provides a total order over messages within a partition

● Fault tolerance : handles N-1 failures for replication factor N.

Page 31: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

Ad Targeting Architecture V1.0

COTS Data Infrastructure

Spotify Backend Infrastructure

Real-time Targeting

Page 32: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

StormStorm

● Real time stream processing

● Like hadoop without HDFS

● Like Map/Reduce with many reducer steps

● Fault tolerant and guaranteed message processing

Page 33: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

StormStorm: Testing (since 0.8.1)

Page 34: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

StormStorm: Visualization (since 0.9.2)

Page 35: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

Ad Targeting Architecture V2.0

Real-time + Batch Targeting

Page 36: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

Apache Crunch

● Framework for writing, testing, and running MapReduce pipelines

● Pipelines are composed of user-defined functions and higher-level

abstractions of common MR tasks (filter, join, etc.)

Page 37: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

Apache Crunch

Data structures:

● PCollection<T>

● PTable<K,V>

● PGroupedTable<K,V>

Functions:

● MapFn<T1,T2>: T1 → T2

● CombineFn<K,V>: (K, Iterable<V>) → (K, V)

Page 38: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

What’s wrong with plain Python Streaming MapReduce?

● Testability

● Optimization

● Performance

● IDE support

● Type Safety

● Lack of higher-level operations (filter/join/aggregate)

Apache Crunch

From Spotify Presentation: Scalding the Crunchy Pig for Cascading into the Hive

Page 39: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

● About a 5x performance improvement over Python streaming MapReduce

● Readable functional-style API in plain Java

● Great local testing support

● First-class support for Avro records.

Apache Crunch

From Spotify Presentation: Scalding the Crunchy Pig for Cascading into the Hive

Page 40: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

Apache Crunch

Page 41: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

Apache Crunch

Page 42: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

Ad Targeting Architecture V2.5

Transition to Persistent User Profile

Page 43: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

CASSANDRA

Rich wide-column schema support

Solid persistence and replication

Slower reads

● Rich schema● Persistence

MEMCACHED

K/V only

TTL is default (in-memory mgmt)

vs.

Page 44: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

Ad Targeting Architecture V3.0

Richer Profile Schema with Persistence

Page 45: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

DATA INGESTION:

CASSANDRA

CRUNCH

STORM

HDFS

KAFKALOGS

Page 46: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

TESTING

Page 47: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody
Page 48: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

User Stories

Hypotheses + Goals

Product MVPs + Experiments

Page 49: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

AAR

Vital Signs

Ad-Specific Metrics

Page 50: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

AAR

Vital Signs

Ad-Specific Metrics

Higher-level metrics are hard to move

Page 51: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

US

ER E

XP

ERIE

NC

E

TEST ITERATION

IMPACTS AAR

Page 52: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

AAR

Vital Signs

Ad-Specific MetricsOur focus

Page 53: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

Test evaluation

● Positive Signals: CTR, Downstream Effects

● Avoidance Signals: Volume, Audio Output

● An “Ad Quality Score”

Page 54: Ad Personalization at Spotify: Iterative Enginering and Product Development - Kinshuk Mishra and Noel Cody

Thanks!

(We’re hiring):spotify.com/us/jobs/