Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Netflix API: Keynote at Disney Tech Conference

2,313 views

Published on

Disney held the first in a series of internal technical conferences in Orlando, FL, this one focused entirely on APIs. These slides are from my keynote presentation which kicked off the event. The slides focus on the Netflix API, API design, anti-patterns, technical revolutions, resiliency, scaling, test frameworks and other constructs that support the Netflix infrastructure.

Published in: Technology, Business
  • Be the first to comment

Netflix API: Keynote at Disney Tech Conference

  1. 1. The Structure of API RevolutionsBy DanielJacobson@daniel_jacobsonImage courtesy of SakeThrajan
  2. 2. There are copious commentson each slide for the fullcontext from my presentation
  3. 3. Scientific DiscoveryPredominant ViewTime
  4. 4. Eventually
  5. 5. Scientific PracticeKuhn’s ViewTimeAssumption
  6. 6. Image courtesy of Niko Lang
  7. 7. Scientific PracticeKuhn’s ViewExperiments on Current AssumptionTimeAssumption
  8. 8. Scientific PracticeKuhn’s ViewAnomalies from ExperimentsExperiments on Current AssumptionTimeAssumption
  9. 9. Phases of Venus
  10. 10. Scientific PracticeKuhn’s ViewNew AssumptionAnomalies from ExperimentsExperiments on Current AssumptionAssumptionAssumptionTime
  11. 11. Image courtesy of Niko Lang
  12. 12. Scientific PracticeKuhn’s ViewScientific Revolution(aka. ParadigmShift)New AssumptionAnomalies from ExperimentsExperiments on Current AssumptionTimeAssumptionAssumption
  13. 13. Scientific PracticeKuhn’s ViewAssumptionAssumptionAssumptionAssumptionAssumptionAssumptionAssumptionAssumptionNew AssumptionAnomalies from ExperimentsExperiments on Current AssumptionTime
  14. 14. The Structure of API Revolutions
  15. 15. Debate : XML vs. JSON
  16. 16. Courtesy of APIHubDebate : XML vs. JSON
  17. 17. Debate : XML vs. JSONCourtesy of ProgrammableWeb
  18. 18. Debate : XML vs. JSONThis debate is over-simplified!
  19. 19. Debate : REST vs. SOAP
  20. 20. Debate : REST vs. SOAPCourtesy of ProgrammableWeb
  21. 21. Debate : Public vs. Private
  22. 22. Courtesy of ProgrammableWeb
  23. 23. Partners
  24. 24. My View on These Kind ofDebates?Who Cares?!?!
  25. 25. What do I care about?
  26. 26. My Audience!
  27. 27. End in itselfMeans to an end
  28. 28. Emerging Focus for the APIIndustry• Internal API Consumers• API Consumer Simplicity Over API Provider Simplicity• Scaling• Resiliency• Tools and Insights• Testing and Automation
  29. 29. Brief Look at Netfix API History
  30. 30. 2007
  31. 31. Netflix REST API:One-Size-Fits-All (OSFA)Solution
  32. 32. Image courtesy of Jay Mac 3 on Flickr
  33. 33. ExternalDevelopersNetflix API Requests by AudienceAt Launch in 2008
  34. 34. Image courtesy of Jay Mac 3 on Flickr
  35. 35. Growth of Netflix API Requests0.620.741.7-51015202530354045Jan-10 Jan-11 Jan-12RequestinBillions70x growth in two years!
  36. 36. Netflix API Requests by AudienceFrom 2011ExternalDevelopers
  37. 37. More than 36 Million SubscribersMore than 50 Countries & Territories
  38. 38. Netflix Accounts for 33% of PeakInternet Traffic in North AmericaNetflix subscribers are watching more than 1 billion hours a month
  39. 39. 1,000+ DifferentDevice Types
  40. 40. 1000+ Device Types
  41. 41. Personalization EngineUser InfoMovieMetadataMovieRatingsSimilarMoviesReviewsA/B TestEngineDozens of Dependencies
  42. 42. Personalization EngineUser InfoMovieMetadataMovieRatingsSimilarMoviesAPIReviewsA/B TestEngine
  43. 43. API0.620.741.7-51015202530354045Jan-10 Jan-11 Jan-12
  44. 44. Emerging Focus for the APIIndustry• Internal API Consumers• API Consumer Simplicity Over API Provider Simplicity• Scaling• Resiliency• Tools and Insights• Testing and Automation
  45. 45. New Audience = New Charter
  46. 46. New Charter = New Design
  47. 47. Internal API ConsumersAPI Consumer Simplicity
  48. 48. New DesignFocused on three key themes:• Chattiness• Variability across devices• Innovation rates
  49. 49. New DesignFocused on three key themes:• Chattiness• Variability across devices• Innovation rates
  50. 50. Growth of Netflix API Requests0.620.741.7-51015202530354045Jan-10 Jan-11 Jan-12RequestinBillions70x growth in two years!
  51. 51. Growth of the Netflix API> 2 billion requests per dayExploding out to > 14 billion dependency calls per day
  52. 52. <catalog_titles><number_of_results>1140</number_of_results><start_index>0</start_index><results_per_page>10</results_per_page><catalog_title><id>http://api.netflix.com/catalog/titles/movies/60021896</id><title short="Star" regular="Star"></title><box_art small="http://alien2.netflix.com/us/boxshots/tiny/60021896.jpg"medium="http://alien2.netflix.com/us/boxshots/small/60021896.jpg"large="http://alien2.netflix.com/us/boxshots/large/60021896.jpg"></box_art><link href="http://api.netflix.com/catalog/titles/movies/60021896/synopsis"rel="http://schemas.netflix.com/catalog/titles/synopsis" title="synopsis"></link><release_year>2001</release_year><category scheme="http://api.netflix.com/catalog/titles/mpaa_ratings" label="NR"></category><category scheme="http://api.netflix.com/categories/genres" label="Foreign"></category><link href="http://api.netflix.com/catalog/titles/movies/60021896/cast"rel="http://schemas.netflix.com/catalog/people.cast" title="cast"></link><link href="http://api.netflix.com/catalog/titles/movies/60021896/screen_formats" rel="http://schemas.netflix.com/catalog/titles/screen_formats" title="screen formats"></link<link href="http://api.netflix.com/catalog/titles/movies/60021896/languages_and_audio" rel="http://schemas.netflix.com/catalog/titles/languages_and_audio" title="languages and audio"></link><average_rating>1.9</average_rating><link href="http://api.netflix.com/catalog/titles/movies/60021896/similars" rel="http://schemas.netflix.com/catalog/titles.similars" title="similars"></link><link href="http://www.netflix.com/Movie/Star/60021896" rel="alternate" title="webpage"></link></catalog_title><catalog_title><id>http://api.netflix.com/catalog/titles/movies/17985448</id><title short="Lone Star" regular="Lone Star"></title><box_art small="http://alien2.netflix.com/us/boxshots/tiny/17985448.jpg" medium="http://alien2.netflix.com/us/boxshots/small/17985448.jpg" large=""></box_art><link href="http://api.netflix.com/catalog/titles/movies/17985448/synopsis" rel="http://schemas.netflix.com/catalog/titles/synopsis" title="synopsis"></link><release_year>1996</release_year><category scheme="http://api.netflix.com/catalog/titles/mpaa_ratings" label="R"></category><category scheme="http://api.netflix.com/categories/genres" label="Drama"></category><link href="http://api.netflix.com/catalog/titles/movies/17985448/awards" rel="http://schemas.netflix.com/catalog/titles/awards" title="awards"></link><link href="http://api.netflix.com/catalog/titles/movies/17985448/format_availability" rel="http://schemas.netflix.com/catalog/titles/format_availability" title="formats"></link><link href="http://api.netflix.com/catalog/titles/movies/17985448/screen_formats" rel="http://schemas.netflix.com/catalog/titles/screen_formats" title="screen formats"></link><link href="http://api.netflix.com/catalog/titles/movies/17985448/languages_and_audio" rel="http://schemas.netflix.com/catalog/titles/languages_and_audio" title="languages and audio"></link><average_rating>3.7</average_rating><link href="http://api.netflix.com/catalog/titles/movies/17985448/previews" rel="http://schemas.netflix.com/catalog/titles/previews" title="previews"></link><link href="http://api.netflix.com/catalog/titles/movies/17985448/similars" rel="http://schemas.netflix.com/catalog/titles.similars" title="similars"></link><link href="http://www.netflix.com/Movie/Lone_Star/17985448" rel="alternate" title="webpage"></link></catalog_title></catalog_titles>
  53. 53. {"catalog_title":{"id":"http://api.netflix.com/catalog/titles/movies/60034967","title":{"title_short":"Rosencrantz and Guildenstern Are Dead","regular":"Rosencrantz and Guildenstern Are Dead"},"maturity_level":60,"release_year":"1990","average_rating":3.7,"box_art":{"284pix_w":"http://cdn-7.nflximg.com/en_US/boxshots/ghd/60034967.jpg","110pix_w":"http://cdn-7.nflximg.com/en_US/boxshots/large/60034967.jpg","38pix_w":"http://cdn-7.nflximg.com/en_US/boxshots/tiny/60034967.jpg","64pix_w":"http://cdn-7.nflximg.com/en_US/boxshots/small/60034967.jpg","150pix_w":"http://cdn-7.nflximg.com/en_US/boxshots/150/60034967.jpg","88pix_w":"http://cdn-7.nflximg.com/en_US/boxshots/88/60034967.jpg","124pix_w":"http://cdn-7.nflximg.com/en_US/boxshots/124/60034967.jpg"},"language":"en","web_page":"http://www.netflix.com/Movie/Rosencrantz_and_Guildenstern_Are_Dead/60034967","tiny_url":"http://movi.es/ApUP9"},"meta":{"expand":["@directors","@bonus_materials","@cast","@awards","@short_synopsis","@synopsis","@box_art","@screen_formats","@"links":{"id":"http://api.netflix.com/catalog/titles/movies/60034967","languages_and_audio":"http://api.netflix.com/catalog/titles/movies/60034967/languages_and_audio","title":"http://api.netflix.com/catalog/titles/movies/60034967/title","screen_formats":"http://api.netflix.com/catalog/titles/movies/60034967/screen_formats","cast":"http://api.netflix.com/catalog/titles/movies/60034967/cast","awards":"http://api.netflix.com/catalog/titles/movies/60034967/awards","short_synopsis":"http://api.netflix.com/catalog/titles/movies/60034967/short_synopsis","box_art":"http://api.netflix.com/catalog/titles/movies/60034967/box_art","synopsis":"http://api.netflix.com/catalog/titles/movies/60034967/synopsis","directors":"http://api.netflix.com/catalog/titles/movies/60034967/directors","similars":"http://api.netflix.com/catalog/titles/movies/60034967/similars","format_availability":"http://api.netflix.com/catalog/titles/movies/60034967/format_availability"}}}
  54. 54. What if the API request growth ratelooks like this???-20406080100120140160RequestisBillionsIs this good for the long run???
  55. 55. Improve Efficiency of APIRequestsCould it have been 300 million requests per day? Or less?(Assuming everything else remained the same)
  56. 56. New DesignFocused on three key themes:• Chattiness• Variability across devices• Innovation rates
  57. 57. Screen Real Estate
  58. 58. Controller
  59. 59. Technical Capabilities
  60. 60. New DesignFocused on three key themes:• Chattiness• Variability across devices• Innovation rates
  61. 61. One-Size-Fits-AllAPIRequestRequestRequest
  62. 62. Our Solution…
  63. 63. Move away from theOne-Size-Fits-All API model
  64. 64. Resource-Based APIvs.Experience-Based API
  65. 65. Resource-Based Requests• /users/<id>/ratings/title• /users/<id>/queues• /users/<id>/queues/instant• /users/<id>/recommendations• /catalog/titles/movie• /catalog/titles/series• /catalog/people
  66. 66. OSFAAPIRECOMMENDATIONSMOVIEDATASIMILARMOVIESAUTHMEMBERDATAA/BTESTSSTART-UPRATINGSNetwork Border Network Border
  67. 67. OSFAAPIRECOMMENDATIONSMOVIEDATASIMILARMOVIESAUTHMEMBERDATAA/BTESTSSTART-UPRATINGSNetwork Border Network BorderSERVER CODECLIENT CODE
  68. 68. OSFAAPIRECOMMENDATIONSMOVIEDATASIMILARMOVIESAUTHMEMBERDATAA/BTESTSSTART-UPRATINGSNetwork Border Network BorderDATA GATHERING,FORMATTING,AND DELIVERYUSER INTERFACERENDERING
  69. 69. Experience-Based Requests• /ps3/homescreen
  70. 70. JAVAAPIRECOMMENDATIONSMOVIEDATASIMILARMOVIESAUTHMEMBERDATAA/BTESTSSTART-UPRATINGSNetwork Border Network BorderGroovy Layer
  71. 71. JAVAAPIRECOMMENDATIONSMOVIEDATASIMILARMOVIESAUTHMEMBERDATAA/BTESTSSTART-UPRATINGSGroovy LayerSERVER CODECLIENT CODECLIENT ADAPTER CODE(WRITTEN BY CLIENT TEAMS, DYNAMICALLY UPLOADED TO SERVER)Network Border Network Border
  72. 72. JAVAAPIRECOMMENDATIONSMOVIEDATASIMILARMOVIESAUTHMEMBERDATAA/BTESTSSTART-UPRATINGSGroovy LayerDATA GATHERINGDATA FORMATTINGAND DELIVERYUSER INTERFACERENDERINGNetwork Border Network Border
  73. 73. Versionless API
  74. 74. Average Life of a TV : About 7-10 Years
  75. 75. Versioning for APIs1.01.52.0Today3.0?4.0?5.0?2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020
  76. 76. Versioning for APIs1.01.52.0Today2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020
  77. 77. Benefit to Thinking Versionless• If you can achieve it, maintenance will be MUCH simpler• If you cannot, it instills better practices• Reduces lazy programming• Results in fewer versions• Results in a cleaner, less brittle systemREMEMBER: Adding new features typically does notrequire a new version(structural changes and removals do)
  78. 78. Recipe for Targeted APIsAPI providers that have a:1. small number of targeted API consumers2. very close relationships between with API consumers3. increasing divergence of needs across these API consumers4. strong desire for optimization by the API consumers5. optimized APIs offer high value proposition
  79. 79. Recipe for Targeted APIsAPI providers that have a:1. small number of targeted API consumers2. very close relationships between with API consumers3. increasing divergence of needs across these API consumers4. strong desire for optimization by the API consumers5. optimized APIs offer high value proposition6. a generous helping of chocolate (to keep engineers happy)
  80. 80. Resiliency, Scaling and InsightsProtect the Customer
  81. 81. Personalization EngineUser InfoMovieMetadataMovieRatingsSimilarMoviesAPIReviewsA/B TestEngine
  82. 82. Personalization EngineUser InfoMovieMetadataMovieRatingsSimilarMoviesAPIReviewsA/B TestEngine
  83. 83. Personalization EngineUser InfoMovieMetadataMovieRatingsSimilarMoviesAPIReviewsA/B TestEngine
  84. 84. Personalization EngineUser InfoMovieMetadataMovieRatingsSimilarMoviesAPIReviewsA/B TestEngine
  85. 85. Circuit Breaker Dashboard & Turbine
  86. 86. Call Volume and Health / Last 10 Seconds
  87. 87. Call Volume / Last 2 Minutes
  88. 88. Successful Requests
  89. 89. Successful, But Slower Than Expected
  90. 90. Short-Circuited Requests, Delivering Fallbacks
  91. 91. Timeouts, Delivering Fallbacks
  92. 92. Thread Pool & Task Queue Full, Delivering Fallbacks
  93. 93. Exceptions, Delivering Fallbacks
  94. 94. Error Rate# + # + # + # / (# + # + # + # + #) = Error Rate
  95. 95. Status of Fallback Circuit
  96. 96. Requests per Second, Over Last 10Seconds
  97. 97. SLA Information
  98. 98. Personalization EngineUser InfoMovieMetadataMovieRatingsSimilarMoviesAPIReviewsA/B TestEngine
  99. 99. Personalization EngineUser InfoMovieMetadataMovieRatingsSimilarMoviesAPIReviewsA/B TestEngine
  100. 100. Personalization EngineUser InfoMovieMetadataMovieRatingsSimilarMoviesAPIReviewsA/B TestEngine
  101. 101. Personalization EngineUser InfoMovieMetadataMovieRatingsSimilarMoviesAPIReviewsA/B TestEngineFallback
  102. 102. Personalization EngineUser InfoMovieMetadataMovieRatingsSimilarMoviesAPIReviewsA/B TestEngineFallback
  103. 103. Development / TestingPhilosophyAct fast, react fast
  104. 104. That Doesn’t Mean We Don’tTest• Unit tests• Functional tests• Regression scripts• Continuous integration• Capacity planning• Load / Performance tests
  105. 105. AWS Cloud
  106. 106. Environment Health Insights
  107. 107. Cloud-Based DeploymentTechniques
  108. 108. Current CodeIn ProductionAPI Requests fromthe Internet
  109. 109. Single Canary InstanceTo Test New Code with Production Traffic(around 1% or less of traffic)Current CodeIn ProductionAPI Requests fromthe Internet
  110. 110. Canary Analysis Insights
  111. 111. Canary Health Insights
  112. 112. Single Canary InstanceTo Test New Code with Production Traffic(around 1% or less of traffic)Current CodeIn ProductionAPI Requests fromthe InternetError!
  113. 113. Current CodeIn ProductionAPI Requests fromthe Internet
  114. 114. Current CodeIn ProductionAPI Requests fromthe InternetPerfect!
  115. 115. Current CodeIn ProductionAPI Requests fromthe InternetNew CodeGetting Prepared forProduction
  116. 116. Current CodeIn ProductionAPI Requests fromthe InternetNew CodeGetting Prepared forProduction
  117. 117. Error!Current CodeIn ProductionAPI Requests fromthe InternetNew CodeGetting Prepared forProduction
  118. 118. Current CodeIn ProductionAPI Requests fromthe InternetNew CodeGetting Prepared forProduction
  119. 119. Current CodeIn ProductionAPI Requests fromthe InternetPerfect!
  120. 120. Current CodeIn ProductionAPI Requests fromthe InternetNew CodeGetting Prepared forProduction
  121. 121. Current CodeIn ProductionAPI Requests fromthe InternetNew CodeGetting Prepared forProduction
  122. 122. API Requests fromthe InternetNew CodeGetting Prepared forProduction
  123. 123. Deployment Status Insights
  124. 124. Netflix API Focus• Internal API Consumers• API Consumer Simplicity Over API Provider Simplicity• Scaling• Resiliency• Tools and Insights• Testing and Automation
  125. 125. Image courtesy of johnt HDRcreme
  126. 126. Image courtesy of KK+ on Flickr
  127. 127. Image courtesy of Mars
  128. 128. The Structure of API RevolutionsImage courtesy of SakeThrajan@daniel_jacobsondjacobson@netflix.comhttp://www.linkedin.com/in/danieljacobsonhttp://www.slideshare.net/danieljacobson

×