SlideShare a Scribd company logo
1 of 38
www.twosigma.com
Principles of REST API Design
May 19, 2017
Presented By: Amy Wasik
Two Sigma Investments, LP
Important Legal Information:
This document is being distributed for informational and educational
purposes only and is not an offer to sell or the solicitation of an offer to
buy any securities or other instruments. The information contained
herein is not intended to provide, and should not be relied upon for
investment advice. The views expressed herein are not necessarily the
views of Two Sigma Investments, LP or any of its affiliates (collectively,
“Two Sigma”). Such views reflect significant assumptions and subjective
of the author(s) of the document and are subject to change without
notice. The document may employ data derived from third-party
sources. No representation is made as to the accuracy of such
information and the use of such information in no way implies an
endorsement of the source of such information or its validity.
The copyrights and/or trademarks in some of the images, logos or other
material used herein may be owned by entities other than Two Sigma. If
so, such copyrights and/or trademarks are most likely owned by the
entity that created the material and are used purely for identification
and comment as fair use under international copyright and/or
trademark laws. Use of such image, copyright or trademark does not
imply any association with such organization (or endorsement of such
organization) by Two Sigma, nor vice versa.
Software Architecture
May 19, 2017
Single Server
Services
REST Services
Our Application
May 19, 2017
Application
Job Job Job Job
Host
Our Application
May 19, 2017
Application
Job Job Job Job
Host
Application
Job Job Job Job
Host
Application
Job Job Job Job
Host
Application
Job Job Job Job
Host
Application
Job Job Job Job
Host
Application
Job Job Job Job
Host
Application
Job Job Job
Host
Application
Job Job Job Job
Host
Our Application
May 19, 2017
Application
Job Job Job Job
Host
Monitor Monitor
Host Host
Our Application
May 19, 2017
Client API
Client Client Client
Host
Host Host Host
Scheduler
Job Job Job Job
Host
Monitor Monitor
Host Host
Software Architecture
May 19, 2017
Single Server
Services
REST Services
Services Architecture
May 19, 2017
• Low Coupling
• Maintainable
• Interoperable
• Language Agnostic
• Shareable
• Scalable
• Resilient
Services Architecture
May 19, 2017
• Low Coupling
• Maintainable
• Interoperable
• Language Agnostic
• Shareable
• Scalable
• Resilient
Client API
Client Client Client
Host
Host Host Host
Scheduler
Job Job Job Job
Host
Monitor Monitor
Host Host
Services Architecture
May 19, 2017
• Low Coupling
• Maintainable
• Interoperable
• Language Agnostic
• Shareable
• Scalable
• Resilient
Client API
Client Client Client
Host
Host Host Host
Scheduler
Job Job Job Job
Host
Monitor Monitor
Host Host
Services Architecture
May 19, 2017
• Low Coupling
• Maintainable
• Interoperable
• Language Agnostic
• Shareable
• Scalable
• Resilient
High-level
Javascript
Low-level
Client API
Client Client Client
Host
Host Host Host
Scheduler
Job Job Job Job
Host
Monitor Monitor
Host Host
Services Architecture
May 19, 2017
• Low Coupling
• Maintainable
• Interoperable
• Language Agnostic
• Shareable
• Scalable
• Resilient Application 2
Client API
Client Client Client
Host
Host Host Host
Scheduler
Job Job Job Job
Host
Monitor Monitor
Host Host
Services Architecture
May 19, 2017
• Low Coupling
• Maintainable
• Interoperable
• Language Agnostic
• Shareable
• Scalable
• Resilient
Client API
Client Client Client
Host
Host Host Host
Scheduler
Host
Job Job Job
Host
Monitor Monitor
Host
Services Architecture
May 19, 2017
• Low Coupling
• Maintainable
• Interoperable
• Language Agnostic
• Shareable
• Scalable
• Resilient
Client API
Client Client Client
Host
Host Host Host
Scheduler
Job Job Job Job
Host
Monitor Monitor
Host Host
Communication
May 19, 2017
Single Server:
Local API Method
Calls
Services:
Inter-process
Communication
(IPC)
Inter-Process Communication (IPC)
May 19, 2017
• Remote Procedure Calls (RPC)
• Use a library to convert local calls to remote ones
public interface Jobsystem {
Job createAJob(JobDetails details);
void submitJob(Job j);
List<Job> getJobs(String namePattern);
List<Job> getMyJobs(String user);
List<Job> getJobsOther(String query);
Job getJob(int id);
void updateJob(JobDetails details);
}
Software Architecture
May 19, 2017
Single Server
Services
REST Services
REST Architecture
May 19, 2017
Additional Constraints Benefits
Stateless Scalability
• Representational State Transfer (REST)
REST Architecture
May 19, 2017
Additional Constraints Benefits
Stateless Scalability
Cacheable Increased Capacity
• Representational State Transfer (REST)
REST Architecture
May 19, 2017
Additional Constraints Benefits
Stateless Scalability
Cacheable Increased Capacity
Layered Low Coupling/Interoperability
• Representational State Transfer (REST)
REST Architecture
May 19, 2017
https://martinfowler.com/articles/richardsonMaturityModel.html
4 Levels of Adherence Benefits
0 – HTTP Transport
1 – Resource Oriented Design
2 – HTTP Verbs as actions on resources
3 – Hypertext as the Engine of Application State (HATEOAS)
• Representational State Transfer (REST)
• API Constraints
REST Architecture
May 19, 2017
https://martinfowler.com/articles/richardsonMaturityModel.html
4 Levels of Adherence Benefits
0 – HTTP Transport Standard Interface
1 – Resource Oriented Design Easier-to-Use API
2 – HTTP Verbs as actions on resources Complete API
3 – Hypertext as the Engine of Application State (HATEOAS) Easy-to-Learn API
• Representational State Transfer (REST)
• API Constraints
REST Level 0
May 19, 2017
HTTP Transport
 Readable object encoding (typically JSON)
 Standard URI format
Level 0: RPC over HTTP
May 19, 2017
public interface Jobsystem {
Job createAJob(JobDetails details);
void submitJob(Job j);
List<Job> getJobs(String namePattern);
List<Job> getMyJobs(String user);
List<Job> getJobsOther(String query);
Job getJob(int id);
void updateJob(JobDetails details);
}
GET http://example.com/createAJob?name=t&...
GET http://example.com/submitJob?id=123
GET http://example.com/getJobs?name=test
GET http://example.com/getMyJobs?user=me
GET http://example.com/getJobs?query=...
GET http://example.com/getJob?id=123
GET http://example.com/updateJob?id=123&
Level 0: RPC over HTTP
May 19, 2017
GET http://example.com/createAJob?name=t&user=userA...
HTTP/1.1 200 OK
[other headers]
{ "id": 123
}
GET http://example.com/submitJob?id=123
HTTP/1.1 200 OK
[other headers]
{ "error" : "no permission"
}
REST Level 1
May 19, 2017
Resource Oriented Design
• Divide and conquer
• Easy to understand and navigate API
Standard URI Format
• /{resource}
• /{resource}/{resource-id}
• /{resource}/{resource-id}/{sub-resource}
• /{resource}/{resource-id}/{sub-resource}/{sub-resource-id}
Object Oriented Design
May 19, 2017
GET http://example.com/createAJob?name=
GET http://example.com/submitJob?id=12
GET http://example.com/getJobs?name=
GET http://example.com/getMyJobs?user=
GET http://example.com/getJobs?query=
GET http://example.com/getJob?id=123
GET http://example.com/updateJob?id=123
GET http://example.com/jobs/create?name=t&user=me
GET http://example.com/jobs/get?name=test
GET http://example.com/jobs/getMy?user=me
GET http://example.com/jobs/get?query=...
GET http://example.com/jobs/123
GET http://example.com/jobs/123/update?name=t2...
GET http://example.com/jobs/123/instances/start
GET http://example.com/jobs/123/instances
REST Level 2
May 19, 2017
HTTP Verbs Represent Actions
• More complete and structured APIs
Common Verbs
• GET – Read (Nullipotent)
• PUT – Update (Idempotent)
• POST - Create
• DELETE – Remove (Idempotent)
REST Level 2
May 19, 2017
Standard HTTP Response Codes
• Standard results of actions
Success Client Error Server Error
200 OK 400 Bad Request 500 Internal Server Error
201 Created 401 Unauthorized (authentication failure)
204 No Content 403 Forbidden (not allowed access)
404 Not Found
HTTP Verbs for Actions
May 19, 2017
GET http://example.com/jobs/create?name=t&user=me
GET http://example.com/jobs/get?name=test
GET http://example.com/jobs/getMy?user=me
GET http://example.com/jobs/get?query=...
GET http://example.com/jobs/123
GET http://example.com/jobs/123/update?name=t2...
GET http://example.com/jobs/123/instances/start
GET http://example.com/jobs/123/instances
POST http://example.com/jobs
-d '{"name":"test", "user": "me", …}'
GET http://example.com/jobs?name=test
GET http://example.com/jobs?user=me
GET http://example.com/jobs?query=...
GET http://example.com/jobs/123
PUT http://example.com/jobs/123
-d '{"name":"job" …}'
POST http://example.com/jobs/123/instances
GET http://example.com/jobs/123/instances
HTTP Verbs for Actions
May 19, 2017
POST http://example.com/jobs
-d '{"name":"test", "user": "me", …}'
HTTP/1.1 201 Created
[other headers]
{ "id": 123
}
POST http://example.com/jobs/123/instances
HTTP/1.1 403 Forbidden
[other headers]
{ "errorCode" : 10,
"moreInfo" : "no permission to run this job"
}
REST Level 3
May 19, 2017
REST API Documentation and API Discoverability
• Hypertext As The Engine Of Application State (HATEOAS)
— Adds links to response that indicate useful actions
• Open API
— Provides language-agnostic way to describe REST API
— Lots of tooling for automation
Open API
May 19, 2017
Open API
May 19, 2017
Evolution of the API
May 19, 2017
public interface Jobsystem {
Job createAJob(JobDetails details);
void submitJob(Job j);
List<Job> getJobs(String namePattern);
List<Job> getMyJobs(String user);
List<Job> getJobsOther(String query);
Job getJob(int id);
void updateJob(JobDetails details);
}
Evolution of the API
May 19, 2017
Conclusion
May 19, 2017
• Modern day best practices
• Services architectures
• REST APIs
• Resource Oriented Design
• Self-documenting code
• Next steps
• Evolving APIs
• Complex operations
• Error handling, Standard response types
Additional Resources
May 19, 2017
http://swagger.io/
https://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm
https://martinfowler.com/articles/richardsonMaturityModel.html
Published API Guides:
https://pages.apigee.com/rs/apigee/images/api-design-ebook-2012-03.pdf
https://github.com/paypal/api-standards/blob/master/api-style-guide.md
https://cloud.google.com/apis/design/
Thank you!

More Related Content

What's hot

Restful Web Services
Restful Web ServicesRestful Web Services
Restful Web ServicesAngelin R
 
gRPC: Por que você ainda usa REST?
gRPC: Por que você ainda usa REST?gRPC: Por que você ainda usa REST?
gRPC: Por que você ainda usa REST?Yago Tomé
 
[Retail & CPG Day 2019] 마켓컬리 서비스 AWS 이관 및 최적화 여정 - 임상석, 마켓컬리 개발 리더
[Retail & CPG Day 2019] 마켓컬리 서비스 AWS 이관 및 최적화 여정 - 임상석, 마켓컬리 개발 리더[Retail & CPG Day 2019] 마켓컬리 서비스 AWS 이관 및 최적화 여정 - 임상석, 마켓컬리 개발 리더
[Retail & CPG Day 2019] 마켓컬리 서비스 AWS 이관 및 최적화 여정 - 임상석, 마켓컬리 개발 리더Amazon Web Services Korea
 
REST API and CRUD
REST API and CRUDREST API and CRUD
REST API and CRUDPrem Sanil
 
Introduction to the Web API
Introduction to the Web APIIntroduction to the Web API
Introduction to the Web APIBrad Genereaux
 
Open API Strategy, by Sensedia
Open API Strategy, by SensediaOpen API Strategy, by Sensedia
Open API Strategy, by SensediaSensedia
 
[215] Druid로 쉽고 빠르게 데이터 분석하기
[215] Druid로 쉽고 빠르게 데이터 분석하기[215] Druid로 쉽고 빠르게 데이터 분석하기
[215] Druid로 쉽고 빠르게 데이터 분석하기NAVER D2
 
3. 마이크로 서비스 아키텍쳐
3. 마이크로 서비스 아키텍쳐3. 마이크로 서비스 아키텍쳐
3. 마이크로 서비스 아키텍쳐Terry Cho
 
Introduction to REST - API
Introduction to REST - APIIntroduction to REST - API
Introduction to REST - APIChetan Gadodia
 
마이크로서비스를 위한 AWS 아키텍처 패턴 및 모범 사례 - AWS Summit Seoul 2017
마이크로서비스를 위한 AWS 아키텍처 패턴 및 모범 사례 - AWS Summit Seoul 2017마이크로서비스를 위한 AWS 아키텍처 패턴 및 모범 사례 - AWS Summit Seoul 2017
마이크로서비스를 위한 AWS 아키텍처 패턴 및 모범 사례 - AWS Summit Seoul 2017Amazon Web Services Korea
 
Spring integration을 통해_살펴본_메시징_세계
Spring integration을 통해_살펴본_메시징_세계Spring integration을 통해_살펴본_메시징_세계
Spring integration을 통해_살펴본_메시징_세계Wangeun Lee
 
Best Practices for RESTful Web Services
Best Practices for RESTful Web ServicesBest Practices for RESTful Web Services
Best Practices for RESTful Web ServicesSalesforce Developers
 
Rest & RESTful WebServices
Rest & RESTful WebServicesRest & RESTful WebServices
Rest & RESTful WebServicesPrateek Tandon
 
카카오 광고 플랫폼 MSA 적용 사례 및 API Gateway와 인증 구현에 대한 소개
카카오 광고 플랫폼 MSA 적용 사례 및 API Gateway와 인증 구현에 대한 소개카카오 광고 플랫폼 MSA 적용 사례 및 API Gateway와 인증 구현에 대한 소개
카카오 광고 플랫폼 MSA 적용 사례 및 API Gateway와 인증 구현에 대한 소개if kakao
 
APIs with Bounded Contexts: Modelling Apis with Domain-Driven Design
APIs with Bounded Contexts: Modelling Apis with Domain-Driven DesignAPIs with Bounded Contexts: Modelling Apis with Domain-Driven Design
APIs with Bounded Contexts: Modelling Apis with Domain-Driven DesignJosé Haro Peralta
 
REST-API introduction for developers
REST-API introduction for developersREST-API introduction for developers
REST-API introduction for developersPatrick Savalle
 

What's hot (20)

REST API
REST APIREST API
REST API
 
Restful Web Services
Restful Web ServicesRestful Web Services
Restful Web Services
 
gRPC: Por que você ainda usa REST?
gRPC: Por que você ainda usa REST?gRPC: Por que você ainda usa REST?
gRPC: Por que você ainda usa REST?
 
[Retail & CPG Day 2019] 마켓컬리 서비스 AWS 이관 및 최적화 여정 - 임상석, 마켓컬리 개발 리더
[Retail & CPG Day 2019] 마켓컬리 서비스 AWS 이관 및 최적화 여정 - 임상석, 마켓컬리 개발 리더[Retail & CPG Day 2019] 마켓컬리 서비스 AWS 이관 및 최적화 여정 - 임상석, 마켓컬리 개발 리더
[Retail & CPG Day 2019] 마켓컬리 서비스 AWS 이관 및 최적화 여정 - 임상석, 마켓컬리 개발 리더
 
REST API and CRUD
REST API and CRUDREST API and CRUD
REST API and CRUD
 
Introduction to the Web API
Introduction to the Web APIIntroduction to the Web API
Introduction to the Web API
 
Open API Strategy, by Sensedia
Open API Strategy, by SensediaOpen API Strategy, by Sensedia
Open API Strategy, by Sensedia
 
Web api
Web apiWeb api
Web api
 
[215] Druid로 쉽고 빠르게 데이터 분석하기
[215] Druid로 쉽고 빠르게 데이터 분석하기[215] Druid로 쉽고 빠르게 데이터 분석하기
[215] Druid로 쉽고 빠르게 데이터 분석하기
 
3. 마이크로 서비스 아키텍쳐
3. 마이크로 서비스 아키텍쳐3. 마이크로 서비스 아키텍쳐
3. 마이크로 서비스 아키텍쳐
 
Introduction to REST - API
Introduction to REST - APIIntroduction to REST - API
Introduction to REST - API
 
마이크로서비스를 위한 AWS 아키텍처 패턴 및 모범 사례 - AWS Summit Seoul 2017
마이크로서비스를 위한 AWS 아키텍처 패턴 및 모범 사례 - AWS Summit Seoul 2017마이크로서비스를 위한 AWS 아키텍처 패턴 및 모범 사례 - AWS Summit Seoul 2017
마이크로서비스를 위한 AWS 아키텍처 패턴 및 모범 사례 - AWS Summit Seoul 2017
 
Spring integration을 통해_살펴본_메시징_세계
Spring integration을 통해_살펴본_메시징_세계Spring integration을 통해_살펴본_메시징_세계
Spring integration을 통해_살펴본_메시징_세계
 
Best Practices for RESTful Web Services
Best Practices for RESTful Web ServicesBest Practices for RESTful Web Services
Best Practices for RESTful Web Services
 
RESTful API - Best Practices
RESTful API - Best PracticesRESTful API - Best Practices
RESTful API - Best Practices
 
Microservices chassis
Microservices chassisMicroservices chassis
Microservices chassis
 
Rest & RESTful WebServices
Rest & RESTful WebServicesRest & RESTful WebServices
Rest & RESTful WebServices
 
카카오 광고 플랫폼 MSA 적용 사례 및 API Gateway와 인증 구현에 대한 소개
카카오 광고 플랫폼 MSA 적용 사례 및 API Gateway와 인증 구현에 대한 소개카카오 광고 플랫폼 MSA 적용 사례 및 API Gateway와 인증 구현에 대한 소개
카카오 광고 플랫폼 MSA 적용 사례 및 API Gateway와 인증 구현에 대한 소개
 
APIs with Bounded Contexts: Modelling Apis with Domain-Driven Design
APIs with Bounded Contexts: Modelling Apis with Domain-Driven DesignAPIs with Bounded Contexts: Modelling Apis with Domain-Driven Design
APIs with Bounded Contexts: Modelling Apis with Domain-Driven Design
 
REST-API introduction for developers
REST-API introduction for developersREST-API introduction for developers
REST-API introduction for developers
 

Similar to Principles of REST API Design

Disrupt for Digital Transformation
Disrupt for Digital Transformation Disrupt for Digital Transformation
Disrupt for Digital Transformation JoAnna Cheshire
 
Data APIs Don't Discriminate [API World Stage Talk]
Data APIs Don't Discriminate [API World Stage Talk]Data APIs Don't Discriminate [API World Stage Talk]
Data APIs Don't Discriminate [API World Stage Talk]Sumit Sarkar
 
MBL201_Progressive Web Apps in the Real World
MBL201_Progressive Web Apps in the Real WorldMBL201_Progressive Web Apps in the Real World
MBL201_Progressive Web Apps in the Real WorldAmazon Web Services
 
Webinar_102317_Heffner.ppt
Webinar_102317_Heffner.pptWebinar_102317_Heffner.ppt
Webinar_102317_Heffner.pptssuserc04f7b
 
APIs with Bounded Contexts: Modeling APIs with Domain-Driven Design
APIs with Bounded Contexts: Modeling APIs with Domain-Driven DesignAPIs with Bounded Contexts: Modeling APIs with Domain-Driven Design
APIs with Bounded Contexts: Modeling APIs with Domain-Driven DesignNordic APIs
 
Scaling DevOps - delivering on the promise of business velocity and quality
Scaling DevOps - delivering on the promise of business velocity and qualityScaling DevOps - delivering on the promise of business velocity and quality
Scaling DevOps - delivering on the promise of business velocity and qualityXebiaLabs
 
Small Talk at Tsing Hua University
Small Talk at Tsing Hua UniversitySmall Talk at Tsing Hua University
Small Talk at Tsing Hua UniversityDerek Chang
 
Serverless Software Architecture - Gears 17
Serverless Software Architecture - Gears 17Serverless Software Architecture - Gears 17
Serverless Software Architecture - Gears 17Tars Joris
 
Collaborate 18 presentation by Dayalan Punniyamoorthy
Collaborate 18 presentation by Dayalan PunniyamoorthyCollaborate 18 presentation by Dayalan Punniyamoorthy
Collaborate 18 presentation by Dayalan PunniyamoorthyDayalan Punniyamoorthy
 
Product Vision and Roadmap for Anypoint Platform
Product Vision and Roadmap for Anypoint PlatformProduct Vision and Roadmap for Anypoint Platform
Product Vision and Roadmap for Anypoint PlatformMuleSoft
 
DevSecCon Seattle 2019: Decentralized Authorization - Implementing Fine Grain...
DevSecCon Seattle 2019: Decentralized Authorization - Implementing Fine Grain...DevSecCon Seattle 2019: Decentralized Authorization - Implementing Fine Grain...
DevSecCon Seattle 2019: Decentralized Authorization - Implementing Fine Grain...DevSecCon
 
Accelerating Your Cloud Migration Journey with MAP
Accelerating Your Cloud Migration Journey with MAPAccelerating Your Cloud Migration Journey with MAP
Accelerating Your Cloud Migration Journey with MAPAmazon Web Services
 
Getting the most from your API management platform: A case study
Getting the most from your API management platform: A case studyGetting the most from your API management platform: A case study
Getting the most from your API management platform: A case studyRogue Wave Software
 
The Do's and Don'ts of Mainframe Modernization
The Do's and Don'ts of Mainframe ModernizationThe Do's and Don'ts of Mainframe Modernization
The Do's and Don'ts of Mainframe ModernizationCompuware
 
規劃大規模遷移到 AWS 的最佳實踐
規劃大規模遷移到 AWS 的最佳實踐規劃大規模遷移到 AWS 的最佳實踐
規劃大規模遷移到 AWS 的最佳實踐Amazon Web Services
 
IBM Z for the Digital Enterprise - Microservices, APIs
IBM Z for the Digital Enterprise - Microservices, APIsIBM Z for the Digital Enterprise - Microservices, APIs
IBM Z for the Digital Enterprise - Microservices, APIsDevOps for Enterprise Systems
 
Governing and Sharing your Integration Assets
Governing and Sharing your Integration AssetsGoverning and Sharing your Integration Assets
Governing and Sharing your Integration AssetsMuleSoft
 
We don’t need no stinkin app server! Building a Two-Tier Mobile App
We don’t need no stinkin app server! Building a Two-Tier Mobile AppWe don’t need no stinkin app server! Building a Two-Tier Mobile App
We don’t need no stinkin app server! Building a Two-Tier Mobile AppPat Patterson
 

Similar to Principles of REST API Design (20)

Disrupt for Digital Transformation
Disrupt for Digital Transformation Disrupt for Digital Transformation
Disrupt for Digital Transformation
 
Data APIs Don't Discriminate [API World Stage Talk]
Data APIs Don't Discriminate [API World Stage Talk]Data APIs Don't Discriminate [API World Stage Talk]
Data APIs Don't Discriminate [API World Stage Talk]
 
MBL201_Progressive Web Apps in the Real World
MBL201_Progressive Web Apps in the Real WorldMBL201_Progressive Web Apps in the Real World
MBL201_Progressive Web Apps in the Real World
 
Webinar_102317_Heffner.ppt
Webinar_102317_Heffner.pptWebinar_102317_Heffner.ppt
Webinar_102317_Heffner.ppt
 
APIs with Bounded Contexts: Modeling APIs with Domain-Driven Design
APIs with Bounded Contexts: Modeling APIs with Domain-Driven DesignAPIs with Bounded Contexts: Modeling APIs with Domain-Driven Design
APIs with Bounded Contexts: Modeling APIs with Domain-Driven Design
 
Scaling DevOps - delivering on the promise of business velocity and quality
Scaling DevOps - delivering on the promise of business velocity and qualityScaling DevOps - delivering on the promise of business velocity and quality
Scaling DevOps - delivering on the promise of business velocity and quality
 
Small Talk at Tsing Hua University
Small Talk at Tsing Hua UniversitySmall Talk at Tsing Hua University
Small Talk at Tsing Hua University
 
Serverless Software Architecture - Gears 17
Serverless Software Architecture - Gears 17Serverless Software Architecture - Gears 17
Serverless Software Architecture - Gears 17
 
Collaborate 18 presentation by Dayalan Punniyamoorthy
Collaborate 18 presentation by Dayalan PunniyamoorthyCollaborate 18 presentation by Dayalan Punniyamoorthy
Collaborate 18 presentation by Dayalan Punniyamoorthy
 
Product Vision and Roadmap for Anypoint Platform
Product Vision and Roadmap for Anypoint PlatformProduct Vision and Roadmap for Anypoint Platform
Product Vision and Roadmap for Anypoint Platform
 
DevSecCon Seattle 2019: Decentralized Authorization - Implementing Fine Grain...
DevSecCon Seattle 2019: Decentralized Authorization - Implementing Fine Grain...DevSecCon Seattle 2019: Decentralized Authorization - Implementing Fine Grain...
DevSecCon Seattle 2019: Decentralized Authorization - Implementing Fine Grain...
 
Decentralized Authorization
Decentralized AuthorizationDecentralized Authorization
Decentralized Authorization
 
Accelerating Your Cloud Migration Journey with MAP
Accelerating Your Cloud Migration Journey with MAPAccelerating Your Cloud Migration Journey with MAP
Accelerating Your Cloud Migration Journey with MAP
 
Getting the most from your API management platform: A case study
Getting the most from your API management platform: A case studyGetting the most from your API management platform: A case study
Getting the most from your API management platform: A case study
 
The Do's and Don'ts of Mainframe Modernization
The Do's and Don'ts of Mainframe ModernizationThe Do's and Don'ts of Mainframe Modernization
The Do's and Don'ts of Mainframe Modernization
 
規劃大規模遷移到 AWS 的最佳實踐
規劃大規模遷移到 AWS 的最佳實踐規劃大規模遷移到 AWS 的最佳實踐
規劃大規模遷移到 AWS 的最佳實踐
 
Exploring the Salesforce REST API
Exploring the Salesforce REST APIExploring the Salesforce REST API
Exploring the Salesforce REST API
 
IBM Z for the Digital Enterprise - Microservices, APIs
IBM Z for the Digital Enterprise - Microservices, APIsIBM Z for the Digital Enterprise - Microservices, APIs
IBM Z for the Digital Enterprise - Microservices, APIs
 
Governing and Sharing your Integration Assets
Governing and Sharing your Integration AssetsGoverning and Sharing your Integration Assets
Governing and Sharing your Integration Assets
 
We don’t need no stinkin app server! Building a Two-Tier Mobile App
We don’t need no stinkin app server! Building a Two-Tier Mobile AppWe don’t need no stinkin app server! Building a Two-Tier Mobile App
We don’t need no stinkin app server! Building a Two-Tier Mobile App
 

More from Two Sigma

The State of Open Data on School Bullying
The State of Open Data on School BullyingThe State of Open Data on School Bullying
The State of Open Data on School BullyingTwo Sigma
 
Halite @ Google Cloud Next 2018
Halite @ Google Cloud Next 2018Halite @ Google Cloud Next 2018
Halite @ Google Cloud Next 2018Two Sigma
 
Future of Pandas - Jeff Reback
Future of Pandas - Jeff RebackFuture of Pandas - Jeff Reback
Future of Pandas - Jeff RebackTwo Sigma
 
BeakerX - Tiezheng Li
BeakerX - Tiezheng LiBeakerX - Tiezheng Li
BeakerX - Tiezheng LiTwo Sigma
 
Engineering with Open Source - Hyonjee Joo
Engineering with Open Source - Hyonjee JooEngineering with Open Source - Hyonjee Joo
Engineering with Open Source - Hyonjee JooTwo Sigma
 
Bringing Linux back to the Server BIOS with LinuxBoot - Trammel Hudson
Bringing Linux back to the Server BIOS with LinuxBoot - Trammel HudsonBringing Linux back to the Server BIOS with LinuxBoot - Trammel Hudson
Bringing Linux back to the Server BIOS with LinuxBoot - Trammel HudsonTwo Sigma
 
Waiter: An Open-Source Distributed Auto-Scaler
Waiter: An Open-Source Distributed Auto-ScalerWaiter: An Open-Source Distributed Auto-Scaler
Waiter: An Open-Source Distributed Auto-ScalerTwo Sigma
 
Responsive and Scalable Real-time Data Analytics for SHPE 2017 - Cecilia Ye
Responsive and Scalable Real-time Data Analytics for SHPE 2017 - Cecilia YeResponsive and Scalable Real-time Data Analytics for SHPE 2017 - Cecilia Ye
Responsive and Scalable Real-time Data Analytics for SHPE 2017 - Cecilia YeTwo Sigma
 
Archival Storage at Two Sigma - Josh Leners
Archival Storage at Two Sigma - Josh LenersArchival Storage at Two Sigma - Josh Leners
Archival Storage at Two Sigma - Josh LenersTwo Sigma
 
Smooth Storage - A distributed storage system for managing structured time se...
Smooth Storage - A distributed storage system for managing structured time se...Smooth Storage - A distributed storage system for managing structured time se...
Smooth Storage - A distributed storage system for managing structured time se...Two Sigma
 
The Language of Compression - Leif Walsh
The Language of Compression - Leif WalshThe Language of Compression - Leif Walsh
The Language of Compression - Leif WalshTwo Sigma
 
Identifying Emergent Behaviors in Complex Systems - Jane Adams
Identifying Emergent Behaviors in Complex Systems - Jane AdamsIdentifying Emergent Behaviors in Complex Systems - Jane Adams
Identifying Emergent Behaviors in Complex Systems - Jane AdamsTwo Sigma
 
Algorithmic Data Science = Theory + Practice
Algorithmic Data Science = Theory + PracticeAlgorithmic Data Science = Theory + Practice
Algorithmic Data Science = Theory + PracticeTwo Sigma
 
HUOHUA: A Distributed Time Series Analysis Framework For Spark
HUOHUA: A Distributed Time Series Analysis Framework For SparkHUOHUA: A Distributed Time Series Analysis Framework For Spark
HUOHUA: A Distributed Time Series Analysis Framework For SparkTwo Sigma
 
Improving Python and Spark Performance and Interoperability with Apache Arrow
Improving Python and Spark Performance and Interoperability with Apache ArrowImproving Python and Spark Performance and Interoperability with Apache Arrow
Improving Python and Spark Performance and Interoperability with Apache ArrowTwo Sigma
 
TRIEST: Counting Local and Global Triangles in Fully-Dynamic Streams with Fix...
TRIEST: Counting Local and Global Triangles in Fully-Dynamic Streams with Fix...TRIEST: Counting Local and Global Triangles in Fully-Dynamic Streams with Fix...
TRIEST: Counting Local and Global Triangles in Fully-Dynamic Streams with Fix...Two Sigma
 
Exploring the Urban – Rural Incarceration Divide: Drivers of Local Jail Incar...
Exploring the Urban – Rural Incarceration Divide: Drivers of Local Jail Incar...Exploring the Urban – Rural Incarceration Divide: Drivers of Local Jail Incar...
Exploring the Urban – Rural Incarceration Divide: Drivers of Local Jail Incar...Two Sigma
 
Graph Summarization with Quality Guarantees
Graph Summarization with Quality GuaranteesGraph Summarization with Quality Guarantees
Graph Summarization with Quality GuaranteesTwo Sigma
 
Rademacher Averages: Theory and Practice
Rademacher Averages: Theory and PracticeRademacher Averages: Theory and Practice
Rademacher Averages: Theory and PracticeTwo Sigma
 
Credit-Implied Volatility
Credit-Implied VolatilityCredit-Implied Volatility
Credit-Implied VolatilityTwo Sigma
 

More from Two Sigma (20)

The State of Open Data on School Bullying
The State of Open Data on School BullyingThe State of Open Data on School Bullying
The State of Open Data on School Bullying
 
Halite @ Google Cloud Next 2018
Halite @ Google Cloud Next 2018Halite @ Google Cloud Next 2018
Halite @ Google Cloud Next 2018
 
Future of Pandas - Jeff Reback
Future of Pandas - Jeff RebackFuture of Pandas - Jeff Reback
Future of Pandas - Jeff Reback
 
BeakerX - Tiezheng Li
BeakerX - Tiezheng LiBeakerX - Tiezheng Li
BeakerX - Tiezheng Li
 
Engineering with Open Source - Hyonjee Joo
Engineering with Open Source - Hyonjee JooEngineering with Open Source - Hyonjee Joo
Engineering with Open Source - Hyonjee Joo
 
Bringing Linux back to the Server BIOS with LinuxBoot - Trammel Hudson
Bringing Linux back to the Server BIOS with LinuxBoot - Trammel HudsonBringing Linux back to the Server BIOS with LinuxBoot - Trammel Hudson
Bringing Linux back to the Server BIOS with LinuxBoot - Trammel Hudson
 
Waiter: An Open-Source Distributed Auto-Scaler
Waiter: An Open-Source Distributed Auto-ScalerWaiter: An Open-Source Distributed Auto-Scaler
Waiter: An Open-Source Distributed Auto-Scaler
 
Responsive and Scalable Real-time Data Analytics for SHPE 2017 - Cecilia Ye
Responsive and Scalable Real-time Data Analytics for SHPE 2017 - Cecilia YeResponsive and Scalable Real-time Data Analytics for SHPE 2017 - Cecilia Ye
Responsive and Scalable Real-time Data Analytics for SHPE 2017 - Cecilia Ye
 
Archival Storage at Two Sigma - Josh Leners
Archival Storage at Two Sigma - Josh LenersArchival Storage at Two Sigma - Josh Leners
Archival Storage at Two Sigma - Josh Leners
 
Smooth Storage - A distributed storage system for managing structured time se...
Smooth Storage - A distributed storage system for managing structured time se...Smooth Storage - A distributed storage system for managing structured time se...
Smooth Storage - A distributed storage system for managing structured time se...
 
The Language of Compression - Leif Walsh
The Language of Compression - Leif WalshThe Language of Compression - Leif Walsh
The Language of Compression - Leif Walsh
 
Identifying Emergent Behaviors in Complex Systems - Jane Adams
Identifying Emergent Behaviors in Complex Systems - Jane AdamsIdentifying Emergent Behaviors in Complex Systems - Jane Adams
Identifying Emergent Behaviors in Complex Systems - Jane Adams
 
Algorithmic Data Science = Theory + Practice
Algorithmic Data Science = Theory + PracticeAlgorithmic Data Science = Theory + Practice
Algorithmic Data Science = Theory + Practice
 
HUOHUA: A Distributed Time Series Analysis Framework For Spark
HUOHUA: A Distributed Time Series Analysis Framework For SparkHUOHUA: A Distributed Time Series Analysis Framework For Spark
HUOHUA: A Distributed Time Series Analysis Framework For Spark
 
Improving Python and Spark Performance and Interoperability with Apache Arrow
Improving Python and Spark Performance and Interoperability with Apache ArrowImproving Python and Spark Performance and Interoperability with Apache Arrow
Improving Python and Spark Performance and Interoperability with Apache Arrow
 
TRIEST: Counting Local and Global Triangles in Fully-Dynamic Streams with Fix...
TRIEST: Counting Local and Global Triangles in Fully-Dynamic Streams with Fix...TRIEST: Counting Local and Global Triangles in Fully-Dynamic Streams with Fix...
TRIEST: Counting Local and Global Triangles in Fully-Dynamic Streams with Fix...
 
Exploring the Urban – Rural Incarceration Divide: Drivers of Local Jail Incar...
Exploring the Urban – Rural Incarceration Divide: Drivers of Local Jail Incar...Exploring the Urban – Rural Incarceration Divide: Drivers of Local Jail Incar...
Exploring the Urban – Rural Incarceration Divide: Drivers of Local Jail Incar...
 
Graph Summarization with Quality Guarantees
Graph Summarization with Quality GuaranteesGraph Summarization with Quality Guarantees
Graph Summarization with Quality Guarantees
 
Rademacher Averages: Theory and Practice
Rademacher Averages: Theory and PracticeRademacher Averages: Theory and Practice
Rademacher Averages: Theory and Practice
 
Credit-Implied Volatility
Credit-Implied VolatilityCredit-Implied Volatility
Credit-Implied Volatility
 

Recently uploaded

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 

Recently uploaded (20)

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 

Principles of REST API Design

  • 1. www.twosigma.com Principles of REST API Design May 19, 2017 Presented By: Amy Wasik Two Sigma Investments, LP Important Legal Information: This document is being distributed for informational and educational purposes only and is not an offer to sell or the solicitation of an offer to buy any securities or other instruments. The information contained herein is not intended to provide, and should not be relied upon for investment advice. The views expressed herein are not necessarily the views of Two Sigma Investments, LP or any of its affiliates (collectively, “Two Sigma”). Such views reflect significant assumptions and subjective of the author(s) of the document and are subject to change without notice. The document may employ data derived from third-party sources. No representation is made as to the accuracy of such information and the use of such information in no way implies an endorsement of the source of such information or its validity. The copyrights and/or trademarks in some of the images, logos or other material used herein may be owned by entities other than Two Sigma. If so, such copyrights and/or trademarks are most likely owned by the entity that created the material and are used purely for identification and comment as fair use under international copyright and/or trademark laws. Use of such image, copyright or trademark does not imply any association with such organization (or endorsement of such organization) by Two Sigma, nor vice versa.
  • 2. Software Architecture May 19, 2017 Single Server Services REST Services
  • 3. Our Application May 19, 2017 Application Job Job Job Job Host
  • 4. Our Application May 19, 2017 Application Job Job Job Job Host Application Job Job Job Job Host Application Job Job Job Job Host Application Job Job Job Job Host Application Job Job Job Job Host Application Job Job Job Job Host Application Job Job Job Host Application Job Job Job Job Host
  • 5. Our Application May 19, 2017 Application Job Job Job Job Host Monitor Monitor Host Host
  • 6. Our Application May 19, 2017 Client API Client Client Client Host Host Host Host Scheduler Job Job Job Job Host Monitor Monitor Host Host
  • 7. Software Architecture May 19, 2017 Single Server Services REST Services
  • 8. Services Architecture May 19, 2017 • Low Coupling • Maintainable • Interoperable • Language Agnostic • Shareable • Scalable • Resilient
  • 9. Services Architecture May 19, 2017 • Low Coupling • Maintainable • Interoperable • Language Agnostic • Shareable • Scalable • Resilient Client API Client Client Client Host Host Host Host Scheduler Job Job Job Job Host Monitor Monitor Host Host
  • 10. Services Architecture May 19, 2017 • Low Coupling • Maintainable • Interoperable • Language Agnostic • Shareable • Scalable • Resilient Client API Client Client Client Host Host Host Host Scheduler Job Job Job Job Host Monitor Monitor Host Host
  • 11. Services Architecture May 19, 2017 • Low Coupling • Maintainable • Interoperable • Language Agnostic • Shareable • Scalable • Resilient High-level Javascript Low-level Client API Client Client Client Host Host Host Host Scheduler Job Job Job Job Host Monitor Monitor Host Host
  • 12. Services Architecture May 19, 2017 • Low Coupling • Maintainable • Interoperable • Language Agnostic • Shareable • Scalable • Resilient Application 2 Client API Client Client Client Host Host Host Host Scheduler Job Job Job Job Host Monitor Monitor Host Host
  • 13. Services Architecture May 19, 2017 • Low Coupling • Maintainable • Interoperable • Language Agnostic • Shareable • Scalable • Resilient Client API Client Client Client Host Host Host Host Scheduler Host Job Job Job Host Monitor Monitor Host
  • 14. Services Architecture May 19, 2017 • Low Coupling • Maintainable • Interoperable • Language Agnostic • Shareable • Scalable • Resilient Client API Client Client Client Host Host Host Host Scheduler Job Job Job Job Host Monitor Monitor Host Host
  • 15. Communication May 19, 2017 Single Server: Local API Method Calls Services: Inter-process Communication (IPC)
  • 16. Inter-Process Communication (IPC) May 19, 2017 • Remote Procedure Calls (RPC) • Use a library to convert local calls to remote ones public interface Jobsystem { Job createAJob(JobDetails details); void submitJob(Job j); List<Job> getJobs(String namePattern); List<Job> getMyJobs(String user); List<Job> getJobsOther(String query); Job getJob(int id); void updateJob(JobDetails details); }
  • 17. Software Architecture May 19, 2017 Single Server Services REST Services
  • 18. REST Architecture May 19, 2017 Additional Constraints Benefits Stateless Scalability • Representational State Transfer (REST)
  • 19. REST Architecture May 19, 2017 Additional Constraints Benefits Stateless Scalability Cacheable Increased Capacity • Representational State Transfer (REST)
  • 20. REST Architecture May 19, 2017 Additional Constraints Benefits Stateless Scalability Cacheable Increased Capacity Layered Low Coupling/Interoperability • Representational State Transfer (REST)
  • 21. REST Architecture May 19, 2017 https://martinfowler.com/articles/richardsonMaturityModel.html 4 Levels of Adherence Benefits 0 – HTTP Transport 1 – Resource Oriented Design 2 – HTTP Verbs as actions on resources 3 – Hypertext as the Engine of Application State (HATEOAS) • Representational State Transfer (REST) • API Constraints
  • 22. REST Architecture May 19, 2017 https://martinfowler.com/articles/richardsonMaturityModel.html 4 Levels of Adherence Benefits 0 – HTTP Transport Standard Interface 1 – Resource Oriented Design Easier-to-Use API 2 – HTTP Verbs as actions on resources Complete API 3 – Hypertext as the Engine of Application State (HATEOAS) Easy-to-Learn API • Representational State Transfer (REST) • API Constraints
  • 23. REST Level 0 May 19, 2017 HTTP Transport  Readable object encoding (typically JSON)  Standard URI format
  • 24. Level 0: RPC over HTTP May 19, 2017 public interface Jobsystem { Job createAJob(JobDetails details); void submitJob(Job j); List<Job> getJobs(String namePattern); List<Job> getMyJobs(String user); List<Job> getJobsOther(String query); Job getJob(int id); void updateJob(JobDetails details); } GET http://example.com/createAJob?name=t&... GET http://example.com/submitJob?id=123 GET http://example.com/getJobs?name=test GET http://example.com/getMyJobs?user=me GET http://example.com/getJobs?query=... GET http://example.com/getJob?id=123 GET http://example.com/updateJob?id=123&
  • 25. Level 0: RPC over HTTP May 19, 2017 GET http://example.com/createAJob?name=t&user=userA... HTTP/1.1 200 OK [other headers] { "id": 123 } GET http://example.com/submitJob?id=123 HTTP/1.1 200 OK [other headers] { "error" : "no permission" }
  • 26. REST Level 1 May 19, 2017 Resource Oriented Design • Divide and conquer • Easy to understand and navigate API Standard URI Format • /{resource} • /{resource}/{resource-id} • /{resource}/{resource-id}/{sub-resource} • /{resource}/{resource-id}/{sub-resource}/{sub-resource-id}
  • 27. Object Oriented Design May 19, 2017 GET http://example.com/createAJob?name= GET http://example.com/submitJob?id=12 GET http://example.com/getJobs?name= GET http://example.com/getMyJobs?user= GET http://example.com/getJobs?query= GET http://example.com/getJob?id=123 GET http://example.com/updateJob?id=123 GET http://example.com/jobs/create?name=t&user=me GET http://example.com/jobs/get?name=test GET http://example.com/jobs/getMy?user=me GET http://example.com/jobs/get?query=... GET http://example.com/jobs/123 GET http://example.com/jobs/123/update?name=t2... GET http://example.com/jobs/123/instances/start GET http://example.com/jobs/123/instances
  • 28. REST Level 2 May 19, 2017 HTTP Verbs Represent Actions • More complete and structured APIs Common Verbs • GET – Read (Nullipotent) • PUT – Update (Idempotent) • POST - Create • DELETE – Remove (Idempotent)
  • 29. REST Level 2 May 19, 2017 Standard HTTP Response Codes • Standard results of actions Success Client Error Server Error 200 OK 400 Bad Request 500 Internal Server Error 201 Created 401 Unauthorized (authentication failure) 204 No Content 403 Forbidden (not allowed access) 404 Not Found
  • 30. HTTP Verbs for Actions May 19, 2017 GET http://example.com/jobs/create?name=t&user=me GET http://example.com/jobs/get?name=test GET http://example.com/jobs/getMy?user=me GET http://example.com/jobs/get?query=... GET http://example.com/jobs/123 GET http://example.com/jobs/123/update?name=t2... GET http://example.com/jobs/123/instances/start GET http://example.com/jobs/123/instances POST http://example.com/jobs -d '{"name":"test", "user": "me", …}' GET http://example.com/jobs?name=test GET http://example.com/jobs?user=me GET http://example.com/jobs?query=... GET http://example.com/jobs/123 PUT http://example.com/jobs/123 -d '{"name":"job" …}' POST http://example.com/jobs/123/instances GET http://example.com/jobs/123/instances
  • 31. HTTP Verbs for Actions May 19, 2017 POST http://example.com/jobs -d '{"name":"test", "user": "me", …}' HTTP/1.1 201 Created [other headers] { "id": 123 } POST http://example.com/jobs/123/instances HTTP/1.1 403 Forbidden [other headers] { "errorCode" : 10, "moreInfo" : "no permission to run this job" }
  • 32. REST Level 3 May 19, 2017 REST API Documentation and API Discoverability • Hypertext As The Engine Of Application State (HATEOAS) — Adds links to response that indicate useful actions • Open API — Provides language-agnostic way to describe REST API — Lots of tooling for automation
  • 35. Evolution of the API May 19, 2017 public interface Jobsystem { Job createAJob(JobDetails details); void submitJob(Job j); List<Job> getJobs(String namePattern); List<Job> getMyJobs(String user); List<Job> getJobsOther(String query); Job getJob(int id); void updateJob(JobDetails details); }
  • 36. Evolution of the API May 19, 2017
  • 37. Conclusion May 19, 2017 • Modern day best practices • Services architectures • REST APIs • Resource Oriented Design • Self-documenting code • Next steps • Evolving APIs • Complex operations • Error handling, Standard response types
  • 38. Additional Resources May 19, 2017 http://swagger.io/ https://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm https://martinfowler.com/articles/richardsonMaturityModel.html Published API Guides: https://pages.apigee.com/rs/apigee/images/api-design-ebook-2012-03.pdf https://github.com/paypal/api-standards/blob/master/api-style-guide.md https://cloud.google.com/apis/design/ Thank you!

Editor's Notes

  1. Do you consider yourself a programmer, scientist, architect, designer, writer? We have many roles and titles but what we all have in common is that we like to use technology to solve challenging problems. Introduce - Myself – undergrad and masters in computer science, then came to Two Sigma – a technology company that does finance Worked on many levels of software, from low level performance tuning, beautiful Uis, to looking at software from higher level architecture Now work on our platform for building, deploying, and managing services, and some generally useful services such as the one I’m going to describe now
  2. Looking at software from a high level we talk about the software architecture – how the app is designed In college you build apps that run on a single server. In this talk I’ll take you through the why and how you go from that single server app to a services architecture which is what you commonly see in industry, to a REST services architecture which is what I call beauty.
  3. Example: Our application runs jobs on a schedule. A job is a program that runs for a short to medium time on the order of minutes to hours and can span from everything from downloading, processing and transforming data, generating reports, starting and priming critical systems, and running all kinds of verification data and system checks. Typically you start with an application as a single program that you run on a single machine But then you realize you have problems- It gets really popular or big and can’t fit on one machine You could replicate this over a second machine and have one type of jobs on each and remember where they all are. This gets annoying when you have 10 machines and have 10 interactive terminals open to each. It gets impossible when you have 1000 machines.
  4. You could replicate this over a second machine and have one type of jobs on each and remember where they all are. This gets annoying when you have 10 machines and have 10 interactive terminals open to each. It gets impossible when you have 1000 machines. At TS we run 100s of thousands of jobs a day on 1Ks of machines.
  5. So you start to break out different pieces of the software to run on separate machines and with multiple copies Now we can interact with one application and it knows how to interact with jobs on all our machines.
  6. And we may want to separate the part that interacts with the processes and that part that interact with clients. Oh and it’s nice to have a browser interface so the client is actually running in a browser on the user machine.
  7. This is called a services software architecture
  8. It has many benefits…
  9. Low coupling: few interaction points between different components strongly enforced interfaces Makes your system less complex Eg. when running the app on one host you could make assumptions about the host your tasks run on, the location of certain files, etc. this can be very brittle and error prone, separating the interfaces across hosts makes it very difficult or impossible to get around the interface and make bad assumptions
  10. Maintainable: can upgrade each piece independently Interoperable: can easily replace each piece independently
  11. Language agnostic: can write different pieces in different languages
  12. Shareable: can reuse service components with other apps
  13. Scalable: can scale each piece independently
  14. Resilient: can provide degraded functionality in cases of failure Lots of moving pieces, means more complexity.
  15. Services architecture brings in new complications, one of them being Inter process communication, which I’ll focus on.
  16. How do the different components pass data and state around? Basic approach is RPC make a call as you would normally to another object We thought RPC was the answer to make it easy and transparent you were in a services architecture Problem: You have to know how to deal with failures, which don't exist in local calls Not opinionated to get full benefits of services architecture No structure can lead to spaghetti code
  17. The answer is REST
  18. REST Adds more constraints to IPC that helps you design your API to gain the benefits of Services 3 Constraints on the communication Stateless - no client state is stored on the server, all information for a request is passed in the request, eg. can’t support a call like nextLine Makes it so you can scale
  19. Cacheable - responses must state themselves as cacheable or not, clients and intermediaries may cache results
  20. Layered - clients may not be directly connected to server, and neither should care
  21. Additionally there are constraints on the API – these are not always followed, but modern implementations use this as a way to define how "RESTful" an API is A model (developed by Leonard Richardson - RMM defines different levels of adherence to REST principles in the implementation Each of these are additive
  22. REST APIs can follow any level of these, and even within these there are best practices. The more adherence to these levels and best practices, the more beautiful your API Like making music in an orchestra the constraints allow us to be creative within a framework that helps us easily make beautiful music. We’ll look at them in more detail next
  23. Level 0 HTTP as a transport is a common standard, lots of standard tooling, using standard readable text formats like JSON makes it easy to debug and test in a browser or using basic curl commands Standards for how to access the methods, read the data, and understand responses HTTP is a long lasting standard. RPC libraries and protocols come and go, HTTP stands the test of time.
  24. Level 0 is also sometimes called RPC over HTTP. It is not very RESTful
  25. Level 0 is also sometimes called RPC over HTTP. It is not very RESTful
  26. Level 1 tackles the question of handling complexity by using divide and conquer, breaking a large service endpoint down into multiple resources. Splitting the API into a hierarchy of resources makes each of the sections small, simple and easier to navigate The API is split using a URI hierarchy with common best practices for how to structure it
  27. Think of your resources as concepts you can take action on. They often map to tables in a database, but don’t necessarily. Especially if you map transient transactions as a resource. For example, we can think of a job as two separate resources, one is the job definition, and one is the job instance, a specific run of the job definition There are common URI structures that are best practices rather than enforced
  28. Level 2 introduces a standard set of verbs so that we handle similar situations in the same way, removing unnecessary variation. Usage the HTTP verbs to represent the action rather than random names in the URI Verbs have useful meanings, mostly obvious GET read or retrieve a resource. Nullipotent - GET requests have no side effects. PUT is idempotent – used for update a resource or update or add if not found (if client provides ID) POST create new resources. POST assigns an ID to the new resource. POST is not idempotent. Two identical POST requests will result in two resources with same information. DELETE is used to delete a resource, if already deleted can return 204 The side effects of these actions are really useful for clients in how to handle errors
  29. Common response codes
  30. Now we can really clean up our API
  31. Now we can really clean up our API
  32. Level 3 introduces discoverability, providing a way of making a protocol more self-documenting. Most don’t follow HATEOS, alternative with same benefit of discoverability is Open API, FKA Swagger Language agnostic way to describe REST APIs in a YAML or JSON text file Why OpenAPI? Provides an alternative easy to write/read way to document your API in its entirety Lots of tooling for automating server and client code generation, and visualizing documentation
  33. As a reminder we started with this… Used to think APIs were from computers
  34. … to this But really they're for humans. A more complete, well thought out, easy to navigate, easy to learn about, and easy to use from anywhere API
  35. What we’ve learned – some modern day best practices There is more we don’t have time to go into about conventions of best practices in REST API design including Standards for naming conventions of resources and handling complex operations Standard ways to return error responses with more context and detailed messages Standards for returning common complex objects such as lists and pages of items