Netflix APITo Infinity and Beyond…
Growth of the Netflix APIOver 10 BILLION requests in November(Peaks at about 10,000 requests per second)
It is time to get back to thinking about the future…
First Step: Back to the Drawing Board…
Some of our Key GoalsResiliency, Reliability and StabilityMaximize uptimeScalabilitySystem can grow without needing frequent refactoringSimplicityEasier integration for API consumersAgilityArchitecture will support rapid development without compromising the core of the system
WiiiPad AppPS3iPhoneAppNetflix APIApple TVGoogle TVTiVoRokuXBox
Future Architecture needs to support key audience first with a trickle down of features to the public audienceWiiRokuPS3iPhoneAppiPad AppGoogle TVNetflix APIApple TVXBoxTiVo
Hide Our Internal Business Dependencies from API Consumers
(Some) API Interfaces and Their DependenciesAuto-CompleteRental HistoryAggListsSimilarsLIstsQueuesSEARCHSIMILARS SYSTEMRECOMMENDATION ENGINEQUEUERENTAL HISTORYTitle DetailsPreviewsRatingsRecommendationsTitle StatesCINEMATCHCONTENT MANAGEMENT SYSTEMTITLE STATESREST InterfaceAPI Dependency
INTERNET REQUESTUNIFIED LIST/TITLE RESPONSEWITH PARTIAL RESPONSE BUILT INSIMILARSLISTSEARCHLISTRENTAL HISTORYLISTTITLE LISTQUEUELISTAUTOCOMPLETELISTETC…TITLE INFORMATIONTITLESTATERATINGRECOMMENDATIONTITLE DETAILS
iPhone WrapperRecommend-ationRecommend-ation ServiceXbox WrapperRatings ServiceSHAREDAPIINTER-FACESLIST APIRatingsWii WrapperPS3 WrapperTITLE APIRental HistoryRental History ServiceRoku WrapperUSER APIUser AccountiPad WrapperNormal-izationAnd ResiiencyAppleTV WrapperQueueAUTHAPIPC / Mac WrapperTitle CatalogTiVo WrapperSource Data LayerAPI Repository LayerWeb Service LayerShared LayerWrapper LayerAPI LayerApp Layer
iPhone WrapperRecommend-ationRecommend-ation ServiceXbox WrapperRatings ServiceSHAREDAPIINTER-FACESLIST APIRatingsWii WrapperTHESE ARE SOME OF THE DATA SOURCES THAT PROVIDE CONTENT TO THE APIPS3 WrapperTITLE APIRental HistoryRental History ServiceRoku WrapperUSER APIUser AccountiPad WrapperNormal-izationAnd ResiiencyAppleTV WrapperQueueAUTHAPIPC / Mac WrapperTitle CatalogTiVo WrapperSource Data LayerAPI Repository LayerWeb Service LayerShared LayerWrapper LayerAPI LayerApp Layer
iPhone WrapperRecommend-ationRecommend-ation ServiceXbox WrapperRatings ServiceSHAREDAPIINTER-FACESLIST APIRatingsWii WrapperTHESE ARE SOME OF THE  SERVICES PROVIDED BY SOME OF THE API DEPENDENCIES THROUGH WHICH CONTENT IS MADE AVAILABLE TO THE APIPS3 WrapperTITLE APIRental HistoryRental History ServiceRoku WrapperUSER APIUser AccountiPad WrapperNormal-izationAnd ResiiencyAppleTV WrapperQueueAUTHAPIPC / Mac WrapperTitle CatalogTiVo WrapperSource Data LayerAPI Repository LayerWeb Service LayerShared LayerWrapper LayerAPI LayerApp Layer
iPhone WrapperRecommend-ationRecommend-ation ServiceXbox WrapperRatings ServiceSHAREDAPIINTER-FACESLIST APIRatingsWii WrapperTHIS IS THE LAYER WHERE THE API CAN NORMALIZE THE DATA TO PREPARE IT FOR CONSUMPTION BY API CLIENTS.  IT COULD ALSO BE WHERE THE API CAN APPLY RESILIENCY MEASURES TO PROTECT AGAINST FAILURES FROM THE API DEPENDENCIES.ALTHOUGH THE DIAGRAM REPRESENTS THIS AS A DISCRETE API LAYER, IT COULD JUST AS EASILY BE A DISTRIBUTED MODEL ACROSS THE DEPENDENCIES.PS3 WrapperTITLE APIRental HistoryRental History ServiceRoku WrapperUSER APIUser AccountiPad WrapperNormal-izationAnd ResiiencyAppleTV WrapperQueueAUTHAPIPC / Mac WrapperTitle CatalogTiVo WrapperSource Data LayerAPI Repository LayerWeb Service LayerShared LayerWrapper LayerAPI LayerApp Layer
iPhone WrapperRecommend-ationRecommend-ation ServiceXbox WrapperRatings ServiceSHAREDAPIINTER-FACESLIST APIRatingsWii WrapperMAKING PURE APIs WILL IMPROVE THE CONSISTENCY OF THE API CODE AND THOSE THAT CONSUME IT. THIS WOULD HELP PRODUCT MANAGERS AS WELL SINCE THE CODE FOR THEIR PRODUCTS CAN ALSO BECOME MORE UNIFORM.PS3 WrapperTITLE APIRental HistoryRental History ServiceRoku WrapperUSER APIUser AccountiPad WrapperNormal-izationAnd ResiiencyAppleTV WrapperQueueAUTHAPIPC / Mac WrapperTitle CatalogTiVo WrapperSource Data LayerAPI Repository LayerWeb Service LayerShared LayerWrapper LayerAPI LayerApp Layer
iPhone WrapperRecommend-ationRecommend-ation ServiceXbox WrapperRatings ServiceSHAREDAPIINTER-FACESLIST APIRatingsWii WrapperTHE SHARED API INTERFACE LAYER ALLOWS THE VARIOUS CLIENTS TO MERGE RESULTS FROM THE PURE APIs AND PREPARE THEM IN WAYS THAT ARE CONDUCIVE TO THE GOALS OF THEIR APP.  MEANWHILE, ANY OF THESE INTERFACES CAN BE SHARED ACROSS THE CLIENTS SINCE MANY OF THESE INTERFACES WILL BE COMMON ACROSS THE PLATFORMS.PS3 WrapperTITLE APIRental HistoryRental History ServiceRoku WrapperUSER APIUser AccountiPad WrapperNormal-izationAnd ResiiencyAppleTV WrapperQueueAUTHAPIPC / Mac WrapperTitle CatalogTiVo WrapperSource Data LayerAPI Repository LayerWeb Service LayerShared LayerWrapper LayerAPI LayerApp Layer
iPhone WrapperRecommend-ationRecommend-ation ServiceXbox WrapperRatings ServiceSHAREDAPIINTER-FACESLIST APIRatingsWii WrapperTHE WRAPPER LAYER IS DESIGNED TO CONSUME THE PURE APIS AND/OR THE SHARED INTERFACES WHILE ALLOWING DEVICE/APP-SPECIFIC IMPLEMENTATIONS.  SOME OF THESE WRAPPERS ARE THEORETICAL WHILE OTHERS MAY ACTUALLY TAKE ADVANTAGE OF THIS TIER.PS3 WrapperTITLE APIRental HistoryRental History ServiceRoku WrapperUSER APIUser AccountiPad WrapperNormal-izationAnd ResiiencyAppleTV WrapperQueueAUTHAPIPC / Mac WrapperTitle CatalogTiVo WrapperSource Data LayerAPI Repository LayerWeb Service LayerShared LayerWrapper LayerAPI LayerApp Layer
iPhone WrapperRecommend-ationRecommend-ation ServiceXbox WrapperRatings ServiceSHAREDAPIINTER-FACESLIST APIRatingsWii WrapperTHESE ARE SOME OF THE ACTUAL INTERNAL API CUSTOMERS TODAY.  THIS LIST WILL GROW OVER TIME, BUT THIS ARCHITECTURE WILL SCALE ACCORDINGLY.PS3 WrapperTITLE APIRental HistoryRental History ServiceRoku WrapperUSER APIUser AccountiPad WrapperNormal-izationAnd ResiiencyAppleTV WrapperQueueAUTHAPIPC / Mac WrapperTitle CatalogTiVo WrapperSource Data LayerAPI Repository LayerWeb Service LayerShared LayerWrapper LayerAPI LayerApp Layer
Flexible API RequestsAs flexible as SQLSELECT person_first_name, person_last_name, dept_nameFROM person, department WHERE UPPER(dept_name) LIKE ‘%Engineering%’AND person_added_date BETWEEN ‘2002-01-01’ AND sysdateORDER BY person_last_name ASCManages Partial ResponseDetermines the Selected APIRestricts OutputSorts ResultsGOAL: API should be able to handle any request that you can do in SQL
The Problem with Versioning1.01.52.03.0?4.0?5.0?Today
Maybe we don’t need versioning?1.01.52.0Future APIsToday
Branching can always be done later…1.01.52.0New APIToday
XML vs. JSON?Or both?  Or other?xml
REST…as long as it makes sense for the business
Questions?API ManagementEngineering Manager – Web API Systems: http://bit.ly/9O3HicAPI Integration Systems Analyst: http://bit.ly/hyPxChAPI EngineeringSenior Software Engineer/Architect – Web API Platform: http://bit.ly/e0AKw4API Test EngineeringSenior Software Engineer in Test – API: http://bit.ly/9zHPtJSenior Software Engineer in Test – API Platform: http://bit.ly/eD3tLnLead Software Engineer in Test – API: http://bit.ly/fqxBYCSocial EngineeringSocial Systems – Engineer Architect: http://bit.ly/dYq6C8

The future-of-netflix-api

  • 1.
  • 2.
    Growth of theNetflix APIOver 10 BILLION requests in November(Peaks at about 10,000 requests per second)
  • 6.
    It is timeto get back to thinking about the future…
  • 7.
    First Step: Backto the Drawing Board…
  • 8.
    Some of ourKey GoalsResiliency, Reliability and StabilityMaximize uptimeScalabilitySystem can grow without needing frequent refactoringSimplicityEasier integration for API consumersAgilityArchitecture will support rapid development without compromising the core of the system
  • 10.
  • 11.
    Future Architecture needsto support key audience first with a trickle down of features to the public audienceWiiRokuPS3iPhoneAppiPad AppGoogle TVNetflix APIApple TVXBoxTiVo
  • 12.
    Hide Our InternalBusiness Dependencies from API Consumers
  • 13.
    (Some) API Interfacesand Their DependenciesAuto-CompleteRental HistoryAggListsSimilarsLIstsQueuesSEARCHSIMILARS SYSTEMRECOMMENDATION ENGINEQUEUERENTAL HISTORYTitle DetailsPreviewsRatingsRecommendationsTitle StatesCINEMATCHCONTENT MANAGEMENT SYSTEMTITLE STATESREST InterfaceAPI Dependency
  • 14.
    INTERNET REQUESTUNIFIED LIST/TITLERESPONSEWITH PARTIAL RESPONSE BUILT INSIMILARSLISTSEARCHLISTRENTAL HISTORYLISTTITLE LISTQUEUELISTAUTOCOMPLETELISTETC…TITLE INFORMATIONTITLESTATERATINGRECOMMENDATIONTITLE DETAILS
  • 15.
    iPhone WrapperRecommend-ationRecommend-ation ServiceXboxWrapperRatings ServiceSHAREDAPIINTER-FACESLIST APIRatingsWii WrapperPS3 WrapperTITLE APIRental HistoryRental History ServiceRoku WrapperUSER APIUser AccountiPad WrapperNormal-izationAnd ResiiencyAppleTV WrapperQueueAUTHAPIPC / Mac WrapperTitle CatalogTiVo WrapperSource Data LayerAPI Repository LayerWeb Service LayerShared LayerWrapper LayerAPI LayerApp Layer
  • 16.
    iPhone WrapperRecommend-ationRecommend-ation ServiceXboxWrapperRatings ServiceSHAREDAPIINTER-FACESLIST APIRatingsWii WrapperTHESE ARE SOME OF THE DATA SOURCES THAT PROVIDE CONTENT TO THE APIPS3 WrapperTITLE APIRental HistoryRental History ServiceRoku WrapperUSER APIUser AccountiPad WrapperNormal-izationAnd ResiiencyAppleTV WrapperQueueAUTHAPIPC / Mac WrapperTitle CatalogTiVo WrapperSource Data LayerAPI Repository LayerWeb Service LayerShared LayerWrapper LayerAPI LayerApp Layer
  • 17.
    iPhone WrapperRecommend-ationRecommend-ation ServiceXboxWrapperRatings ServiceSHAREDAPIINTER-FACESLIST APIRatingsWii WrapperTHESE ARE SOME OF THE SERVICES PROVIDED BY SOME OF THE API DEPENDENCIES THROUGH WHICH CONTENT IS MADE AVAILABLE TO THE APIPS3 WrapperTITLE APIRental HistoryRental History ServiceRoku WrapperUSER APIUser AccountiPad WrapperNormal-izationAnd ResiiencyAppleTV WrapperQueueAUTHAPIPC / Mac WrapperTitle CatalogTiVo WrapperSource Data LayerAPI Repository LayerWeb Service LayerShared LayerWrapper LayerAPI LayerApp Layer
  • 18.
    iPhone WrapperRecommend-ationRecommend-ation ServiceXboxWrapperRatings ServiceSHAREDAPIINTER-FACESLIST APIRatingsWii WrapperTHIS IS THE LAYER WHERE THE API CAN NORMALIZE THE DATA TO PREPARE IT FOR CONSUMPTION BY API CLIENTS. IT COULD ALSO BE WHERE THE API CAN APPLY RESILIENCY MEASURES TO PROTECT AGAINST FAILURES FROM THE API DEPENDENCIES.ALTHOUGH THE DIAGRAM REPRESENTS THIS AS A DISCRETE API LAYER, IT COULD JUST AS EASILY BE A DISTRIBUTED MODEL ACROSS THE DEPENDENCIES.PS3 WrapperTITLE APIRental HistoryRental History ServiceRoku WrapperUSER APIUser AccountiPad WrapperNormal-izationAnd ResiiencyAppleTV WrapperQueueAUTHAPIPC / Mac WrapperTitle CatalogTiVo WrapperSource Data LayerAPI Repository LayerWeb Service LayerShared LayerWrapper LayerAPI LayerApp Layer
  • 19.
    iPhone WrapperRecommend-ationRecommend-ation ServiceXboxWrapperRatings ServiceSHAREDAPIINTER-FACESLIST APIRatingsWii WrapperMAKING PURE APIs WILL IMPROVE THE CONSISTENCY OF THE API CODE AND THOSE THAT CONSUME IT. THIS WOULD HELP PRODUCT MANAGERS AS WELL SINCE THE CODE FOR THEIR PRODUCTS CAN ALSO BECOME MORE UNIFORM.PS3 WrapperTITLE APIRental HistoryRental History ServiceRoku WrapperUSER APIUser AccountiPad WrapperNormal-izationAnd ResiiencyAppleTV WrapperQueueAUTHAPIPC / Mac WrapperTitle CatalogTiVo WrapperSource Data LayerAPI Repository LayerWeb Service LayerShared LayerWrapper LayerAPI LayerApp Layer
  • 20.
    iPhone WrapperRecommend-ationRecommend-ation ServiceXboxWrapperRatings ServiceSHAREDAPIINTER-FACESLIST APIRatingsWii WrapperTHE SHARED API INTERFACE LAYER ALLOWS THE VARIOUS CLIENTS TO MERGE RESULTS FROM THE PURE APIs AND PREPARE THEM IN WAYS THAT ARE CONDUCIVE TO THE GOALS OF THEIR APP. MEANWHILE, ANY OF THESE INTERFACES CAN BE SHARED ACROSS THE CLIENTS SINCE MANY OF THESE INTERFACES WILL BE COMMON ACROSS THE PLATFORMS.PS3 WrapperTITLE APIRental HistoryRental History ServiceRoku WrapperUSER APIUser AccountiPad WrapperNormal-izationAnd ResiiencyAppleTV WrapperQueueAUTHAPIPC / Mac WrapperTitle CatalogTiVo WrapperSource Data LayerAPI Repository LayerWeb Service LayerShared LayerWrapper LayerAPI LayerApp Layer
  • 21.
    iPhone WrapperRecommend-ationRecommend-ation ServiceXboxWrapperRatings ServiceSHAREDAPIINTER-FACESLIST APIRatingsWii WrapperTHE WRAPPER LAYER IS DESIGNED TO CONSUME THE PURE APIS AND/OR THE SHARED INTERFACES WHILE ALLOWING DEVICE/APP-SPECIFIC IMPLEMENTATIONS. SOME OF THESE WRAPPERS ARE THEORETICAL WHILE OTHERS MAY ACTUALLY TAKE ADVANTAGE OF THIS TIER.PS3 WrapperTITLE APIRental HistoryRental History ServiceRoku WrapperUSER APIUser AccountiPad WrapperNormal-izationAnd ResiiencyAppleTV WrapperQueueAUTHAPIPC / Mac WrapperTitle CatalogTiVo WrapperSource Data LayerAPI Repository LayerWeb Service LayerShared LayerWrapper LayerAPI LayerApp Layer
  • 22.
    iPhone WrapperRecommend-ationRecommend-ation ServiceXboxWrapperRatings ServiceSHAREDAPIINTER-FACESLIST APIRatingsWii WrapperTHESE ARE SOME OF THE ACTUAL INTERNAL API CUSTOMERS TODAY. THIS LIST WILL GROW OVER TIME, BUT THIS ARCHITECTURE WILL SCALE ACCORDINGLY.PS3 WrapperTITLE APIRental HistoryRental History ServiceRoku WrapperUSER APIUser AccountiPad WrapperNormal-izationAnd ResiiencyAppleTV WrapperQueueAUTHAPIPC / Mac WrapperTitle CatalogTiVo WrapperSource Data LayerAPI Repository LayerWeb Service LayerShared LayerWrapper LayerAPI LayerApp Layer
  • 23.
    Flexible API RequestsAsflexible as SQLSELECT person_first_name, person_last_name, dept_nameFROM person, department WHERE UPPER(dept_name) LIKE ‘%Engineering%’AND person_added_date BETWEEN ‘2002-01-01’ AND sysdateORDER BY person_last_name ASCManages Partial ResponseDetermines the Selected APIRestricts OutputSorts ResultsGOAL: API should be able to handle any request that you can do in SQL
  • 24.
    The Problem withVersioning1.01.52.03.0?4.0?5.0?Today
  • 25.
    Maybe we don’tneed versioning?1.01.52.0Future APIsToday
  • 26.
    Branching can alwaysbe done later…1.01.52.0New APIToday
  • 27.
    XML vs. JSON?Orboth? Or other?xml
  • 28.
    REST…as long asit makes sense for the business
  • 29.
    Questions?API ManagementEngineering Manager– Web API Systems: http://bit.ly/9O3HicAPI Integration Systems Analyst: http://bit.ly/hyPxChAPI EngineeringSenior Software Engineer/Architect – Web API Platform: http://bit.ly/e0AKw4API Test EngineeringSenior Software Engineer in Test – API: http://bit.ly/9zHPtJSenior Software Engineer in Test – API Platform: http://bit.ly/eD3tLnLead Software Engineer in Test – API: http://bit.ly/fqxBYCSocial EngineeringSocial Systems – Engineer Architect: http://bit.ly/dYq6C8

Editor's Notes

  • #3 Despite these major changes, the API has still been able to achieve the goals of the company to the point that it is now serving roughly ? billion requests per month.
  • #4 Over the last two years, the API has seen a ton of changes. Some tactical, some fundamental.
  • #5 All under great time constraints and pressure to propel the business forward.