ad serving at spotify scale
play

Ad Serving at Spotify Scale A journey of incremental full stack - PowerPoint PPT Presentation

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


  1. Ad Serving at Spotify Scale A journey of incremental full stack overhaul Kinshuk Mishra, Director of Engineering kinshuk@spotify.com @_kinshukmishra

  2. A lucky mistake

  3. Expected consequences

  4. Sarcastic empathy

  5. Some valuable feedback

  6. The unintended consequence Artist engagement for exposed users went up

  7. The unintended consequence Promising insights about content promotion use-case

  8. The unintended consequence Confirmation that the ad server is a powerful messaging platform

  9. Why should you care?

  10. Introduction Ad technology stack Architecture Evolution

  11. Introduction Ad technology stack Architecture Evolution

  12. 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) ○

  13. 3 noteworthy things

  14. Full stack refactor Evolution at scale Pragmatic choices

  15. 100,000,000+ MAU

  16. 50,000,000+ Subscribers

  17. 30,000,000+ Songs

  18. 2,000,000,000+ Playlists

  19. $5,000,000,000+ Revenue paid to rightsholders

  20. 60 Markets

  21. Platform Ubiquity

  22. Freemium business model

  23. Ad

  24. Introduction Ad technology stack Architecture Evolution

  25. Beauty of Ad Server Relevancy Pacing Unique View Sequence Optimization

  26. Complexity of Ad tech ecosystem

  27. In essence it is pretty simple Campaign Management Portal Client Billing/ Ad Server Reporting Data Ad campaign Collection User Profile database database System

  28. Spotify Ads infrastructure in 2011 Log HDFS Delivery Batch User Campaign Billing/ Profile Management Reporting Edge Desktop Service Basic Ad Server

  29. Spotify Ads infrastructure in 2017 Log GCS DMP iOS Delivery Stream Batch Self-Serve Portal Android Modeling User Creative Payments Profile Generation Desktop Optimization Edge Ads SDK Service Targeting Campaign Web Service Management Billing/ Reporting Ad Server Chromecast/ Ad Playstation/ Aggregation Ad FireTV Decision Delivery Service Exchanges

  30. Multi-platform clients Log GCS DMP iOS Delivery Stream Batch Self-Serve Portal Android Modeling User Creative Payments Profile Generation Desktop Optimization Edge Ads SDK Service Targeting Campaign Web Service Management Billing/ Reporting Ad Server Chromecast/ Ad Playstation/ Aggregation Ad FireTV Decision Delivery Service Exchanges

  31. Data collection Log GCS DMP iOS Delivery Stream Batch Self-Serve Portal Android Modeling User Creative Payments Profile Generation Desktop Optimization Edge Ads SDK Service Targeting Campaign Web Service Management Billing/ Reporting Ad Server Chromecast/ Ad Playstation/ Aggregation Ad FireTV Decision Delivery Service Exchanges

  32. Intelligence Log GCS DMP iOS Delivery Stream Batch Self-Serve Portal Android Modeling User Creative Payments Profile Generation Desktop Optimization Edge Ads SDK Service Targeting Campaign Web Service Management Billing/ Reporting Ad Server Chromecast/ Ad Playstation/ Aggregation Ad FireTV Decision Delivery Service Exchanges

  33. Ad Delivery Log GCS DMP iOS Delivery Stream Batch Self-Serve Portal Android Modeling User Creative Payments Profile Generation Desktop Optimization Edge Ads SDK Service Targeting Campaign Web Service Management Billing/ Reporting Ad Server Chromecast/ Ad Playstation/ Aggregation Ad FireTV Decision Delivery Service Exchanges

  34. Demand fulfillment Log GCS DMP iOS Delivery Stream Batch Self-Serve Portal Android Modeling User Creative Payments Profile Generation Desktop Optimization Edge Ads SDK Service Targeting Campaign Web Service Management Billing/ Reporting Ad Server Chromecast/ Ad Playstation/ Aggregation Ad FireTV Decision Delivery Service Exchanges

  35. Now you know too Ad server is a powerful messaging platform

  36. Introduction Ad technology stack Architecture Evolution

  37. Architecture overhaul is hard While keeping the business running ● While innovating on new products ● When you should have done it yesterday ●

  38. Why did Spotify evolve Ads architecture?

  39. Future needs ● Growth in scale ● Emergence of new client platforms ● Cheap cloud computing ● New products to meet business objectives ● Technical debt ●

  40. The 3 stories

  41. Story 1 Fixing the legacy mess

  42. Original ad server design Memcache Edge Service Ad server instance User DB Desktop Ad trigger Rendering decisioning Router Ad server ring with Memcache Ad batching & fetch communication hash(userid) partitions Memcache Ads Ads Ranking Caching Campaign DB Memcache

  43. Problems

  44. Stateful service with faulty persistence

  45. Cache as a data store

  46. Service cluster as a hashed ring

  47. Ad decisioning in Client

  48. Batch Client-Server Calls

  49. Fix strategy

  50. Fix strategy tactic

  51. Isolate refactor to one system at a time

  52. The ad server transition Log HDFS Delivery Batch Desktop User Campaign Billing/ Profile Ad trigger Management Reporting Rendering decisioning Edge Ad batching & fetch Service communication Gradual transition from basic to smart ad serving Ads Ads Ranking Caching Smart Ad Server Ad Server Proxy (routing) Basic Ad Server

  53. After the ad server transition Log HDFS Delivery Batch Desktop User Campaign Billing/ Profile Ad trigger Management Reporting Rendering decisioning Proxy Ad batching & fetch Service communication Ads Ads Ranking Caching Smart Ad Server

  54. Story 2 Lean, mean and fast

  55. Division of responsibilities Before After Ad Trigger & Render Desktop iOS Ads SDK Ad Ad trigger Rendering decisioning decisioning Android Ad fetch Ad batching & fetch communication orchestration Desktop Ads Ads Ranking Caching Client context Web

  56. Problems

  57. Thick Clients

  58. Logic duplication

  59. Tightly coupled monolith

  60. Fix strategy

  61. Reduce State Management

  62. Break monolith into services

  63. Isolate platform independent logic into a lib

  64. Fix tactic

  65. Design your systems to be master of one thing

  66. Remember division of responsibilities? BAD GOOD Ad Trigger & Render Desktop iOS Ads SDK Ad Ad trigger Rendering decisioning decisioning Android Ad fetch Ad batching & fetch communication orchestration Desktop Ads Ads Ranking Caching Client context Web

  67. Multiplatform Client design Log GCS DMP iOS Delivery Stream Batch Self-Serve Service Android Modeling User Creative Payments Profile Generation Desktop Proxy Ads SDK Service Targeting Campaign Web Service Management Billing/ Reporting Ad Server Chromecast/ Ad Playstation/ Aggregation Ad FireTV Decision Delivery Service Exchanges

  68. Story 3 Knowledge is power, Unreliable data is your enemy

  69. Event Historical Stream ETL1 ETL2 ETL3 UserEntity1(attribute1, attribute2) UserEntity1(attribute1, attribute3) UserEntity1(attribute1, attribute3’)

  70. Problems

  71. Duplicate, undiscoverable and fragmented datasets

  72. Metric inaccuracy

  73. Overloaded Data Infra

  74. Fix strategy

  75. Focus on reliable and timely log delivery

  76. Data engineering with SLA

  77. Dataset canonicalization

  78. Some useful lessons learnt from architectural overhaul

  79. Test with minimal impact radius

  80. Mistakes are inevitable

  81. Speed up build decisions

  82. Think for tomorrow, Solve for today

  83. Thank You! kinshuk@spotify.com @_kinshukmishra

Recommend


More recommend