The future-of-netflix-api

29
Netflix API To Infinity and Beyond…

description

This presentation demonstrates the great successes of the Netflix API to date. After some introspection, however, there is an opportunity to better prepare the API for the future. This presentation also offers a few ideas on how the Netflix API architecture may change over time.

Transcript of The future-of-netflix-api

Page 1: The future-of-netflix-api

Netflix API

To Infinity and Beyond…

Page 2: The future-of-netflix-api

Growth of the Netflix API

Over 10 BILLION requests in November(Peaks at about 10,000 requests per second)

Page 3: The future-of-netflix-api
Page 4: The future-of-netflix-api
Page 5: The future-of-netflix-api
Page 6: The future-of-netflix-api

It is time to get back to thinking about the future…

Page 7: The future-of-netflix-api

First Step: Back to the Drawing Board…

Page 8: The future-of-netflix-api

Some of our Key Goals

• Resiliency, Reliability and Stability– Maximize uptime

• Scalability– System can grow without needing frequent refactoring

• Simplicity– Easier integration for API consumers

• Agility– Architecture will support rapid development without

compromising the core of the system

Page 9: The future-of-netflix-api
Page 10: The future-of-netflix-api

Netflix API

XBox

PS3

Wii

Google TV

Apple TV

iPad App

iPhoneApp

Roku

TiVo

Page 11: The future-of-netflix-api

Netflix API XBox

PS3

Wii

Google TV

Apple TV

iPad App

iPhoneApp

Roku

TiVo

Future Architecture needs to support key audience first with a trickle down of features to the public audience

Page 12: The future-of-netflix-api

Hide Our Internal Business Dependencies from API Consumers

Page 13: The future-of-netflix-api

(Some) API Interfaces and Their DependenciesAuto-

Complete Similars QueuesLIstsRental History

Agg Lists

SEARCH SIMILARS SYSTEM

RECOMMENDATION ENGINE QUEUERENTAL

HISTORY

REST Interface API Dependency

Title Details Previews Ratings RecommendationsTitle

States

CONTENT MANAGEMENT

SYSTEMTITLE STATES CINEMATCH

Page 14: The future-of-netflix-api

TITLESTATE

SIMILARSLIST

SEARCHLIST

RENTAL HISTORY

LIST

RATINGRECOMMENDATIONTITLE DETAILS

TITLE LIST

QUEUELIST

AUTOCOMPLETE

LISTETC…

TITLE INFORMATION

UNIFIED LIST/TITLE RESPONSEWITH PARTIAL RESPONSE BUILT IN

INTERNET REQUEST

Page 15: The future-of-netflix-api

Recommend-ation

Ratings

Rental History

User Account

Title Catalog

Queue Normal-ization

And Resiiency

Ratings Service

Recommend-ation

Service

Rental History Service

LIST API

USER API

TITLE API

AUTHAPI

iPhone Wrapper

Wii Wrapper

Xbox Wrapper

PS3 Wrapper

Roku Wrapper

AppleTV Wrapper

iPad Wrapper

PC / Mac Wrapper

TiVo Wrapper

Source Data Layer

API Repository Layer API Layer

Wrapper Layer App Layer

Web Service Layer

SHARED

API

INTER-FACES

Shared Layer

Page 16: The future-of-netflix-api

Recommend-ation

Ratings

Rental History

User Account

Title Catalog

Queue Normal-ization

And Resiiency

Ratings Service

Recommend-ation

Service

Rental History Service

LIST API

USER API

TITLE API

AUTHAPI

iPhone Wrapper

Wii Wrapper

Xbox Wrapper

PS3 Wrapper

Roku Wrapper

AppleTV Wrapper

iPad Wrapper

PC / Mac Wrapper

TiVo Wrapper

Source Data Layer

API Repository Layer API Layer

Wrapper Layer App Layer

Web Service Layer

SHARED

API

INTER-FACES

Shared Layer

THESE ARE SOME OF THE DATA SOURCES

THAT PROVIDE CONTENT TO THE API

Page 17: The future-of-netflix-api

Recommend-ation

Ratings

Rental History

User Account

Title Catalog

Queue Normal-ization

And Resiiency

Ratings Service

Recommend-ation

Service

Rental History Service

LIST API

USER API

TITLE API

AUTHAPI

iPhone Wrapper

Wii Wrapper

Xbox Wrapper

PS3 Wrapper

Roku Wrapper

AppleTV Wrapper

iPad Wrapper

PC / Mac Wrapper

TiVo Wrapper

Source Data Layer

API Repository Layer API Layer

Wrapper Layer App Layer

Web Service Layer

SHARED

API

INTER-FACES

Shared Layer

THESE ARE SOME OF THE SERVICES PROVIDED BY

SOME OF THE API DEPENDENCIES THROUGH WHICH CONTENT IS MADE

AVAILABLE TO THE API

Page 18: The future-of-netflix-api

Recommend-ation

Ratings

Rental History

User Account

Title Catalog

Queue Normal-ization

And Resiiency

Ratings Service

Recommend-ation

Service

Rental History Service

LIST API

USER API

TITLE API

AUTHAPI

iPhone Wrapper

Wii Wrapper

Xbox Wrapper

PS3 Wrapper

Roku Wrapper

AppleTV Wrapper

iPad Wrapper

PC / Mac Wrapper

TiVo Wrapper

Source Data Layer

API Repository Layer API Layer

Wrapper Layer App Layer

Web Service Layer

SHARED

API

INTER-FACES

Shared Layer

THIS 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.

Page 19: The future-of-netflix-api

Recommend-ation

Ratings

Rental History

User Account

Title Catalog

Queue Normal-ization

And Resiiency

Ratings Service

Recommend-ation

Service

Rental History Service

LIST API

USER API

TITLE API

AUTHAPI

iPhone Wrapper

Wii Wrapper

Xbox Wrapper

PS3 Wrapper

Roku Wrapper

AppleTV Wrapper

iPad Wrapper

PC / Mac Wrapper

TiVo Wrapper

Source Data Layer

API Repository Layer API Layer

Wrapper Layer App Layer

Web Service Layer

SHARED

API

INTER-FACES

Shared Layer

MAKING 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.

Page 20: The future-of-netflix-api

Recommend-ation

Ratings

Rental History

User Account

Title Catalog

Queue Normal-ization

And Resiiency

Ratings Service

Recommend-ation

Service

Rental History Service

LIST API

USER API

TITLE API

AUTHAPI

iPhone Wrapper

Wii Wrapper

Xbox Wrapper

PS3 Wrapper

Roku Wrapper

AppleTV Wrapper

iPad Wrapper

PC / Mac Wrapper

TiVo Wrapper

Source Data Layer

API Repository Layer API Layer

Wrapper Layer App Layer

Web Service Layer

SHARED

API

INTER-FACES

Shared Layer

THE 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.

Page 21: The future-of-netflix-api

Recommend-ation

Ratings

Rental History

User Account

Title Catalog

Queue Normal-ization

And Resiiency

Ratings Service

Recommend-ation

Service

Rental History Service

LIST API

USER API

TITLE API

AUTHAPI

iPhone Wrapper

Wii Wrapper

Xbox Wrapper

PS3 Wrapper

Roku Wrapper

AppleTV Wrapper

iPad Wrapper

PC / Mac Wrapper

TiVo Wrapper

Source Data Layer

API Repository Layer API Layer

Wrapper Layer App Layer

Web Service Layer

SHARED

API

INTER-FACES

Shared Layer

THE 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.

Page 22: The future-of-netflix-api

Recommend-ation

Ratings

Rental History

User Account

Title Catalog

Queue Normal-ization

And Resiiency

Ratings Service

Recommend-ation

Service

Rental History Service

LIST API

USER API

TITLE API

AUTHAPI

iPhone Wrapper

Wii Wrapper

Xbox Wrapper

PS3 Wrapper

Roku Wrapper

AppleTV Wrapper

iPad Wrapper

PC / Mac Wrapper

TiVo Wrapper

Source Data Layer

API Repository Layer API Layer

Wrapper Layer App Layer

Web Service Layer

SHARED

API

INTER-FACES

Shared Layer

THESE ARE SOME OF THE ACTUAL INTERNAL API

CUSTOMERS TODAY. THIS LIST WILL GROW OVER TIME,

BUT THIS ARCHITECTURE WILL SCALE ACCORDINGLY.

Page 23: The future-of-netflix-api

Flexible API RequestsAs flexible as SQL

SELECT person_first_name, person_last_name, dept_name

FROM person, department

WHERE UPPER(dept_name) LIKE ‘%Engineering%’

AND person_added_date BETWEEN ‘2002-01-01’ AND sysdate

ORDER BY person_last_name ASC

Manages Partial Response

Determines the Selected API

Restricts Output

Sorts Results

GOAL: API should be able to handle any request that you can do in SQL

Page 24: The future-of-netflix-api

The Problem with Versioning1.0

1.5

2.0

Today

3.0?

4.0?

5.0?

Page 25: The future-of-netflix-api

Maybe we don’t need versioning?1.0

1.5

2.0

Future APIs

Today

Page 26: The future-of-netflix-api

Branching can always be done later…1.0

1.5

2.0

New API

Today

Page 27: The future-of-netflix-api

XML vs. JSON?Or both? Or other?

xml

Page 28: The future-of-netflix-api

REST…as long as it makes sense for the business

Page 29: The future-of-netflix-api

Questions?

API Management• Engineering Manager – Web API Systems: http://bit.ly/9O3Hic• API Integration Systems Analyst: http://bit.ly/hyPxCh

API Engineering• Senior Software Engineer/Architect – Web API Platform: http://bit.ly/e0AKw4

API Test Engineering• Senior Software Engineer in Test – API: http://bit.ly/9zHPtJ• Senior Software Engineer in Test – API Platform: http://bit.ly/eD3tLn• Lead Software Engineer in Test – API: http://bit.ly/fqxBYC

Social Engineering• Social Systems – Engineer Architect: http://bit.ly/dYq6C8

Michael HartDirector of Engineering – Social@michaelhart

Daniel JacobsonDirector of Engineering – API@daniel_jacobson