Techniques for Scaling the Netflix API - QCon SF

Daniel Jacobson
Daniel JacobsonDirector of Engineering - Netflix API at Netflix
Techniques for Scaling the
       Netflix API
      By Daniel Jacobson
       @daniel_jacobson
    djacobson@netflix.com


                             QCon SF 2011
Techniques for Scaling the Netflix API

                      Agenda

•   History of the Netflix API
•   The Cloud
•   Development and Testing
•   Resiliency
•   Future of the Netflix API
Techniques for Scaling the Netflix API

                      Agenda

•   History of the Netflix API
•   The Cloud
•   Development and Testing
•   Resiliency
•   Future of the Netflix API
Netflix
 API
Netflix API Requests by Audience
          At Launch In 2008




                              Netflix Devices
                              Open API Developers
Techniques for Scaling the Netflix API - QCon SF
Techniques for Scaling the Netflix API - QCon SF
Netflix
 API
Netflix API Requests by Audience
   At Launch                         Today




               Netflix Devices
               Open API Developers
Public API




             Private API
Current Emphasis of Netflix API




                         Netflix Devices
Techniques for Scaling the Netflix API

                      Agenda

•   History of the Netflix API
•   The Cloud
•   Development and Testing
•   Resiliency
•   Future of the Netflix API
Techniques for Scaling the Netflix API - QCon SF
Discovery
Discovery
Streaming
Netflix API Powers Discovery
Netflix API : Requests Per Month
                       35




                       30




                       25
Requests in Billions




                       20




                       15




                       10




                        5




                       -
Netflix API : Requests Per Month
                       35




                       30




                       25
Requests in Billions




                       20




                       15




                       10




                        5




                       -
Techniques for Scaling the Netflix API - QCon SF
Techniques for Scaling the Netflix API - QCon SF
AWS Cloud
Techniques for Scaling the Netflix API - QCon SF
Autoscaling
Autoscaling
Techniques for Scaling the Netflix API - QCon SF
Techniques for Scaling the Netflix API

                      Agenda

•   History of the Netflix API
•   The Cloud
•   Development and Testing
•   Resiliency
•   Future of the Netflix API
Development / Testing
     Philosophy
    Act fast, react fast
That Doesn’t Mean We Don’t Test
•   Unit tests
•   Functional tests
•   Regression scripts
•   Continuous integration
•   Capacity planning
•   Load / Performance tests
Development         Contiuous
                                 Run Unit Tests
(Feature & Test)   Integration




   Perform
                    Deploy to    Run Functional
 Integration
                   Staging Env       Tests
    Tests




 Deploy to
 Customers
Cloud-Based Deployment Techniques
API Requests from
                   the Internet




                                                           Problem!




Current Code

In Production




                                     Single Canary Instance
                            To Test New Code with Production Traffic
                                (typically around 1-5% of traffic)
API Requests from
                   the Internet




Current Code

In Production
API Requests from
                   the Internet




Current Code                              New Code

In Production                   Getting Prepared for Production
API Requests from
                           the Internet




      Old Code                              Current Code

Prepared For Rollback                       In Production
API Requests from
                                 the Internet




         Old Code                                    New Code

Rolled Back into Production                       Out of Production
API Requests from
                   the Internet




Current Code

In Production
API Requests from
                   the Internet




Current Code                              New Code

In Production                   Getting Prepared for Production
API Requests from
                           the Internet




      Old Code                              Current Code

Prepared For Rollback                       In Production
API Requests from
   the Internet




                    Current Code

                    In Production
Development                          Continuous
                   Run Unit Tests
(Feature & Test)                     Integration




     Run
                     Deploy to      Run Functional
 Integration
                    Staging Env         Tests
    Tests



                      Perform
Deploy Canary
                      Canary
 Instance(s)
                      Analysis




 Deploy to         Perform Black    Deploy Black
 Customers            Analysis       Instances
Techniques for Scaling the Netflix API

                      Agenda

•   History of the Netflix API
•   The Cloud
•   Development and Testing
•   Resiliency
•   Future of the Netflix API
API




Personaliz
                          Movie     Movie     Similar             A/B Test
  ation      User Info                                  Reviews
 Engine
                         Metadata   Ratings   Movies               Engine
API




Personaliz
                          Movie     Movie     Similar             A/B Test
  ation      User Info                                  Reviews
 Engine
                         Metadata   Ratings   Movies               Engine
API




Personaliz
                          Movie     Movie     Similar             A/B Test
  ation      User Info                                  Reviews
 Engine
                         Metadata   Ratings   Movies               Engine
API




Personaliz
                          Movie     Movie     Similar             A/B Test
  ation      User Info                                  Reviews
 Engine
                         Metadata   Ratings   Movies               Engine
Circuit Breaker Dashboard
Techniques for Scaling the Netflix API - QCon SF
Call Volume and Health / Last 10 Seconds
Call Volume / Last 2 Minutes
Successful Requests
Successful, But Slower Than Expected
Short-Circuited Requests, Delivering Fallbacks
Timeouts, Delivering Fallbacks
Thread Pool & Task Queue Full, Delivering Fallbacks
Exceptions, Delivering Fallbacks
# + # + # + # / (# + # + # + # + #) = Error Rate
                                                   Error Rate
Status of Fallback Circuit
Requests per Second, Over Last 10 Seconds
SLA Information
API




Personaliz
                          Movie     Movie     Similar             A/B Test
  ation      User Info                                  Reviews
 Engine
                         Metadata   Ratings   Movies               Engine
API




Personaliz
                          Movie     Movie     Similar             A/B Test
  ation      User Info                                  Reviews
 Engine
                         Metadata   Ratings   Movies               Engine
API




Personaliz
                          Movie     Movie     Similar             A/B Test
  ation      User Info                                  Reviews
 Engine
                         Metadata   Ratings   Movies               Engine
API




                         Fallback


Personaliz
                                Movie     Movie     Similar             A/B Test
  ation      User Info                                        Reviews
 Engine
                               Metadata   Ratings   Movies               Engine
API




                         Fallback


Personaliz
                                Movie     Movie     Similar             A/B Test
  ation      User Info                                        Reviews
 Engine
                               Metadata   Ratings   Movies               Engine
Techniques for Scaling the Netflix API

                      Agenda

•   History of the Netflix API
•   The Cloud
•   Development and Testing
•   Resiliency
•   Future of the Netflix API
Netflix
 API
Netflix API Requests by Audience
     Supporting Streaming Devices Today




                                      Netflix Devices
                                      Open API Developers
Techniques for Scaling the Netflix API - QCon SF
Redesign the API
Netflix API : Requests Per Month
                       35




                       30




                       25
Requests in Billions




                       20




                       15




                       10




                        5




                       -
Growth of the Netflix API




Over 30 Billion requests per month
    (Peaks at about 20,000 requests per second)
Techniques for Scaling the Netflix API - QCon SF
<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>
{"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"}
}}
Improve Efficiency of API Requests




Could it have been 5 billion requests per month? Or less?
             (Assuming everything else remained the same)
Netflix API : Requests Per Month
                      35




                      30




                      25
Request in Billions




                      20




                      15




                      10




                      5




                      0
Netflix API : Requests Per Month
                      35




                      30




                      25
Request in Billions




                      20




                      15




                      10




                      5




                      0
API Billionaires Club
13 billion API calls / day (May 2011)
Over 260 billion objects stored in S3 (January 2011)
5 billion API calls / day     (April 2010)



5 billion API calls / day     (October 2009)



1 billion API calls / day (October 2011)

8 billion API calls / month (Q3 2009)

3.2 billion API-delivered stories / month              (October
2011)

3 billion API calls / month (March 2009)


                       Courtesy of John Musser, ProgrammableWeb
API Billionaires Club
13 billion API calls / day (May 2011)
Over 260 billion objects stored in S3 (January 2011)
5 billion API calls / day     (April 2010)



5 billion API calls / day     (October 2009)



1 billion API calls / day (October 2011)

8 billion API calls / month (Q3 2009)

3.2 billion API-delivered stories / month              (October
2011)

3 billion API calls / month (March 2009)


                       Courtesy of John Musser, ProgrammableWeb
Two Major Objective for
             API Redesign

• Improve performance for devices
  – Minimize network traffic (one API call, if possible)
  – Only deliver bytes that are needed

• Improve ability for device teams to rapidly
  innovate
  – Customized request/response patterns per device
  – Deployment is independent from API schedules
Current Client / Server Interaction
CLIENT APPS        API SERVER
                                 AUTH

                                SETUP

                                 TIME

                                QUEUE

                                 LISTS


                                LIST ( i )


                                TITLES
Future Client / Server Interaction
CLIENT APPS       API SERVER


                  CUSTOM SCRIPTING TIER




                       GENERIC API
Custom Scripting Tier Interaction
CLIENT APPS               API SERVER
                                        AUTH
               CUSTOM
              SCRIPTING                SETUP
                 TIER
                                        TIME
                    PS3
                   HOME                QUEUE
                  SCREEN
                  CUSTOM                LISTS
                 ENDPOINT

                                       LIST ( i )

              Owned and operated
                by the UI teams        TITLES
Techniques for Scaling the Netflix API - QCon SF
Techniques for Scaling the Netflix API - QCon SF
Techniques for Scaling the Netflix API - QCon SF
For More Titles From a List
Techniques for Scaling the Netflix API - QCon SF
Generic API Interaction
CLIENT APP                API SERVER
                                        AUTH

                GENERIC                CONFIG
                 SCRIPT
                                        TIME

                  SIMPLE               QUEUE
                 CATALOG
                 REQUEST
                  TO API                LISTS


                                       LIST ( i )

              Owned and operated
                by the API team        TITLES
Technologies
                               AUTH

                              CONFIG

                               TIME
               GROOVY
                 SIMPLE
  CLIENT      COMPILED
                CATALOG   JAVAQUEUE
                REQUEST
LANGUAGE         INTO
                 TO API      LOLOMO
                               LISTS
                  JVM
                              LIST ( i )


                              TITLES
API Production Servers




  Cassandra Cluster




                         UI Engineers
Active


  1
      2
           3
               4
                   5
    SCRIPT
 REPOSITORY            6
  (DYNAMIC
DEPLOYMENT)




              API SERVER
          APPLICATION CODE
      (REQUIRES API CODE PUSHES)
Active


  1
      2
           3
               4
                   5
    SCRIPT
 REPOSITORY            6
  (DYNAMIC
                           7
DEPLOYMENT)




              API SERVER
          APPLICATION CODE
      (REQUIRES API CODE PUSHES)
1
      2
          3
              4
                              Active
                  5
    SCRIPT
 REPOSITORY           6
  (DYNAMIC
                          7
DEPLOYMENT)




              API SERVER
          APPLICATION CODE
      (REQUIRES API CODE PUSHES)
Techniques for Scaling the Netflix API - QCon SF
Techniques for Scaling the Netflix API - QCon SF
If you are interested in helping us solve these
       problems, please contact me at:

           Daniel Jacobson
          djacobson@netflix.com
             @daniel_jacobson
http://www.linkedin.com/in/danieljacobson
 http://www.slideshare.net/danieljacobson
1 of 98

Recommended

APIs for Internal Audiences - Netflix - App Dev Conference by
APIs for Internal Audiences - Netflix - App Dev ConferenceAPIs for Internal Audiences - Netflix - App Dev Conference
APIs for Internal Audiences - Netflix - App Dev ConferenceDaniel Jacobson
1.7K views34 slides
API Revolutions : Netflix's API Redesign by
API Revolutions : Netflix's API RedesignAPI Revolutions : Netflix's API Redesign
API Revolutions : Netflix's API RedesignDaniel Jacobson
35.7K views74 slides
Scaling the Netflix API by
Scaling the Netflix APIScaling the Netflix API
Scaling the Netflix APIDaniel Jacobson
32.2K views92 slides
Redesigning the Netflix API - OSCON by
Redesigning the Netflix API - OSCONRedesigning the Netflix API - OSCON
Redesigning the Netflix API - OSCONDaniel Jacobson
4.8K views45 slides
Set Your Content Free! : Case Studies from Netflix and NPR by
Set Your Content Free! : Case Studies from Netflix and NPRSet Your Content Free! : Case Studies from Netflix and NPR
Set Your Content Free! : Case Studies from Netflix and NPRDaniel Jacobson
35.1K views80 slides
Netflix API: Keynote at Disney Tech Conference by
Netflix API: Keynote at Disney Tech ConferenceNetflix API: Keynote at Disney Tech Conference
Netflix API: Keynote at Disney Tech ConferenceDaniel Jacobson
2.9K views142 slides

More Related Content

What's hot

Presentation to ESPN about the Netflix API by
Presentation to ESPN about the Netflix APIPresentation to ESPN about the Netflix API
Presentation to ESPN about the Netflix APIDaniel Jacobson
2.2K views37 slides
Netflix API - Presentation to PayPal by
Netflix API - Presentation to PayPalNetflix API - Presentation to PayPal
Netflix API - Presentation to PayPalDaniel Jacobson
25.9K views101 slides
Netflix API : BAPI 2011 Presentation : SF by
Netflix API : BAPI 2011 Presentation : SFNetflix API : BAPI 2011 Presentation : SF
Netflix API : BAPI 2011 Presentation : SFDaniel Jacobson
3K views33 slides
Scaling the Netflix API - From Atlassian Dev Den by
Scaling the Netflix API - From Atlassian Dev DenScaling the Netflix API - From Atlassian Dev Den
Scaling the Netflix API - From Atlassian Dev DenDaniel Jacobson
12.1K views124 slides
Netflix API by
Netflix APINetflix API
Netflix APIDaniel Jacobson
2.7K views111 slides
The future-of-netflix-api by
The future-of-netflix-apiThe future-of-netflix-api
The future-of-netflix-apiDaniel Jacobson
233.2K views29 slides

What's hot(20)

Presentation to ESPN about the Netflix API by Daniel Jacobson
Presentation to ESPN about the Netflix APIPresentation to ESPN about the Netflix API
Presentation to ESPN about the Netflix API
Daniel Jacobson2.2K views
Netflix API - Presentation to PayPal by Daniel Jacobson
Netflix API - Presentation to PayPalNetflix API - Presentation to PayPal
Netflix API - Presentation to PayPal
Daniel Jacobson25.9K views
Netflix API : BAPI 2011 Presentation : SF by Daniel Jacobson
Netflix API : BAPI 2011 Presentation : SFNetflix API : BAPI 2011 Presentation : SF
Netflix API : BAPI 2011 Presentation : SF
Daniel Jacobson3K views
Scaling the Netflix API - From Atlassian Dev Den by Daniel Jacobson
Scaling the Netflix API - From Atlassian Dev DenScaling the Netflix API - From Atlassian Dev Den
Scaling the Netflix API - From Atlassian Dev Den
Daniel Jacobson12.1K views
The future-of-netflix-api by Daniel Jacobson
The future-of-netflix-apiThe future-of-netflix-api
The future-of-netflix-api
Daniel Jacobson233.2K views
Top 10 Lessons Learned from the Netflix API - OSCON 2014 by Daniel Jacobson
Top 10 Lessons Learned from the Netflix API - OSCON 2014Top 10 Lessons Learned from the Netflix API - OSCON 2014
Top 10 Lessons Learned from the Netflix API - OSCON 2014
Daniel Jacobson29.6K views
Netflix API - Separation of Concerns by Daniel Jacobson
Netflix API - Separation of ConcernsNetflix API - Separation of Concerns
Netflix API - Separation of Concerns
Daniel Jacobson10.7K views
History and Future of the Netflix API - Mashery Evolution of Distribution by Daniel Jacobson
History and Future of the Netflix API - Mashery Evolution of DistributionHistory and Future of the Netflix API - Mashery Evolution of Distribution
History and Future of the Netflix API - Mashery Evolution of Distribution
Daniel Jacobson3.8K views
Maintaining the Front Door to Netflix by Benjamin Schmaus
Maintaining the Front Door to NetflixMaintaining the Front Door to Netflix
Maintaining the Front Door to Netflix
Benjamin Schmaus2.5K views
Why API? - Business of APIs Conference by Daniel Jacobson
Why API? - Business of APIs ConferenceWhy API? - Business of APIs Conference
Why API? - Business of APIs Conference
Daniel Jacobson4.9K views
Developers are People Too! Building a DX-Based API Strategy Ronnie Mitra, Pri... by CA API Management
Developers are People Too! Building a DX-Based API Strategy Ronnie Mitra, Pri...Developers are People Too! Building a DX-Based API Strategy Ronnie Mitra, Pri...
Developers are People Too! Building a DX-Based API Strategy Ronnie Mitra, Pri...
CA API Management2.3K views
Migrating Automation Tests to Postman Monitors and ROI by Postman
Migrating Automation Tests to Postman Monitors and ROIMigrating Automation Tests to Postman Monitors and ROI
Migrating Automation Tests to Postman Monitors and ROI
Postman698 views
Essential API Facade Patterns - Composition (Episode 1) by Apigee | Google Cloud
Essential API Facade Patterns - Composition (Episode 1)Essential API Facade Patterns - Composition (Episode 1)
Essential API Facade Patterns - Composition (Episode 1)
Essential API Facade Patterns: One Phase to Two Phase Conversion (Episode 3) by Apigee | Google Cloud
Essential API Facade Patterns: One Phase to Two Phase Conversion (Episode 3)Essential API Facade Patterns: One Phase to Two Phase Conversion (Episode 3)
Essential API Facade Patterns: One Phase to Two Phase Conversion (Episode 3)

Viewers also liked

OSCON Data 2011 -- NoSQL @ Netflix, Part 2 by
OSCON Data 2011 -- NoSQL @ Netflix, Part 2OSCON Data 2011 -- NoSQL @ Netflix, Part 2
OSCON Data 2011 -- NoSQL @ Netflix, Part 2Sid Anand
1.8K views57 slides
Netflix incloudsmarch8 2011forwiki by
Netflix incloudsmarch8 2011forwikiNetflix incloudsmarch8 2011forwiki
Netflix incloudsmarch8 2011forwikiKevin McEntee
186.2K views18 slides
David Pearl: Analysis Netflix by
David Pearl: Analysis NetflixDavid Pearl: Analysis Netflix
David Pearl: Analysis NetflixDavid Pearl
369 views17 slides
Lafarge by
LafargeLafarge
LafargePracticeNext
542 views26 slides
Evolving the Netflix API by
Evolving the Netflix APIEvolving the Netflix API
Evolving the Netflix APIKatharina Probst
3.5K views61 slides
Canary Analyze All the Things by
Canary Analyze All the ThingsCanary Analyze All the Things
Canary Analyze All the Thingsroyrapoport
4.2K views183 slides

Viewers also liked(20)

OSCON Data 2011 -- NoSQL @ Netflix, Part 2 by Sid Anand
OSCON Data 2011 -- NoSQL @ Netflix, Part 2OSCON Data 2011 -- NoSQL @ Netflix, Part 2
OSCON Data 2011 -- NoSQL @ Netflix, Part 2
Sid Anand1.8K views
Netflix incloudsmarch8 2011forwiki by Kevin McEntee
Netflix incloudsmarch8 2011forwikiNetflix incloudsmarch8 2011forwiki
Netflix incloudsmarch8 2011forwiki
Kevin McEntee186.2K views
David Pearl: Analysis Netflix by David Pearl
David Pearl: Analysis NetflixDavid Pearl: Analysis Netflix
David Pearl: Analysis Netflix
David Pearl369 views
Canary Analyze All the Things by royrapoport
Canary Analyze All the ThingsCanary Analyze All the Things
Canary Analyze All the Things
royrapoport4.2K views
Netflix Edge Engineering Open House Presentations - June 9, 2016 by Daniel Jacobson
Netflix Edge Engineering Open House Presentations - June 9, 2016Netflix Edge Engineering Open House Presentations - June 9, 2016
Netflix Edge Engineering Open House Presentations - June 9, 2016
Daniel Jacobson4.8K views
Monografia: A prática da Leitura no Ensino de Lingua Inglesa by gleudivania
Monografia: A prática da Leitura no Ensino de Lingua InglesaMonografia: A prática da Leitura no Ensino de Lingua Inglesa
Monografia: A prática da Leitura no Ensino de Lingua Inglesa
gleudivania9K views
Lafarge ppt by arijeet14
Lafarge pptLafarge ppt
Lafarge ppt
arijeet1410.3K views
Maintaining the Front Door to Netflix : The Netflix API by Daniel Jacobson
Maintaining the Front Door to Netflix : The Netflix APIMaintaining the Front Door to Netflix : The Netflix API
Maintaining the Front Door to Netflix : The Netflix API
Daniel Jacobson70.3K views
Competition in indian cement industry a case of collusive by pulsar5583
Competition in indian cement industry a case of collusiveCompetition in indian cement industry a case of collusive
Competition in indian cement industry a case of collusive
pulsar558318.1K views
Netflix by Richa Arora
Netflix Netflix
Netflix
Richa Arora16.1K views
From SOA to MSA by William Yang
From SOA to MSAFrom SOA to MSA
From SOA to MSA
William Yang17.9K views
(BDT318) How Netflix Handles Up To 8 Million Events Per Second by Amazon Web Services
(BDT318) How Netflix Handles Up To 8 Million Events Per Second(BDT318) How Netflix Handles Up To 8 Million Events Per Second
(BDT318) How Netflix Handles Up To 8 Million Events Per Second
Amazon Web Services79.1K views
Netflix: From Clouds to Roots by Brendan Gregg
Netflix: From Clouds to RootsNetflix: From Clouds to Roots
Netflix: From Clouds to Roots
Brendan Gregg67.8K views
MicroServices at Netflix - challenges of scale by Sudhir Tonse
MicroServices at Netflix - challenges of scaleMicroServices at Netflix - challenges of scale
MicroServices at Netflix - challenges of scale
Sudhir Tonse61.3K views
Lafarge Cement Value Chain by ASAD ALI
Lafarge Cement Value ChainLafarge Cement Value Chain
Lafarge Cement Value Chain
ASAD ALI16.3K views
Photographs I used & Editing by ccapricec
Photographs I used & EditingPhotographs I used & Editing
Photographs I used & Editing
ccapricec344 views
Isamar guerra by isa2790
Isamar guerraIsamar guerra
Isamar guerra
isa2790306 views

Similar to Techniques for Scaling the Netflix API - QCon SF

Evaluating and Testing Web APIs by
Evaluating and Testing Web APIsEvaluating and Testing Web APIs
Evaluating and Testing Web APIsSmartBear
9.2K views44 slides
App Engine overview (Android meetup 06-10) by
App Engine overview (Android meetup 06-10)App Engine overview (Android meetup 06-10)
App Engine overview (Android meetup 06-10)jasonacooper
665 views43 slides
AWS Re:Invent 2012 - Chaos Monkey & The Netflix Simian Army by
AWS Re:Invent 2012 - Chaos Monkey & The Netflix Simian ArmyAWS Re:Invent 2012 - Chaos Monkey & The Netflix Simian Army
AWS Re:Invent 2012 - Chaos Monkey & The Netflix Simian ArmyAriel Tseitlin
2.8K views18 slides
Immutable Server generation: The new App Deployment by
Immutable Server generation: The new App DeploymentImmutable Server generation: The new App Deployment
Immutable Server generation: The new App DeploymentAxel Fontaine
5.8K views82 slides
CI/CD@Scale by
CI/CD@ScaleCI/CD@Scale
CI/CD@ScaleAmazon Web Services
295 views32 slides
The Magic Behind Faster API Development, Testing and Delivery with API Virtua... by
The Magic Behind Faster API Development, Testing and Delivery with API Virtua...The Magic Behind Faster API Development, Testing and Delivery with API Virtua...
The Magic Behind Faster API Development, Testing and Delivery with API Virtua...SmartBear
997 views20 slides

Similar to Techniques for Scaling the Netflix API - QCon SF(20)

Evaluating and Testing Web APIs by SmartBear
Evaluating and Testing Web APIsEvaluating and Testing Web APIs
Evaluating and Testing Web APIs
SmartBear9.2K views
App Engine overview (Android meetup 06-10) by jasonacooper
App Engine overview (Android meetup 06-10)App Engine overview (Android meetup 06-10)
App Engine overview (Android meetup 06-10)
jasonacooper665 views
AWS Re:Invent 2012 - Chaos Monkey & The Netflix Simian Army by Ariel Tseitlin
AWS Re:Invent 2012 - Chaos Monkey & The Netflix Simian ArmyAWS Re:Invent 2012 - Chaos Monkey & The Netflix Simian Army
AWS Re:Invent 2012 - Chaos Monkey & The Netflix Simian Army
Ariel Tseitlin2.8K views
Immutable Server generation: The new App Deployment by Axel Fontaine
Immutable Server generation: The new App DeploymentImmutable Server generation: The new App Deployment
Immutable Server generation: The new App Deployment
Axel Fontaine5.8K views
The Magic Behind Faster API Development, Testing and Delivery with API Virtua... by SmartBear
The Magic Behind Faster API Development, Testing and Delivery with API Virtua...The Magic Behind Faster API Development, Testing and Delivery with API Virtua...
The Magic Behind Faster API Development, Testing and Delivery with API Virtua...
SmartBear997 views
A Service-Based Architecture for Multi-domain Search on the Web by Alessandro Bozzon
A Service-Based Architecture for Multi-domain Search on the WebA Service-Based Architecture for Multi-domain Search on the Web
A Service-Based Architecture for Multi-domain Search on the Web
Alessandro Bozzon917 views
API Virtualization: Mocking on Steroids by SmartBear
API Virtualization: Mocking on SteroidsAPI Virtualization: Mocking on Steroids
API Virtualization: Mocking on Steroids
SmartBear4.5K views
Building a Great Web API - Evan Cooke - QCON 2011 by Twilio Inc
Building a Great Web API - Evan Cooke - QCON 2011Building a Great Web API - Evan Cooke - QCON 2011
Building a Great Web API - Evan Cooke - QCON 2011
Twilio Inc2.3K views
Clickslide Datadipity Beta V1 by Gabriel Ortiz
Clickslide Datadipity Beta V1Clickslide Datadipity Beta V1
Clickslide Datadipity Beta V1
Gabriel Ortiz551 views
戦う情シス!全社 API で社内アプリ開発を加速させよう by Yuki Hattori
戦う情シス!全社 API で社内アプリ開発を加速させよう戦う情シス!全社 API で社内アプリ開発を加速させよう
戦う情シス!全社 API で社内アプリ開発を加速させよう
Yuki Hattori1.4K views
API Readiness: Visualizing and Virtualizing by Lorinda Brandon
API Readiness: Visualizing and VirtualizingAPI Readiness: Visualizing and Virtualizing
API Readiness: Visualizing and Virtualizing
Lorinda Brandon1.5K views
API First Workflow: How could we have better API Docs through DevOps pipeline by Pronovix
API First Workflow: How could we have better API Docs through DevOps pipelineAPI First Workflow: How could we have better API Docs through DevOps pipeline
API First Workflow: How could we have better API Docs through DevOps pipeline
Pronovix307 views
Service Testing. WTF Does This API Do by Globant
Service Testing. WTF Does This API Do	Service Testing. WTF Does This API Do
Service Testing. WTF Does This API Do
Globant100 views
Enterprise E-commerce Webinar Series, Episode 2: Deploying and Monitoring You... by Kin Lane
Enterprise E-commerce Webinar Series, Episode 2: Deploying and Monitoring You...Enterprise E-commerce Webinar Series, Episode 2: Deploying and Monitoring You...
Enterprise E-commerce Webinar Series, Episode 2: Deploying and Monitoring You...
Kin Lane10.1K views
Evaluating Recommended Applications by rsse2008
Evaluating Recommended ApplicationsEvaluating Recommended Applications
Evaluating Recommended Applications
rsse2008656 views
What’s behind a high quality web API? Ensure your APIs are more than just a ... by Kim Clark
What’s behind a high quality web API? Ensure your APIs are more than just a ...What’s behind a high quality web API? Ensure your APIs are more than just a ...
What’s behind a high quality web API? Ensure your APIs are more than just a ...
Kim Clark2.2K views
Netapp Michael Galpin by rajivmordani
Netapp Michael GalpinNetapp Michael Galpin
Netapp Michael Galpin
rajivmordani950 views

More from Daniel Jacobson

NPR Presentation at Wolfram Data Summit 2010 by
NPR Presentation at Wolfram Data Summit 2010NPR Presentation at Wolfram Data Summit 2010
NPR Presentation at Wolfram Data Summit 2010Daniel Jacobson
1.5K views29 slides
NPR: Digital Distribution Strategy: OSCON2010 by
NPR: Digital Distribution Strategy: OSCON2010NPR: Digital Distribution Strategy: OSCON2010
NPR: Digital Distribution Strategy: OSCON2010Daniel Jacobson
3.1K views62 slides
NPR's Digital Distribution and Mobile Strategy by
NPR's Digital Distribution and Mobile StrategyNPR's Digital Distribution and Mobile Strategy
NPR's Digital Distribution and Mobile StrategyDaniel Jacobson
1.9K views44 slides
NPR API Usage and Metrics by
NPR API Usage and MetricsNPR API Usage and Metrics
NPR API Usage and MetricsDaniel Jacobson
1.9K views53 slides
OpenID Adoption UX Summit by
OpenID Adoption UX SummitOpenID Adoption UX Summit
OpenID Adoption UX SummitDaniel Jacobson
962 views21 slides
NPR : Examples of COPE by
NPR : Examples of COPENPR : Examples of COPE
NPR : Examples of COPEDaniel Jacobson
27K views14 slides

More from Daniel Jacobson(6)

NPR Presentation at Wolfram Data Summit 2010 by Daniel Jacobson
NPR Presentation at Wolfram Data Summit 2010NPR Presentation at Wolfram Data Summit 2010
NPR Presentation at Wolfram Data Summit 2010
Daniel Jacobson1.5K views
NPR: Digital Distribution Strategy: OSCON2010 by Daniel Jacobson
NPR: Digital Distribution Strategy: OSCON2010NPR: Digital Distribution Strategy: OSCON2010
NPR: Digital Distribution Strategy: OSCON2010
Daniel Jacobson3.1K views
NPR's Digital Distribution and Mobile Strategy by Daniel Jacobson
NPR's Digital Distribution and Mobile StrategyNPR's Digital Distribution and Mobile Strategy
NPR's Digital Distribution and Mobile Strategy
Daniel Jacobson1.9K views

Recently uploaded

Serverless computing with Google Cloud (2023-24) by
Serverless computing with Google Cloud (2023-24)Serverless computing with Google Cloud (2023-24)
Serverless computing with Google Cloud (2023-24)wesley chun
11 views33 slides
Vertical User Stories by
Vertical User StoriesVertical User Stories
Vertical User StoriesMoisés Armani Ramírez
14 views16 slides
STKI Israeli Market Study 2023 corrected forecast 2023_24 v3.pdf by
STKI Israeli Market Study 2023   corrected forecast 2023_24 v3.pdfSTKI Israeli Market Study 2023   corrected forecast 2023_24 v3.pdf
STKI Israeli Market Study 2023 corrected forecast 2023_24 v3.pdfDr. Jimmy Schwarzkopf
19 views29 slides
Democratising digital commerce in India-Report by
Democratising digital commerce in India-ReportDemocratising digital commerce in India-Report
Democratising digital commerce in India-ReportKapil Khandelwal (KK)
15 views161 slides
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive by
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLiveAutomating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLiveNetwork Automation Forum
31 views35 slides
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ... by
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...Jasper Oosterveld
18 views49 slides

Recently uploaded(20)

Serverless computing with Google Cloud (2023-24) by wesley chun
Serverless computing with Google Cloud (2023-24)Serverless computing with Google Cloud (2023-24)
Serverless computing with Google Cloud (2023-24)
wesley chun11 views
STKI Israeli Market Study 2023 corrected forecast 2023_24 v3.pdf by Dr. Jimmy Schwarzkopf
STKI Israeli Market Study 2023   corrected forecast 2023_24 v3.pdfSTKI Israeli Market Study 2023   corrected forecast 2023_24 v3.pdf
STKI Israeli Market Study 2023 corrected forecast 2023_24 v3.pdf
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive by Network Automation Forum
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLiveAutomating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ... by Jasper Oosterveld
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...
Five Things You SHOULD Know About Postman by Postman
Five Things You SHOULD Know About PostmanFive Things You SHOULD Know About Postman
Five Things You SHOULD Know About Postman
Postman33 views
Data Integrity for Banking and Financial Services by Precisely
Data Integrity for Banking and Financial ServicesData Integrity for Banking and Financial Services
Data Integrity for Banking and Financial Services
Precisely21 views
Special_edition_innovator_2023.pdf by WillDavies22
Special_edition_innovator_2023.pdfSpecial_edition_innovator_2023.pdf
Special_edition_innovator_2023.pdf
WillDavies2217 views
Voice Logger - Telephony Integration Solution at Aegis by Nirmal Sharma
Voice Logger - Telephony Integration Solution at AegisVoice Logger - Telephony Integration Solution at Aegis
Voice Logger - Telephony Integration Solution at Aegis
Nirmal Sharma39 views
Future of AR - Facebook Presentation by ssuserb54b561
Future of AR - Facebook PresentationFuture of AR - Facebook Presentation
Future of AR - Facebook Presentation
ssuserb54b56114 views
Powerful Google developer tools for immediate impact! (2023-24) by wesley chun
Powerful Google developer tools for immediate impact! (2023-24)Powerful Google developer tools for immediate impact! (2023-24)
Powerful Google developer tools for immediate impact! (2023-24)
wesley chun10 views
6g - REPORT.pdf by Liveplex
6g - REPORT.pdf6g - REPORT.pdf
6g - REPORT.pdf
Liveplex10 views
SAP Automation Using Bar Code and FIORI.pdf by Virendra Rai, PMP
SAP Automation Using Bar Code and FIORI.pdfSAP Automation Using Bar Code and FIORI.pdf
SAP Automation Using Bar Code and FIORI.pdf
Business Analyst Series 2023 - Week 3 Session 5 by DianaGray10
Business Analyst Series 2023 -  Week 3 Session 5Business Analyst Series 2023 -  Week 3 Session 5
Business Analyst Series 2023 - Week 3 Session 5
DianaGray10248 views

Techniques for Scaling the Netflix API - QCon SF

  • 1. Techniques for Scaling the Netflix API By Daniel Jacobson @daniel_jacobson djacobson@netflix.com QCon SF 2011
  • 2. Techniques for Scaling the Netflix API Agenda • History of the Netflix API • The Cloud • Development and Testing • Resiliency • Future of the Netflix API
  • 3. Techniques for Scaling the Netflix API Agenda • History of the Netflix API • The Cloud • Development and Testing • Resiliency • Future of the Netflix API
  • 5. Netflix API Requests by Audience At Launch In 2008 Netflix Devices Open API Developers
  • 9. Netflix API Requests by Audience At Launch Today Netflix Devices Open API Developers
  • 10. Public API Private API
  • 11. Current Emphasis of Netflix API Netflix Devices
  • 12. Techniques for Scaling the Netflix API Agenda • History of the Netflix API • The Cloud • Development and Testing • Resiliency • Future of the Netflix API
  • 17. Netflix API Powers Discovery
  • 18. Netflix API : Requests Per Month 35 30 25 Requests in Billions 20 15 10 5 -
  • 19. Netflix API : Requests Per Month 35 30 25 Requests in Billions 20 15 10 5 -
  • 27. Techniques for Scaling the Netflix API Agenda • History of the Netflix API • The Cloud • Development and Testing • Resiliency • Future of the Netflix API
  • 28. Development / Testing Philosophy Act fast, react fast
  • 29. That Doesn’t Mean We Don’t Test • Unit tests • Functional tests • Regression scripts • Continuous integration • Capacity planning • Load / Performance tests
  • 30. Development Contiuous Run Unit Tests (Feature & Test) Integration Perform Deploy to Run Functional Integration Staging Env Tests Tests Deploy to Customers
  • 32. API Requests from the Internet Problem! Current Code In Production Single Canary Instance To Test New Code with Production Traffic (typically around 1-5% of traffic)
  • 33. API Requests from the Internet Current Code In Production
  • 34. API Requests from the Internet Current Code New Code In Production Getting Prepared for Production
  • 35. API Requests from the Internet Old Code Current Code Prepared For Rollback In Production
  • 36. API Requests from the Internet Old Code New Code Rolled Back into Production Out of Production
  • 37. API Requests from the Internet Current Code In Production
  • 38. API Requests from the Internet Current Code New Code In Production Getting Prepared for Production
  • 39. API Requests from the Internet Old Code Current Code Prepared For Rollback In Production
  • 40. API Requests from the Internet Current Code In Production
  • 41. Development Continuous Run Unit Tests (Feature & Test) Integration Run Deploy to Run Functional Integration Staging Env Tests Tests Perform Deploy Canary Canary Instance(s) Analysis Deploy to Perform Black Deploy Black Customers Analysis Instances
  • 42. Techniques for Scaling the Netflix API Agenda • History of the Netflix API • The Cloud • Development and Testing • Resiliency • Future of the Netflix API
  • 43. API Personaliz Movie Movie Similar A/B Test ation User Info Reviews Engine Metadata Ratings Movies Engine
  • 44. API Personaliz Movie Movie Similar A/B Test ation User Info Reviews Engine Metadata Ratings Movies Engine
  • 45. API Personaliz Movie Movie Similar A/B Test ation User Info Reviews Engine Metadata Ratings Movies Engine
  • 46. API Personaliz Movie Movie Similar A/B Test ation User Info Reviews Engine Metadata Ratings Movies Engine
  • 49. Call Volume and Health / Last 10 Seconds
  • 50. Call Volume / Last 2 Minutes
  • 52. Successful, But Slower Than Expected
  • 55. Thread Pool & Task Queue Full, Delivering Fallbacks
  • 57. # + # + # + # / (# + # + # + # + #) = Error Rate Error Rate
  • 59. Requests per Second, Over Last 10 Seconds
  • 61. API Personaliz Movie Movie Similar A/B Test ation User Info Reviews Engine Metadata Ratings Movies Engine
  • 62. API Personaliz Movie Movie Similar A/B Test ation User Info Reviews Engine Metadata Ratings Movies Engine
  • 63. API Personaliz Movie Movie Similar A/B Test ation User Info Reviews Engine Metadata Ratings Movies Engine
  • 64. API Fallback Personaliz Movie Movie Similar A/B Test ation User Info Reviews Engine Metadata Ratings Movies Engine
  • 65. API Fallback Personaliz Movie Movie Similar A/B Test ation User Info Reviews Engine Metadata Ratings Movies Engine
  • 66. Techniques for Scaling the Netflix API Agenda • History of the Netflix API • The Cloud • Development and Testing • Resiliency • Future of the Netflix API
  • 68. Netflix API Requests by Audience Supporting Streaming Devices Today Netflix Devices Open API Developers
  • 71. Netflix API : Requests Per Month 35 30 25 Requests in Billions 20 15 10 5 -
  • 72. Growth of the Netflix API Over 30 Billion requests per month (Peaks at about 20,000 requests per second)
  • 74. <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>
  • 75. {"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"} }}
  • 76. Improve Efficiency of API Requests Could it have been 5 billion requests per month? Or less? (Assuming everything else remained the same)
  • 77. Netflix API : Requests Per Month 35 30 25 Request in Billions 20 15 10 5 0
  • 78. Netflix API : Requests Per Month 35 30 25 Request in Billions 20 15 10 5 0
  • 79. API Billionaires Club 13 billion API calls / day (May 2011) Over 260 billion objects stored in S3 (January 2011) 5 billion API calls / day (April 2010) 5 billion API calls / day (October 2009) 1 billion API calls / day (October 2011) 8 billion API calls / month (Q3 2009) 3.2 billion API-delivered stories / month (October 2011) 3 billion API calls / month (March 2009) Courtesy of John Musser, ProgrammableWeb
  • 80. API Billionaires Club 13 billion API calls / day (May 2011) Over 260 billion objects stored in S3 (January 2011) 5 billion API calls / day (April 2010) 5 billion API calls / day (October 2009) 1 billion API calls / day (October 2011) 8 billion API calls / month (Q3 2009) 3.2 billion API-delivered stories / month (October 2011) 3 billion API calls / month (March 2009) Courtesy of John Musser, ProgrammableWeb
  • 81. Two Major Objective for API Redesign • Improve performance for devices – Minimize network traffic (one API call, if possible) – Only deliver bytes that are needed • Improve ability for device teams to rapidly innovate – Customized request/response patterns per device – Deployment is independent from API schedules
  • 82. Current Client / Server Interaction CLIENT APPS API SERVER AUTH SETUP TIME QUEUE LISTS LIST ( i ) TITLES
  • 83. Future Client / Server Interaction CLIENT APPS API SERVER CUSTOM SCRIPTING TIER GENERIC API
  • 84. Custom Scripting Tier Interaction CLIENT APPS API SERVER AUTH CUSTOM SCRIPTING SETUP TIER TIME PS3 HOME QUEUE SCREEN CUSTOM LISTS ENDPOINT LIST ( i ) Owned and operated by the UI teams TITLES
  • 88. For More Titles From a List
  • 90. Generic API Interaction CLIENT APP API SERVER AUTH GENERIC CONFIG SCRIPT TIME SIMPLE QUEUE CATALOG REQUEST TO API LISTS LIST ( i ) Owned and operated by the API team TITLES
  • 91. Technologies AUTH CONFIG TIME GROOVY SIMPLE CLIENT COMPILED CATALOG JAVAQUEUE REQUEST LANGUAGE INTO TO API LOLOMO LISTS JVM LIST ( i ) TITLES
  • 92. API Production Servers Cassandra Cluster UI Engineers
  • 93. Active 1 2 3 4 5 SCRIPT REPOSITORY 6 (DYNAMIC DEPLOYMENT) API SERVER APPLICATION CODE (REQUIRES API CODE PUSHES)
  • 94. Active 1 2 3 4 5 SCRIPT REPOSITORY 6 (DYNAMIC 7 DEPLOYMENT) API SERVER APPLICATION CODE (REQUIRES API CODE PUSHES)
  • 95. 1 2 3 4 Active 5 SCRIPT REPOSITORY 6 (DYNAMIC 7 DEPLOYMENT) API SERVER APPLICATION CODE (REQUIRES API CODE PUSHES)
  • 98. If you are interested in helping us solve these problems, please contact me at: Daniel Jacobson djacobson@netflix.com @daniel_jacobson http://www.linkedin.com/in/danieljacobson http://www.slideshare.net/danieljacobson

Editor's Notes

  1. When the Netflix API launched three years ago, it was to “let 1,000 flowers bloom”. Today, that API still exists with almost 23,000 flowers.
  2. At that time, it was exclusively a public API.
  3. Some of the apps developed by the 1,000 flowers.
  4. Then streaming started taking off for Netflix, first with computer-based streaming… At that time, it was still experimental and did not draw from the API.
  5. But over time, as we added more devices, they started drawing their metadata from the API. Today, almost all of our devices are powered by the API.
  6. As a result, today’s consumption is almost entirely from private APIs that service the devices. The Netflix devices account for 99.7% of the API traffic while the public API represents only about .3%.
  7. The Netflix API represents the iceberg model for APIs. That is, public APIs represent a relatively small percentage of the value for the company, but they are typically the most visible part of the API program. They equate to the small part of the iceberg that is above water, in open sight. Conversely, the private APIs that drive web sites, mobile phones, device implementations, etc. account for the vast majority of the value for many companies, although people outside of the company often are not aware of them. These APIs equate to the large, hard to see mass of ice underwater. In the API space, most companies get attracted to the tip of the iceberg because that is what they are aware of. As a result, many companies seek to pursue a public API program. Over time, however, after more inspection into the value propositions of APIs, it becomes clear to many that the greatest value is in the private APIs.
  8. As a result, the current emphasis for the Netflix API is on the majority case… supporting the Netflix
  9. There are basically two types of interactions between Netflix customers and our streaming application… Discovery and Streaming.
  10. Discovery is basically any event with a title other than streaming it. That includes browsing titles, looking for something watch, etc.
  11. It also includes actions such as rating the title, adding it to your instant queue, etc.
  12. Once the customer has identified a title to watch through the Discovery experience, the user can then play that title. Once the Play button is selected, the customer is sent to a different internal service that focuses on handling the streaming. That streaming service also interacts with our CDNs to actually deliver the streaming bits to the device for playback.
  13. The API powers the Discovery experience. The rest of these slides will only focus on Discovery, not Streaming.
  14. As Discovery events grow, so does the growth of the Netflix API. Discovery continues to grow for a variety of reasons, including more devices, more customers, richer UI experiences, etc.
  15. As API traffic grows, so do the infrastructural needs. The more requests, the more servers we need, the more time spent supporting those servers, the higher the costs associated with this support, etc.
  16. And our international expansion will only add complexity and more scaling issues.
  17. The traditional model is to have systems administrators go into server rooms like this one to build out new servers, etc.
  18. Rather than relying on data centers, we have moved everything to the cloud! Enables rapid scaling with relative ease. Adding new servers, in new locations, take minutes. And this is critical when the service needs to grow from 1B requests a month to 1B requests a day in a year.
  19. Instead of going into server rooms, we go into a web page like this one. Within minutes, we can spin up new servers to support growing demands.
  20. Throughautoscaling in the cloud, we can also dynamically grow our server farm in concert with the traffic that we receive.
  21. So, instead of buying new servers based on projected spikes in traffic and having systems administrators add them to the farm, the cloud can dynamically and automatically add and remove servers based on need.
  22. And as we continue to expand internationally, we can easily scale up in new regions, closer to the customer base that we are trying to serve, as long as Amazon has a location near there.
  23. As a general practice, Netflix focuses on getting code into production as quickly as possible to expose features to new audiences.
  24. That said, we do spend a lot of time testing. We have just adopted some new techniques to help us learn more about what the new code will look like in production.
  25. Prior to these new changes, our flow looked something like this…
  26. That flow has changed with the addition of new techniques, such as canary deployments and what we call red/black deployments.
  27. The canary deployments are comparable to canaries in coal mines. We have many servers in production running the current codebase. We will then introduce a single (or perhaps a few) new servers into production running new code. Monitoring the canary servers will show what the new code will look like in production.
  28. If the canary shows errors, we pull it/them down, re-evaluate the new code, debug it, etc. We will then repeat the process until the analysis of canary servers look good.
  29. If the new code looks good in the canary, we can then use a technique that we call Red/Black Deployments to launch the code. Start with Red, where production code is running. Fire up a new set of servers (Black) equal to the count in Red with the new code.
  30. Then switch the pointer to have external requests draw from the Black servers.
  31. If a problem is encountered from the Black servers, it is easy to rollback quickly by switching the pointer back to Red. We will then re-evaluate the new code, debug it, etc.
  32. Once we have debugged the code, we will put another canary up to evaluate the new changes in production.
  33. If the new code looks good in the canary, we can then bring up another set of servers with the new code.
  34. Then we will switch production traffic to the new code.
  35. Then switch the pointer to have external requests draw from the Black servers. If everything still looks good, we disable the Red servers and the new code becomes the new red servers.
  36. So, the development and testing flow now looks more like this…
  37. At Netflix, we have a range of engineering teams who focus on specific problem sets. Some teams focus on creating rich presentation layers on various devices. Others focus on metadata and algorithms. For the streaming application to work, the metadata from the services needs to make it to the devices. That is where the API comes in. The API essentially acts as a broken, moving the metadata from inside the Netflix system to the devices.
  38. Given the position of the API within the overall system, the API depends on a large number of underlying systems (only some of which are represented here). Moreover, a large number of devices depend on the API (only some of which are represented here). Sometimes, one of these underlying systems experiences an outage.
  39. In the past, such an outage could result in an outage in the API.
  40. And if that outage cascades to the API, it is likely to have some kind of substantive impact on the devices. The challenge for the API team is to be resilient against dependency outages, to ultimately insulate Netflix customers from low level system problems.
  41. To achieve this, we implemented a series of circuit breakers for each library that we depend on. Each circuit breaker controls the interaction between the API and that dependency. This image is a view of the dependency monitor that allows us to view the health and activity of each dependency. This dashboard is designed to give a real-time view of what is happening with these dependencies (over the last two minutes). We have other dashboards that provide insight into longer-term trends, day-over-day views, etc.
  42. This is a view of asingle circuit.
  43. This circle represents the call volume and health of the dependency over the last 10 seconds. This circle is meant to be a visual indicator for health. The circle is green for healthy, yellow for borderline, and red for unhealthy. Moreover, the size of the circle represents the call volumes, where bigger circles mean more traffic.
  44. The blue line represents the traffic trends over the last two minutes for this dependency.
  45. The green number shows the number of successful calls to this dependency over the last two minutes.
  46. The yellow number shows the number of latent calls into the dependency. These calls ultimately return successful responses, but slower than expected.
  47. The blue number shows the number of calls that were handled by the short-circuited fallback mechanisms. That is, if the circuit gets tripped, the blue number will start to go up.
  48. The orange number shows the number of calls that have timed out, resulting in fallback responses.
  49. The purple number shows the number of calls that fail due to queuing issues, resulting in fallback responses.
  50. The red number shows the number of exceptions, resulting in fallback responses.
  51. The error rate is calculated from the total number of error and fallback responses divided by the total number calls handled.
  52. If the error rate exceeds a certain number, the circuit to the fallback scenario is automatically opened. When it returns below that threshold, the circuit is closed again.
  53. The dashboard also shows host and cluster information for the dependency.
  54. As well as information about our SLAs.
  55. So, going back to the engineering diagram…
  56. If that same service fails today…
  57. We simply disconnect from that service.
  58. And replace it with an appropriate fallback.
  59. Keeping our customers happy, even if the experience may be slightly degraded. It is important to note that different dependency libraries have different fallback scenarios. And some are more resilient than others. But the overall sentiment here is accurate at a high level.
  60. As discussed earlier, the API was originally built for the 1,000 flowers. Accordingly, today’s API design is very much grounded in the same principles for that same audience.
  61. But the audience of the API today is dramatically different.
  62. With the emphasis of the API program being on the large mass underwater – the private API.
  63. As a result, the current API is no longer the right tool for the job. We need a new API, designed for the present and the future. The following slides talk more about the redesign of the Netflix API to better meet the needs of the key audiences.
  64. We already talked about the tremendous growth in API requests…
  65. Metrics like 30B requests per month sound great, don’t they? The reality is that this number is concerning…
  66. For web sites, like NPR, where page views create ad impressions and ad impressions generate revenue, 30B requests would be amazing.
  67. But for systems that yield output that looks like this...
  68. Or this… Ad impressions are not part of the game. As a result, the increase in requests don’t translate into more revenue. In fact, they translate into more expenses. That is, to handle more requests requires more servers, more systems-admins, a potentially different application architecture, etc.
  69. We are challenging ourselves to redesign the API to see if those same 30B requests could have been 5 billion or perhaps even less. Through more targeted API designs based on what we have learned through our metrics, we will be able to reduce our API traffic as Netflix’ overall traffic grows.
  70. Given the same growth charts in the API, it would be great to imagine the traffic patterns being the blue bars instead of the red ones (assuming the customer usage and user experiences remain the same).
  71. Similarly, with lower traffic levels for the same user experience, server and administration complexity and costs go down as well.
  72. To state the goal another way, John Musser maintains a list of the API Billionaires. Netflix has a pretty lofty position in that club.
  73. We aspire to no longer be in that exclusive company. That is one of the things the redesign strives for.
  74. Today, the devices call back to the API in a mostly synchronous way to retrieve granular metadata needed to start up the client UI. That model requires a large number of network transactions which are the most expensive part of the overall interaction.
  75. We want to break the interaction model into two types of interactions. Custom calls and generic calls.
  76. For highly complex or critical interfaces, we want the device to make a single call to the API to a custom endpoint. Behind that endpoint will be a script that the UI teams maintain. That script is the traffic cop for gathering and formatting the metadata needed for that UI. The script will call to backend services to get metadata, but in this model, much of this will be concurrent and progressively rendered to the devices.
  77. One way to think of it is to imagine a full grid of movies/TV shows as part of a Netflix UI. The red box represents the viewable area of the grid when the screen loads. In today’s REST-ful resource model, the device needs to make calls for the individual lists, then populate the individual titles with distinct calls for each title. Granted, in today’s model, the are some asynchronous calls and some of them are also performed in bulk. But this still demonstrates the chatty nature of this REST-ful API design.
  78. Alternatively, we believe that the custom script could easily return the desiredviewables for each list in one payload much more efficiently.
  79. Moreover, this model can return any payload, filling out any portions of the grid structure, in that single response. Now, we are not likely going to want to populate a grid in this way, but it is possible given the highly customizable nature of this model.
  80. But once we populate the complex start-up screens through the custom scripting tier, the interactions become much more predictable and device-agnostic. If you want to extend the movies in a given row, you don’t need a custom script. That is why we are exposing the Generic API as well.
  81. To populate the grid with more titles for more rows, it is a simple call to get more titles.
  82. The call pattern looks like this for the Generic API. Notice, there is no need for some of the session-start requests when using the Generic API.
  83. For this model, the technology stack is pretty simple. The client apps have their own languages designed for that particular device. The overall API server codebase is Java. And the custom scripts will be written in Groovy and compiled into the same JVM as the backend API code. This should help with overall performance and library sharing for more complex scripting operations.
  84. To publish new scripts to the system, UI engineers will publish the script to Perforce for code management. Then it will be pushed up to a Cassandra cluster in AWS, which acts as a script repository and management system. Every 30 seconds or so, a job will scan the Cassandra cluster looking for new scripts. For all new scripts, they will be pushed to the full farm of API servers to be compiled into the JVM.
  85. From the device perspective, there could be many scripts for a given endpoint, only one of which is active at a given time. In this case, the iPad is running off of script #2.
  86. New scripts can be dynamically added at any time by any team (most often by the UI engineers). The new script (script 7) will arrive in an inactive state. At that time, the script can be tested from a production server before running the device off of it.
  87. When the script looks good and is ready to go live, a configuration change is made and script 7 becomes active immediately across the full server farm.
  88. All of these changes in our redesign effort are designed to help the apps and the UI engineers run faster.
  89. And achieving those goals will help us keep our customers happy.