SlideShare una empresa de Scribd logo
1 de 49
API Design: When to buck the trend
Netflix API case study with Daniel Jacobson



groups.google.com/group/api-craft

Daniel Jacobson             Greg Brail
Netflix                     Apigee
@daniel_jacobson            @gbrail
groups.google.com/group/api-craft
youtube.com/apigee
slideshare.net/apigee
http://tinyurl.com/api-strategy-book
@daniel_jacobson    @gbrail
 Daniel Jacobson   Greg Brail
What’s the trend?


Pragmatic REST style

One size fits all

JSON

OAuth

API versioning in the URI
Trend:
PRAGMATIC REST
Pragmatic REST – most common style today




URIs are carefully designed

Each URI represents a “resource”

Resource actions are defined by HTTP verbs
  GET (read), POST (create), PUT (update), DELETE
Pragmatic REST alternatives




Pure REST

Ad-hoc XML / JSON over HTTP

SOAP
Alternative: pure REST



Quick definition:

  A REST API as defined by Roy Fielding
  http://en.wikipedia.org/wiki/REST
  and followers
  http://martinfowler.com/articles/richardsonMaturityModel.html
Alternative: pure REST




Flexible, powerful, and evolvable over decades…

Slow, hard to program, and rare
So who cares about REST?
Most APIs that call themselves “REST” are not actually
REST by the pure definition

So pure REST APIs buck the trend. Why?
  The server implementation can change URIs
  The URI structure is not documented – clients follow
  links
  So, the server implementation can change the whole
  structure of the API

In theory, the API can evolve forever without ever being
“incompatible”
Trend:
ONE SIZE FITS ALL
One size fits all




Does it make sense to have the same API for all
developers?
One size fits all – why yes?




API team can focus on one precise, well-documented API

Reduce training costs across development teams

Can support an unlimited number of known and unknown
developers
One size fits all – why not?




Treats all clients generically, so optimized for none

API team becomes bottleneck for UI development
One size fits all – why not?

Some of the many client differences:
   Memory capacity
   Distinct markup types (XML, JSON)
   Flat vs. Hierarchical document models
   Screen real estate
   Document delivery
   User interaction models
How do you know if your company is ready to consider
alternatives to the one-size-fits-all API model?

Small number of targeted API consumers is the top priority

Very close relationships between these API consumers and the
API team

Increasing divergence of needs across the top priority API
consumers

Strong desire by the API consumers for more optimized
interactions with the API

High value proposition for the API provider to make these API
consumers as effective as possible
Netflix’s approach against one-size-fits-all API

Embrace the differences of the devices

Separate content gathering from content formatting
and delivery

Redefine the border between client and server

Distribute innovation
Netflix REST API Model




 Network Border                                        Network Border




                              REST API




         START-     A/B    MEMBER   RECOMME    MOVIE                SIMILAR
AUTH                                NDATIONS
                                                         RATINGS
           UP      TESTS    DATA               DATA                 MOVIES
Netflix New Non-REST API Model




 Network Border                                       Network Border




                            JAVA API



         START-    A/B    MEMBER   RECOMME    MOVIE                SIMILAR
AUTH                               NDATIONS
                                                        RATINGS
           UP     TESTS    DATA               DATA                 MOVIES
Netflix REST API Model



                   CLIENT CODE
 Network Border                                       Network Border




                            REST API
                  SERVER CODE
         START-    A/B    MEMBER   RECOMME    MOVIE                SIMILAR
AUTH                               NDATIONS
                                                        RATINGS
           UP     TESTS    DATA               DATA                 MOVIES
Netflix New Non-REST API Model


                     CLIENT CODE
 Network Border                                           Network Border


         CLIENT ADAPTER CODE
                              (ON SERVER)


                              JAVA API


                    SERVER CODE       RECOMME
         START-      A/B    MEMBER    NDATIONSA   MOVIE                SIMILAR
AUTH                                   ZXSXX C
                                                            RATINGS
           UP       TESTS    DATA                 DATA                 MOVIES
                                         CCC
One size fits all – other alternatives




Why not have both?

Layer the different APIs over a common API
One size fits all – other alternatives
One size fits all – other alternatives




Other alternatives provide greater flexibility
            but still have server teams dictate rules

Doesn’t alleviate server team bottleneck issue
Trend:
JSON
JSON Conventional Wisdom



JSON and XML are exactly the same

JSON is always smaller than XML

JSON is always faster to parse than XML

All clients can parse JSON

All servers can produce JSON
JSON considerations
Not all devices support JSON out of the box

Different devices may require different XML schemas

Some devices prefer full document delivery and others
prefer streaming bits

XML and JSON aren’t all that different in size once you
compress them

XML has a different data model than JSON
More JSON considerations


There are many more tools built around XML today
than there are built around JSON

XML offers more semantic context than JSON

Saying XML or JSON is not enough – both can support
very different document models
JSON advice

Design the guts of the API to separate data gathering
from data formatting

Add a mediation layer (in your code our outside) to
render the right format

If in doubt, support JSON internally, and support
conversion to other formats as a wrapper
  JSON -> XML is easier than XML -> JSON
Trend:
OAUTH
OAuth – super-big trend in APIs




Essential for
  APIs that authenticate end users

  Unknown (to you) developers

  Mobile and native clients
OAuth alternatives




Cookies
  Netflix’s new approach

  Great for apps that are based on browsers

  Great if API consumers are very close to API team
OAuth alternatives




HTTP Basic Auth + SSL
Two-way SSL

  Both are great for server-to-server APIs
OAuth alternatives




API keys only

  “Two-legged” access when there is no “user”
Trend:
API VERSIONING IN URI
Versioning

Many APIs include a version number in the
  URI (like api.foo.com/v1)
  Hostname (v1.api.foo.com)
  Query parameter (api.foo.com/v1/bar?version=1)
  Content-type header

The version number represents the interface version

The number changes, although rarely
Can an API call have NO version?

If you can achieve it, maintenance will be MUCH
simpler

If you cannot, it instills better practices
   Reduces lazy programming
   Results in fewer versions
   Results in a cleaner, less brittle system


And keep in mind, adding new features typically does
not require a new version…
   Schematic or structural changes, however, do
Average life of a TV: 7-10 years
Versioning

                                    1.0

                                      1.5

                                          2.0

                                                3.0?

                                                  4.0?

                                                       5.0?



                     Today

2008   2009   2010   2011    2012     2013      2014    2015   2016   2017   2018   2019   2020
Versioning

                                    1.0

                                      1.5

                                          2.0




                                New API

                     Today

2008   2009   2010   2011    2012     2013      2014   2015   2016   2017   2018   2019   2020
groups.google.com/group/api-craft
THANK YOU
Questions and ideas to:
@gbrail
@daniel_jacobson

groups.google.com/group/api-craft

Más contenido relacionado

La actualidad más candente

Azure integration services from the IT Professional perspective
Azure integration services from the IT Professional perspectiveAzure integration services from the IT Professional perspective
Azure integration services from the IT Professional perspectiveAlessandro Moura
 
Suresh Poopandi_Generative AI On AWS-MidWestCommunityDay-Final.pdf
Suresh Poopandi_Generative AI On AWS-MidWestCommunityDay-Final.pdfSuresh Poopandi_Generative AI On AWS-MidWestCommunityDay-Final.pdf
Suresh Poopandi_Generative AI On AWS-MidWestCommunityDay-Final.pdfAWS Chicago
 
[AWS Hero 스페셜] Amazon Personalize를 통한 개인화/추천 서비스 개발 노하우 - 소성운(크로키닷컴) :: AWS C...
[AWS Hero 스페셜] Amazon Personalize를 통한 개인화/추천 서비스 개발 노하우 - 소성운(크로키닷컴) :: AWS C...[AWS Hero 스페셜] Amazon Personalize를 통한 개인화/추천 서비스 개발 노하우 - 소성운(크로키닷컴) :: AWS C...
[AWS Hero 스페셜] Amazon Personalize를 통한 개인화/추천 서비스 개발 노하우 - 소성운(크로키닷컴) :: AWS C...AWSKRUG - AWS한국사용자모임
 
API Description Languages
API Description LanguagesAPI Description Languages
API Description LanguagesAkana
 
Key characteristics of specific periopathogens
Key characteristics of specific periopathogensKey characteristics of specific periopathogens
Key characteristics of specific periopathogensSheethalan Ravi
 
Update CMDB Using Discovery Topology (BMC ADDM)
Update CMDB Using Discovery Topology (BMC ADDM) Update CMDB Using Discovery Topology (BMC ADDM)
Update CMDB Using Discovery Topology (BMC ADDM) Vyom Labs
 
The Past, Present and Future of Enterprise Integration
The Past, Present and Future of  Enterprise IntegrationThe Past, Present and Future of  Enterprise Integration
The Past, Present and Future of Enterprise IntegrationKasun Indrasiri
 
Top Trends in Application Architecture That Enable.pdf
Top Trends in Application Architecture That Enable.pdfTop Trends in Application Architecture That Enable.pdf
Top Trends in Application Architecture That Enable.pdfMantoshKumarSingh7
 
Building a Solid Business Case for Cloud Migration
Building a Solid Business Case for Cloud MigrationBuilding a Solid Business Case for Cloud Migration
Building a Solid Business Case for Cloud MigrationAmazon Web Services
 
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)Peter Lubbers
 
Mapping out your API Strategy - 4.20.11 Webinar slides
Mapping out your API Strategy - 4.20.11 Webinar slidesMapping out your API Strategy - 4.20.11 Webinar slides
Mapping out your API Strategy - 4.20.11 Webinar slidesApigee | Google Cloud
 
ACS EA-SIG - Bridging enterprise-architecture and systems-thinking
ACS EA-SIG - Bridging enterprise-architecture and systems-thinkingACS EA-SIG - Bridging enterprise-architecture and systems-thinking
ACS EA-SIG - Bridging enterprise-architecture and systems-thinkingTetradian Consulting
 
Chemically modified tetracycline- Dr. Rohanjeet
Chemically modified tetracycline- Dr. RohanjeetChemically modified tetracycline- Dr. Rohanjeet
Chemically modified tetracycline- Dr. RohanjeetRohanjeet Dede
 
Azure API Management
Azure API ManagementAzure API Management
Azure API ManagementDaniel Toomey
 
대규모 온프레미스 하둡 마이그레이션을 위한 실행 전략과 최적화 방안 소개-유철민, AWS Data Architect / 박성열,AWS Pr...
대규모 온프레미스 하둡 마이그레이션을 위한 실행 전략과 최적화 방안 소개-유철민, AWS Data Architect / 박성열,AWS Pr...대규모 온프레미스 하둡 마이그레이션을 위한 실행 전략과 최적화 방안 소개-유철민, AWS Data Architect / 박성열,AWS Pr...
대규모 온프레미스 하둡 마이그레이션을 위한 실행 전략과 최적화 방안 소개-유철민, AWS Data Architect / 박성열,AWS Pr...Amazon Web Services Korea
 
Cox Automotive’s Data Center Migration to the AWS Cloud - ENT330 - re:Invent ...
Cox Automotive’s Data Center Migration to the AWS Cloud - ENT330 - re:Invent ...Cox Automotive’s Data Center Migration to the AWS Cloud - ENT330 - re:Invent ...
Cox Automotive’s Data Center Migration to the AWS Cloud - ENT330 - re:Invent ...Amazon Web Services
 

La actualidad más candente (20)

Azure integration services from the IT Professional perspective
Azure integration services from the IT Professional perspectiveAzure integration services from the IT Professional perspective
Azure integration services from the IT Professional perspective
 
Suresh Poopandi_Generative AI On AWS-MidWestCommunityDay-Final.pdf
Suresh Poopandi_Generative AI On AWS-MidWestCommunityDay-Final.pdfSuresh Poopandi_Generative AI On AWS-MidWestCommunityDay-Final.pdf
Suresh Poopandi_Generative AI On AWS-MidWestCommunityDay-Final.pdf
 
[AWS Hero 스페셜] Amazon Personalize를 통한 개인화/추천 서비스 개발 노하우 - 소성운(크로키닷컴) :: AWS C...
[AWS Hero 스페셜] Amazon Personalize를 통한 개인화/추천 서비스 개발 노하우 - 소성운(크로키닷컴) :: AWS C...[AWS Hero 스페셜] Amazon Personalize를 통한 개인화/추천 서비스 개발 노하우 - 소성운(크로키닷컴) :: AWS C...
[AWS Hero 스페셜] Amazon Personalize를 통한 개인화/추천 서비스 개발 노하우 - 소성운(크로키닷컴) :: AWS C...
 
Biologic width 2
Biologic width 2Biologic width 2
Biologic width 2
 
API Description Languages
API Description LanguagesAPI Description Languages
API Description Languages
 
Key characteristics of specific periopathogens
Key characteristics of specific periopathogensKey characteristics of specific periopathogens
Key characteristics of specific periopathogens
 
Monitorización con Prometheus
Monitorización con PrometheusMonitorización con Prometheus
Monitorización con Prometheus
 
TOGAF 9 Architecture Partitioning
TOGAF 9  Architecture PartitioningTOGAF 9  Architecture Partitioning
TOGAF 9 Architecture Partitioning
 
Update CMDB Using Discovery Topology (BMC ADDM)
Update CMDB Using Discovery Topology (BMC ADDM) Update CMDB Using Discovery Topology (BMC ADDM)
Update CMDB Using Discovery Topology (BMC ADDM)
 
The Past, Present and Future of Enterprise Integration
The Past, Present and Future of  Enterprise IntegrationThe Past, Present and Future of  Enterprise Integration
The Past, Present and Future of Enterprise Integration
 
Top Trends in Application Architecture That Enable.pdf
Top Trends in Application Architecture That Enable.pdfTop Trends in Application Architecture That Enable.pdf
Top Trends in Application Architecture That Enable.pdf
 
Building a Solid Business Case for Cloud Migration
Building a Solid Business Case for Cloud MigrationBuilding a Solid Business Case for Cloud Migration
Building a Solid Business Case for Cloud Migration
 
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
 
Mapping out your API Strategy - 4.20.11 Webinar slides
Mapping out your API Strategy - 4.20.11 Webinar slidesMapping out your API Strategy - 4.20.11 Webinar slides
Mapping out your API Strategy - 4.20.11 Webinar slides
 
ACS EA-SIG - Bridging enterprise-architecture and systems-thinking
ACS EA-SIG - Bridging enterprise-architecture and systems-thinkingACS EA-SIG - Bridging enterprise-architecture and systems-thinking
ACS EA-SIG - Bridging enterprise-architecture and systems-thinking
 
Chemically modified tetracycline- Dr. Rohanjeet
Chemically modified tetracycline- Dr. RohanjeetChemically modified tetracycline- Dr. Rohanjeet
Chemically modified tetracycline- Dr. Rohanjeet
 
Azure API Management
Azure API ManagementAzure API Management
Azure API Management
 
대규모 온프레미스 하둡 마이그레이션을 위한 실행 전략과 최적화 방안 소개-유철민, AWS Data Architect / 박성열,AWS Pr...
대규모 온프레미스 하둡 마이그레이션을 위한 실행 전략과 최적화 방안 소개-유철민, AWS Data Architect / 박성열,AWS Pr...대규모 온프레미스 하둡 마이그레이션을 위한 실행 전략과 최적화 방안 소개-유철민, AWS Data Architect / 박성열,AWS Pr...
대규모 온프레미스 하둡 마이그레이션을 위한 실행 전략과 최적화 방안 소개-유철민, AWS Data Architect / 박성열,AWS Pr...
 
Cloud Economics
Cloud EconomicsCloud Economics
Cloud Economics
 
Cox Automotive’s Data Center Migration to the AWS Cloud - ENT330 - re:Invent ...
Cox Automotive’s Data Center Migration to the AWS Cloud - ENT330 - re:Invent ...Cox Automotive’s Data Center Migration to the AWS Cloud - ENT330 - re:Invent ...
Cox Automotive’s Data Center Migration to the AWS Cloud - ENT330 - re:Invent ...
 

Destacado

OData Introduction and Impact on API Design (Webcast)
OData Introduction and Impact on API Design (Webcast)OData Introduction and Impact on API Design (Webcast)
OData Introduction and Impact on API Design (Webcast)Apigee | Google Cloud
 
Building Your API for Longevity
Building Your API for LongevityBuilding Your API for Longevity
Building Your API for LongevityMuleSoft
 
HATEOAS 101 - Opinionated Introduction to a REST API Style
HATEOAS 101 - Opinionated Introduction to a REST API StyleHATEOAS 101 - Opinionated Introduction to a REST API Style
HATEOAS 101 - Opinionated Introduction to a REST API StyleApigee | Google Cloud
 

Destacado (8)

RESTful API Design, Second Edition
RESTful API Design, Second EditionRESTful API Design, Second Edition
RESTful API Design, Second Edition
 
API Trends: What to expect in 2012
API Trends: What to expect in 2012API Trends: What to expect in 2012
API Trends: What to expect in 2012
 
OData Introduction and Impact on API Design (Webcast)
OData Introduction and Impact on API Design (Webcast)OData Introduction and Impact on API Design (Webcast)
OData Introduction and Impact on API Design (Webcast)
 
2017 API Catalog
2017 API Catalog2017 API Catalog
2017 API Catalog
 
Building Your API for Longevity
Building Your API for LongevityBuilding Your API for Longevity
Building Your API for Longevity
 
History of house
History of houseHistory of house
History of house
 
API Design - 3rd Edition
API Design - 3rd EditionAPI Design - 3rd Edition
API Design - 3rd Edition
 
HATEOAS 101 - Opinionated Introduction to a REST API Style
HATEOAS 101 - Opinionated Introduction to a REST API StyleHATEOAS 101 - Opinionated Introduction to a REST API Style
HATEOAS 101 - Opinionated Introduction to a REST API Style
 

Similar a API Design: When to buck the trend and avoid pragmatic REST, one size fits all, JSON, OAuth, and versioning in the URI

Set Your Content Free! : Case Studies from Netflix and NPR
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
 
Toronto node js_meetup
Toronto node js_meetupToronto node js_meetup
Toronto node js_meetupShubhra Kar
 
Ibm_interconnect_restapi_workshop
Ibm_interconnect_restapi_workshopIbm_interconnect_restapi_workshop
Ibm_interconnect_restapi_workshopShubhra Kar
 
(ATS3-GS02) Accelrys Enterprise Platform in Enterprise Architectures
(ATS3-GS02) Accelrys Enterprise Platform in Enterprise Architectures(ATS3-GS02) Accelrys Enterprise Platform in Enterprise Architectures
(ATS3-GS02) Accelrys Enterprise Platform in Enterprise ArchitecturesBIOVIA
 
Techniques for Scaling the Netflix API - QCon SF
Techniques for Scaling the Netflix API - QCon SFTechniques for Scaling the Netflix API - QCon SF
Techniques for Scaling the Netflix API - QCon SFDaniel Jacobson
 
A great api is hard to find
A great api is hard to findA great api is hard to find
A great api is hard to findDan Diephouse
 
Maintaining the Front Door to Netflix : The Netflix API
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 APIDaniel Jacobson
 
Service Testing. WTF Does This API Do
Service Testing. WTF Does This API Do	Service Testing. WTF Does This API Do
Service Testing. WTF Does This API Do Globant
 
New Ways To Engage With Tiempo 2011
New Ways To Engage With Tiempo 2011New Ways To Engage With Tiempo 2011
New Ways To Engage With Tiempo 2011Tiempo Development
 
Netflix API - Presentation to PayPal
Netflix API - Presentation to PayPalNetflix API - Presentation to PayPal
Netflix API - Presentation to PayPalDaniel Jacobson
 
Building a Great Web API - Evan Cooke - QCON 2011
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 2011Twilio Inc
 
Open Ap Is State Of The Market
Open Ap Is State Of The MarketOpen Ap Is State Of The Market
Open Ap Is State Of The MarketConSanFrancisco123
 
REST - What's It All About? (SAP TechEd 2012, CD110)
REST - What's It All About? (SAP TechEd 2012, CD110)REST - What's It All About? (SAP TechEd 2012, CD110)
REST - What's It All About? (SAP TechEd 2012, CD110)Sascha Wenninger
 
Evaluating and Testing Web APIs
Evaluating and Testing Web APIsEvaluating and Testing Web APIs
Evaluating and Testing Web APIsSmartBear
 
API Strategy Evolution at Netflix
API Strategy Evolution at NetflixAPI Strategy Evolution at Netflix
API Strategy Evolution at NetflixMichael Hart
 
Melbourne API Management Seminar
Melbourne API Management SeminarMelbourne API Management Seminar
Melbourne API Management SeminarCA API Management
 
Triangle Node Meetup : APIs in Minutes with Node.js
Triangle Node Meetup :  APIs in Minutes with Node.jsTriangle Node Meetup :  APIs in Minutes with Node.js
Triangle Node Meetup : APIs in Minutes with Node.jsShubhra Kar
 
Node.js Frameworks & Design Patterns Webinar
Node.js Frameworks & Design Patterns WebinarNode.js Frameworks & Design Patterns Webinar
Node.js Frameworks & Design Patterns WebinarShubhra Kar
 
The future-of-netflix-api
The future-of-netflix-apiThe future-of-netflix-api
The future-of-netflix-apiDaniel Jacobson
 

Similar a API Design: When to buck the trend and avoid pragmatic REST, one size fits all, JSON, OAuth, and versioning in the URI (20)

Set Your Content Free! : Case Studies from Netflix and NPR
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 NPR
 
Toronto node js_meetup
Toronto node js_meetupToronto node js_meetup
Toronto node js_meetup
 
Ibm_interconnect_restapi_workshop
Ibm_interconnect_restapi_workshopIbm_interconnect_restapi_workshop
Ibm_interconnect_restapi_workshop
 
(ATS3-GS02) Accelrys Enterprise Platform in Enterprise Architectures
(ATS3-GS02) Accelrys Enterprise Platform in Enterprise Architectures(ATS3-GS02) Accelrys Enterprise Platform in Enterprise Architectures
(ATS3-GS02) Accelrys Enterprise Platform in Enterprise Architectures
 
Techniques for Scaling the Netflix API - QCon SF
Techniques for Scaling the Netflix API - QCon SFTechniques for Scaling the Netflix API - QCon SF
Techniques for Scaling the Netflix API - QCon SF
 
A great api is hard to find
A great api is hard to findA great api is hard to find
A great api is hard to find
 
Maintaining the Front Door to Netflix : The Netflix API
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
 
Service Testing. WTF Does This API Do
Service Testing. WTF Does This API Do	Service Testing. WTF Does This API Do
Service Testing. WTF Does This API Do
 
New Ways To Engage With Tiempo 2011
New Ways To Engage With Tiempo 2011New Ways To Engage With Tiempo 2011
New Ways To Engage With Tiempo 2011
 
Netflix API - Presentation to PayPal
Netflix API - Presentation to PayPalNetflix API - Presentation to PayPal
Netflix API - Presentation to PayPal
 
Building a Great Web API - Evan Cooke - QCON 2011
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
 
Open Ap Is State Of The Market
Open Ap Is State Of The MarketOpen Ap Is State Of The Market
Open Ap Is State Of The Market
 
REST - What's It All About? (SAP TechEd 2012, CD110)
REST - What's It All About? (SAP TechEd 2012, CD110)REST - What's It All About? (SAP TechEd 2012, CD110)
REST - What's It All About? (SAP TechEd 2012, CD110)
 
Evaluating and Testing Web APIs
Evaluating and Testing Web APIsEvaluating and Testing Web APIs
Evaluating and Testing Web APIs
 
API Strategy Evolution at Netflix
API Strategy Evolution at NetflixAPI Strategy Evolution at Netflix
API Strategy Evolution at Netflix
 
Melbourne API Management Seminar
Melbourne API Management SeminarMelbourne API Management Seminar
Melbourne API Management Seminar
 
Scaling the Netflix API
Scaling the Netflix APIScaling the Netflix API
Scaling the Netflix API
 
Triangle Node Meetup : APIs in Minutes with Node.js
Triangle Node Meetup :  APIs in Minutes with Node.jsTriangle Node Meetup :  APIs in Minutes with Node.js
Triangle Node Meetup : APIs in Minutes with Node.js
 
Node.js Frameworks & Design Patterns Webinar
Node.js Frameworks & Design Patterns WebinarNode.js Frameworks & Design Patterns Webinar
Node.js Frameworks & Design Patterns Webinar
 
The future-of-netflix-api
The future-of-netflix-apiThe future-of-netflix-api
The future-of-netflix-api
 

Más de Apigee | Google Cloud

Monetization: Unlock More Value from Your APIs
Monetization: Unlock More Value from Your APIs Monetization: Unlock More Value from Your APIs
Monetization: Unlock More Value from Your APIs Apigee | Google Cloud
 
AccuWeather: Recasting API Experiences in a Developer-First World
AccuWeather: Recasting API Experiences in a Developer-First WorldAccuWeather: Recasting API Experiences in a Developer-First World
AccuWeather: Recasting API Experiences in a Developer-First WorldApigee | Google Cloud
 
Which Application Modernization Pattern Is Right For You?
Which Application Modernization Pattern Is Right For You?Which Application Modernization Pattern Is Right For You?
Which Application Modernization Pattern Is Right For You?Apigee | Google Cloud
 
The Four Transformative Forces of the API Management Market
The Four Transformative Forces of the API Management MarketThe Four Transformative Forces of the API Management Market
The Four Transformative Forces of the API Management MarketApigee | Google Cloud
 
Managing the Complexity of Microservices Deployments
Managing the Complexity of Microservices DeploymentsManaging the Complexity of Microservices Deployments
Managing the Complexity of Microservices DeploymentsApigee | Google Cloud
 
Microservices Done Right: Key Ingredients for Microservices Success
Microservices Done Right: Key Ingredients for Microservices SuccessMicroservices Done Right: Key Ingredients for Microservices Success
Microservices Done Right: Key Ingredients for Microservices SuccessApigee | Google Cloud
 
Adapt or Die: Opening Keynote with Chet Kapoor
Adapt or Die: Opening Keynote with Chet KapoorAdapt or Die: Opening Keynote with Chet Kapoor
Adapt or Die: Opening Keynote with Chet KapoorApigee | Google Cloud
 
Adapt or Die: Keynote with Greg Brail
Adapt or Die: Keynote with Greg BrailAdapt or Die: Keynote with Greg Brail
Adapt or Die: Keynote with Greg BrailApigee | Google Cloud
 
Adapt or Die: Keynote with Anant Jhingran
Adapt or Die: Keynote with Anant JhingranAdapt or Die: Keynote with Anant Jhingran
Adapt or Die: Keynote with Anant JhingranApigee | Google Cloud
 
London Adapt or Die: Closing Keynote — Adapt Now!
London Adapt or Die: Closing Keynote — Adapt Now!London Adapt or Die: Closing Keynote — Adapt Now!
London Adapt or Die: Closing Keynote — Adapt Now!Apigee | Google Cloud
 

Más de Apigee | Google Cloud (20)

How Secure Are Your APIs?
How Secure Are Your APIs?How Secure Are Your APIs?
How Secure Are Your APIs?
 
Magazine Luiza at a glance (1)
Magazine Luiza at a glance (1)Magazine Luiza at a glance (1)
Magazine Luiza at a glance (1)
 
Monetization: Unlock More Value from Your APIs
Monetization: Unlock More Value from Your APIs Monetization: Unlock More Value from Your APIs
Monetization: Unlock More Value from Your APIs
 
Apigee Demo: API Platform Overview
Apigee Demo: API Platform OverviewApigee Demo: API Platform Overview
Apigee Demo: API Platform Overview
 
Ticketmaster at a glance
Ticketmaster at a glanceTicketmaster at a glance
Ticketmaster at a glance
 
AccuWeather: Recasting API Experiences in a Developer-First World
AccuWeather: Recasting API Experiences in a Developer-First WorldAccuWeather: Recasting API Experiences in a Developer-First World
AccuWeather: Recasting API Experiences in a Developer-First World
 
Which Application Modernization Pattern Is Right For You?
Which Application Modernization Pattern Is Right For You?Which Application Modernization Pattern Is Right For You?
Which Application Modernization Pattern Is Right For You?
 
Apigee Product Roadmap Part 2
Apigee Product Roadmap Part 2Apigee Product Roadmap Part 2
Apigee Product Roadmap Part 2
 
The Four Transformative Forces of the API Management Market
The Four Transformative Forces of the API Management MarketThe Four Transformative Forces of the API Management Market
The Four Transformative Forces of the API Management Market
 
Walgreens at a glance
Walgreens at a glanceWalgreens at a glance
Walgreens at a glance
 
Apigee Edge: Intro to Microgateway
Apigee Edge: Intro to MicrogatewayApigee Edge: Intro to Microgateway
Apigee Edge: Intro to Microgateway
 
Managing the Complexity of Microservices Deployments
Managing the Complexity of Microservices DeploymentsManaging the Complexity of Microservices Deployments
Managing the Complexity of Microservices Deployments
 
Pitney Bowes at a glance
Pitney Bowes at a glancePitney Bowes at a glance
Pitney Bowes at a glance
 
Microservices Done Right: Key Ingredients for Microservices Success
Microservices Done Right: Key Ingredients for Microservices SuccessMicroservices Done Right: Key Ingredients for Microservices Success
Microservices Done Right: Key Ingredients for Microservices Success
 
Adapt or Die: Opening Keynote with Chet Kapoor
Adapt or Die: Opening Keynote with Chet KapoorAdapt or Die: Opening Keynote with Chet Kapoor
Adapt or Die: Opening Keynote with Chet Kapoor
 
Adapt or Die: Keynote with Greg Brail
Adapt or Die: Keynote with Greg BrailAdapt or Die: Keynote with Greg Brail
Adapt or Die: Keynote with Greg Brail
 
Adapt or Die: Keynote with Anant Jhingran
Adapt or Die: Keynote with Anant JhingranAdapt or Die: Keynote with Anant Jhingran
Adapt or Die: Keynote with Anant Jhingran
 
London Adapt or Die: Opening Keynot
London Adapt or Die: Opening KeynotLondon Adapt or Die: Opening Keynot
London Adapt or Die: Opening Keynot
 
London Adapt or Die: Lunch keynote
London Adapt or Die: Lunch keynoteLondon Adapt or Die: Lunch keynote
London Adapt or Die: Lunch keynote
 
London Adapt or Die: Closing Keynote — Adapt Now!
London Adapt or Die: Closing Keynote — Adapt Now!London Adapt or Die: Closing Keynote — Adapt Now!
London Adapt or Die: Closing Keynote — Adapt Now!
 

Último

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 

Último (20)

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 

API Design: When to buck the trend and avoid pragmatic REST, one size fits all, JSON, OAuth, and versioning in the URI

  • 1. API Design: When to buck the trend Netflix API case study with Daniel Jacobson groups.google.com/group/api-craft Daniel Jacobson Greg Brail Netflix Apigee @daniel_jacobson @gbrail
  • 6. @daniel_jacobson @gbrail Daniel Jacobson Greg Brail
  • 7. What’s the trend? Pragmatic REST style One size fits all JSON OAuth API versioning in the URI
  • 9. Pragmatic REST – most common style today URIs are carefully designed Each URI represents a “resource” Resource actions are defined by HTTP verbs GET (read), POST (create), PUT (update), DELETE
  • 10. Pragmatic REST alternatives Pure REST Ad-hoc XML / JSON over HTTP SOAP
  • 11. Alternative: pure REST Quick definition: A REST API as defined by Roy Fielding http://en.wikipedia.org/wiki/REST and followers http://martinfowler.com/articles/richardsonMaturityModel.html
  • 12. Alternative: pure REST Flexible, powerful, and evolvable over decades… Slow, hard to program, and rare
  • 13. So who cares about REST? Most APIs that call themselves “REST” are not actually REST by the pure definition So pure REST APIs buck the trend. Why? The server implementation can change URIs The URI structure is not documented – clients follow links So, the server implementation can change the whole structure of the API In theory, the API can evolve forever without ever being “incompatible”
  • 15. One size fits all Does it make sense to have the same API for all developers?
  • 16. One size fits all – why yes? API team can focus on one precise, well-documented API Reduce training costs across development teams Can support an unlimited number of known and unknown developers
  • 17. One size fits all – why not? Treats all clients generically, so optimized for none API team becomes bottleneck for UI development
  • 18.
  • 19. One size fits all – why not? Some of the many client differences: Memory capacity Distinct markup types (XML, JSON) Flat vs. Hierarchical document models Screen real estate Document delivery User interaction models
  • 20.
  • 21.
  • 22. How do you know if your company is ready to consider alternatives to the one-size-fits-all API model? Small number of targeted API consumers is the top priority Very close relationships between these API consumers and the API team Increasing divergence of needs across the top priority API consumers Strong desire by the API consumers for more optimized interactions with the API High value proposition for the API provider to make these API consumers as effective as possible
  • 23. Netflix’s approach against one-size-fits-all API Embrace the differences of the devices Separate content gathering from content formatting and delivery Redefine the border between client and server Distribute innovation
  • 24. Netflix REST API Model Network Border Network Border REST API START- A/B MEMBER RECOMME MOVIE SIMILAR AUTH NDATIONS RATINGS UP TESTS DATA DATA MOVIES
  • 25. Netflix New Non-REST API Model Network Border Network Border JAVA API START- A/B MEMBER RECOMME MOVIE SIMILAR AUTH NDATIONS RATINGS UP TESTS DATA DATA MOVIES
  • 26. Netflix REST API Model CLIENT CODE Network Border Network Border REST API SERVER CODE START- A/B MEMBER RECOMME MOVIE SIMILAR AUTH NDATIONS RATINGS UP TESTS DATA DATA MOVIES
  • 27. Netflix New Non-REST API Model CLIENT CODE Network Border Network Border CLIENT ADAPTER CODE (ON SERVER) JAVA API SERVER CODE RECOMME START- A/B MEMBER NDATIONSA MOVIE SIMILAR AUTH ZXSXX C RATINGS UP TESTS DATA DATA MOVIES CCC
  • 28. One size fits all – other alternatives Why not have both? Layer the different APIs over a common API
  • 29. One size fits all – other alternatives
  • 30. One size fits all – other alternatives Other alternatives provide greater flexibility but still have server teams dictate rules Doesn’t alleviate server team bottleneck issue
  • 32.
  • 33. JSON Conventional Wisdom JSON and XML are exactly the same JSON is always smaller than XML JSON is always faster to parse than XML All clients can parse JSON All servers can produce JSON
  • 34. JSON considerations Not all devices support JSON out of the box Different devices may require different XML schemas Some devices prefer full document delivery and others prefer streaming bits XML and JSON aren’t all that different in size once you compress them XML has a different data model than JSON
  • 35. More JSON considerations There are many more tools built around XML today than there are built around JSON XML offers more semantic context than JSON Saying XML or JSON is not enough – both can support very different document models
  • 36. JSON advice Design the guts of the API to separate data gathering from data formatting Add a mediation layer (in your code our outside) to render the right format If in doubt, support JSON internally, and support conversion to other formats as a wrapper JSON -> XML is easier than XML -> JSON
  • 38. OAuth – super-big trend in APIs Essential for APIs that authenticate end users Unknown (to you) developers Mobile and native clients
  • 39. OAuth alternatives Cookies Netflix’s new approach Great for apps that are based on browsers Great if API consumers are very close to API team
  • 40. OAuth alternatives HTTP Basic Auth + SSL Two-way SSL Both are great for server-to-server APIs
  • 41. OAuth alternatives API keys only “Two-legged” access when there is no “user”
  • 43. Versioning Many APIs include a version number in the URI (like api.foo.com/v1) Hostname (v1.api.foo.com) Query parameter (api.foo.com/v1/bar?version=1) Content-type header The version number represents the interface version The number changes, although rarely
  • 44. Can an API call have NO version? If you can achieve it, maintenance will be MUCH simpler If you cannot, it instills better practices Reduces lazy programming Results in fewer versions Results in a cleaner, less brittle system And keep in mind, adding new features typically does not require a new version… Schematic or structural changes, however, do
  • 45. Average life of a TV: 7-10 years
  • 46. Versioning 1.0 1.5 2.0 3.0? 4.0? 5.0? Today 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020
  • 47. Versioning 1.0 1.5 2.0 New API Today 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020
  • 49. THANK YOU Questions and ideas to: @gbrail @daniel_jacobson groups.google.com/group/api-craft