SlideShare a Scribd company logo
Designing and Managing
Scalable APIs with
AWS and 3scale
Matthew McClean, @matthewmcclean
Nicolas Grenié, @picsoung
Manfred, @ManfredBo
Workshop logistics:
bit.ly/API-workshop (GH repo)
AWS and 3scale accounts:
3scale.net/aws-loft/
Prerequisites:
● AWS CLI
● Java 1.8
● Maven
● Node.js
● Serverless.com framework
Content
1. API Design Best-Practices
○ API design principles
○ Practical tips
○ API definitions
2. AWS Services
○ Amazon API Gateway
○ AWS Lambda
3. 3scale API Management
○ Amazon API Gateway and 3scale integration
○ Customer Case Study: Rosette API
Content
1. API Design Best-Practices
○ API design principles
○ Practical tips
○ API definitions
2. AWS Services
○ Amazon API Gateway
○ AWS Lambda
3. 3scale API Management
○ Amazon API Gateway and 3scale integration
○ Customer Case Study: Rosette API
First API Design Principle
Design the API with the developer in mind
...because developers are people too.
Provide outstanding developer experience.
Make developers successful
...and they make you successful.
Img Src: http://dx.jeremiahlee.com/
API Design vs Resource Design
Resources are nucleus of REST API design.
A resource is an abstraction of a certain piece of
information.
The selection of resources depends on business domain
and developer needs.
Fine-grained vs coarse-grained selection of resources.
APIs are operations on the resources.
Fine-grained vs coarse-grained API Design
Simple vs flexible
Fine-grained vs coarse-grained API Design
Respect the HTTP standard
Verb Endpoint What for
GET /book/{book_id} Retrieve details of a resource
POST /book Create resource
DELETE /book/{book_id} Delete resource
PUT /book/{book_id} Update or create resource
PATCH /book/{book_id} Update partial resource
OPTIONS any URL return methods supported on
this URL
TRACE any URL Echoes
CONNECT any URL Convert to TCP/IP tunnel
HEAD /book/{book_id} Same as GET w/o response
body
Design - HTTP code
Design - HTTP code
Design - HTTP code
Source: https://http.cat/
Design - HTTP code
Design - HTTP code
Custom error? Create your own.
it should not be already defined in the spec
1xx Informational
2xx Success
3xx Redirection
4xx Client error
5xx Server error
document it !!
Design - URLs
Be explicit and intuitive
GET /books - Retrieves a list of books
GET /books/42 - Retrieves a specific book
POST /books - Creates a new book
PUT /books/42 - Updates book #42
PATCH /books/42 - Partially updates book #42
DELETE /books/42 - Deletes book #42
Singular or plural? keep it simple
Design - Versioning
Following software analogy
API should be versionated v1 , v1.1, v2.0
curl -X GET -H “X-API-VERSION: 1.1” 
http://mysite.com/api/books.json
http://mysite.com/api/v1/books.json
http://mysite.com/api/v1.1/books.json
http://mysite.com/api/books.json?v=1.1
Design - Versioning
How often are you going to change
version?
What about people already using your
API?
How many versions will you keep maintaining?
What’s the roadmap?
Design - Versioning
Don’t explicitly version your API
non breaking changes
no version = flexibility = win
API Definition Formats
Support (API) design-first approaches
Benefits:
● Language-agnostic API description
● Human- and machine-readable
● Understand capability without source code
● API discovery
● Interactive documentation
Most common OpenAPI (born out of Swagger)
OpenAPI? Swagger?
API description spec contains:
● Endpoints
● Parameters
● Expected inputs, outputs
Machine readable:
● Automate testing
● Interactive documentation
● SDK generation
Petstore
Example
Supported by the industry
Tooling
Content
1. API Design Best-Practices
○ API design principles
○ Practical tips
○ API definitions
2. AWS Services
○ Amazon API Gateway
○ AWS Lambda
3. 3scale API Management
○ Amazon API Gateway and 3scale integration
○ Customer Case Study: Rosette API
AWS Part by Matthew...
Content
1. API Design Best-Practices
○ API design principles
○ Practical tips
○ API definitions
2. AWS Services
○ Amazon API Gateway
○ AWS Lambda
3. 3scale API Management
○ Amazon API Gateway and 3scale integration
○ Customer Case Study: Rosette API
3scale API Management
3scale and API Gateway Integration
API workshop by AWS and 3scale
How to achieve the Integration
API deployed
on API Gateway
3scale
Custom
Authorizer
functions
Cache API key to
reduce latency
framework
To deploy
Lambda
functions
SNS used for async
update of cache
Serverless module for easy configuration
Community framework to build, deploy and maintain Lambda functions
Clone our repo and deploy functions on your own infrastructure
serverless function create
serverless function deploy
Hosted API Rollout with 3Scale
Gregor Stewart, Basis Technology
@olakrez
Rosette Users
33
What Rosette Does
34
35
Design
36
Minimise effort to support Hosted and In a Box deployment
● Develop “in a box” first, add 3Scale to deliver Hosted
● From “RPC” to API: Entities
○ Three Components, represented by two Endpoints
○ Reduced to a single endpoint, with options
○ Common options across entity-centric endpoints
○ Separately documented option blob and output type to enable
full control
● Explicit Versioning
37
● Server-based
● Custom NGINX
● Specialised
Workers in Auto
Scale Groups
● Integrated Caching
and Queuing
● Security Focused
Implementation
Challenges and Next Steps
38
● Stateless to Stateful Endpoints
● Further “idiomatising” hosted implementation to AWS
○ Moving cache outside to service
○ Porting suitable functions to Lambda
■ LanguageID vs Entity Linking
Try it at: developer.rosette.com
Gregor Stewart, Basis Technology
@olakrez
Wrap-up
Successful API starts with good API design.
Lambda is an effective way to implement APIs.
Amazon API Gateway adds crucial API security features.
Serverless allows to configure and deploy Lambda easily.
3scale adds valuable API business features.
AWS and 3scale provide a full complement API
program management solution.
Lab overview
1. Create and deploy an API using the Amazon API
Gateway and AWS Lambda
2. Integrate with 3scale to add API management features
3. Create tiered application plans with different API
contracts (Optional)
4. Expose your API to developers with a developer portal
and interactive API documentation (Optional)
Github repo: bit.ly/API-workshop
Contact Details
Nico
nicolas@3scale.net
@picsoung
www.3scale.net
Manfred
manfred@3scale.net
@ManfredBo
bit.ly/API-workshop

More Related Content

What's hot (20)

PDF
클라우드 세상에서 살아남기: 금융편 - 이한주 대표이사/공동창업자, 베스핀 글로벌 / 김민성 팀장, KB국민카드 :: AWS Summit ...
Amazon Web Services Korea
 
PDF
[WhaTap DevOps Day] 세션 5 : 금융 Public 클라우드/ Devops 구축 여정
WhaTap Labs
 
PDF
[CTO Night & Day 2019] グローバルのサービス展開に向けたマルチリージョンアーキテクチャ- #ctonight
Amazon Web Services Japan
 
PDF
APIsecure 2023 - API orchestration: to build resilient applications, Cherish ...
apidays
 
PDF
마이크로 서비스를 위한 AWS Cloud Map & App Mesh - Saeho Kim (AWS Solutions Architect)
Amazon Web Services Korea
 
PDF
Kubernetes Intro
Antonio Ojea Garcia
 
PDF
An intro to Kubernetes operators
J On The Beach
 
PDF
AWS 클라우드로 천만명 웹 서비스 확장하기 - 윤석찬 백승현 - AWS Summit 2016
Amazon Web Services Korea
 
PDF
AWS와 함께 하는 클라우드 컴퓨팅 - 홍민우 AWS 매니저
Amazon Web Services Korea
 
PPTX
Apache Kafka - Patterns anti-patterns
Florent Ramiere
 
PDF
Amazon EC2 고급 활용 기법 및 모범 사례::이진욱::AWS Summit Seoul 2018
Amazon Web Services Korea
 
PPTX
Deep-Dive: Secure API Management
Apigee | Google Cloud
 
PDF
Architectures for open and scalable clouds
Randy Bias
 
PDF
Container Security
Jie Liau
 
PDF
What Is Spring?
VMware Tanzu
 
PDF
다양한 솔루션으로 만들어가는 AWS 네트워크 보안::이경수::AWS Summit Seoul 2018
Amazon Web Services Korea
 
PDF
Kubernetes: A Short Introduction (2019)
Megan O'Keefe
 
PPTX
Docker Container Security
Suraj Khetani
 
PDF
AWS로 게임의 공통 기능 개발하기! - 채민관, 김민석, 한준식 :: AWS Game Master 온라인 세미나 #2
Amazon Web Services Korea
 
PPTX
Microservices With Istio Service Mesh
Natanael Fonseca
 
클라우드 세상에서 살아남기: 금융편 - 이한주 대표이사/공동창업자, 베스핀 글로벌 / 김민성 팀장, KB국민카드 :: AWS Summit ...
Amazon Web Services Korea
 
[WhaTap DevOps Day] 세션 5 : 금융 Public 클라우드/ Devops 구축 여정
WhaTap Labs
 
[CTO Night & Day 2019] グローバルのサービス展開に向けたマルチリージョンアーキテクチャ- #ctonight
Amazon Web Services Japan
 
APIsecure 2023 - API orchestration: to build resilient applications, Cherish ...
apidays
 
마이크로 서비스를 위한 AWS Cloud Map & App Mesh - Saeho Kim (AWS Solutions Architect)
Amazon Web Services Korea
 
Kubernetes Intro
Antonio Ojea Garcia
 
An intro to Kubernetes operators
J On The Beach
 
AWS 클라우드로 천만명 웹 서비스 확장하기 - 윤석찬 백승현 - AWS Summit 2016
Amazon Web Services Korea
 
AWS와 함께 하는 클라우드 컴퓨팅 - 홍민우 AWS 매니저
Amazon Web Services Korea
 
Apache Kafka - Patterns anti-patterns
Florent Ramiere
 
Amazon EC2 고급 활용 기법 및 모범 사례::이진욱::AWS Summit Seoul 2018
Amazon Web Services Korea
 
Deep-Dive: Secure API Management
Apigee | Google Cloud
 
Architectures for open and scalable clouds
Randy Bias
 
Container Security
Jie Liau
 
What Is Spring?
VMware Tanzu
 
다양한 솔루션으로 만들어가는 AWS 네트워크 보안::이경수::AWS Summit Seoul 2018
Amazon Web Services Korea
 
Kubernetes: A Short Introduction (2019)
Megan O'Keefe
 
Docker Container Security
Suraj Khetani
 
AWS로 게임의 공통 기능 개발하기! - 채민관, 김민석, 한준식 :: AWS Game Master 온라인 세미나 #2
Amazon Web Services Korea
 
Microservices With Istio Service Mesh
Natanael Fonseca
 

Viewers also liked (20)

PPTX
The Fundamentals of Platform Strategy: Creating Genuine Value with APIs
3scale
 
PPTX
How to Survive the API Copyright Apocalypse
3scale
 
PPTX
Take Control of your APIs in a Microservice Architecture
3scale
 
PDF
Inside mind of a successful platform architect / Gartner APPS 2016
3scale
 
PDF
Build and Manage Serverless APIs (APIDays Nordic, May 19th 2016)
3scale
 
PPTX
A Connector, A Container and an API Walk Into a Bar: The Programmable World
3scale
 
PDF
APIs and the Bot Revolution (APIDays Nordic, May 18)
3scale
 
PPTX
Entering the Platform Age: How to create genuine value for internal and exter...
3scale
 
PPTX
The Swagger Format becomes the Open API Specification: Standardizing descript...
3scale
 
PDF
The API-Application Semantic Gap
3scale
 
PPTX
Microservices in action: How to actually build them
3scale
 
PDF
An Introduction to the WSO2 API Manager
WSO2
 
PPTX
Integrating, exposing and managing distributed data with RESTful APIs and op...
3scale
 
PDF
APIsBerlin 3scale Data for a Web of APIs
3scale
 
PDF
WSO2 API Manager 2.0 - Overview
Edgar Silva
 
PDF
WSO2Con USA 2017: Providing a Pathway from Stovepipe Systems to a Secure SOA ...
WSO2
 
PPTX
API Model Canvas (APIDays Mediterranea 2015)
3scale
 
PDF
WSO2Con USA 2017: WSO2 Partner Program – Engaging with WSO2
WSO2
 
PDF
WSO2Con USA 2017: Integrating Systems for University of Exeter using Zero and...
WSO2
 
PDF
WSO2Con USA 2017: Building a Successful Delivery Team for Customer Success
WSO2
 
The Fundamentals of Platform Strategy: Creating Genuine Value with APIs
3scale
 
How to Survive the API Copyright Apocalypse
3scale
 
Take Control of your APIs in a Microservice Architecture
3scale
 
Inside mind of a successful platform architect / Gartner APPS 2016
3scale
 
Build and Manage Serverless APIs (APIDays Nordic, May 19th 2016)
3scale
 
A Connector, A Container and an API Walk Into a Bar: The Programmable World
3scale
 
APIs and the Bot Revolution (APIDays Nordic, May 18)
3scale
 
Entering the Platform Age: How to create genuine value for internal and exter...
3scale
 
The Swagger Format becomes the Open API Specification: Standardizing descript...
3scale
 
The API-Application Semantic Gap
3scale
 
Microservices in action: How to actually build them
3scale
 
An Introduction to the WSO2 API Manager
WSO2
 
Integrating, exposing and managing distributed data with RESTful APIs and op...
3scale
 
APIsBerlin 3scale Data for a Web of APIs
3scale
 
WSO2 API Manager 2.0 - Overview
Edgar Silva
 
WSO2Con USA 2017: Providing a Pathway from Stovepipe Systems to a Secure SOA ...
WSO2
 
API Model Canvas (APIDays Mediterranea 2015)
3scale
 
WSO2Con USA 2017: WSO2 Partner Program – Engaging with WSO2
WSO2
 
WSO2Con USA 2017: Integrating Systems for University of Exeter using Zero and...
WSO2
 
WSO2Con USA 2017: Building a Successful Delivery Team for Customer Success
WSO2
 
Ad

Similar to API workshop by AWS and 3scale (20)

PDF
API Gateway report
Gleicon Moraes
 
PDF
Api design best practice
Red Hat
 
PDF
Designing Usable APIs featuring Forrester Research, Inc.
CA API Management
 
PPT
Creating a World-Class RESTful Web Services API
David Keener
 
PPTX
Building a REST API for Longevity
MuleSoft
 
PPTX
AWS Summit Barcelona 2015 - Introducing Amazon API Gateway
Vadim Zendejas
 
PPTX
Api Design
Jason Harmon
 
PDF
MuleSoft Surat Meetup#39 - Pragmatic API Led Connectivity
Jitendra Bafna
 
PDF
The ultimate api checklist by Blendr.io
Blendr.io
 
PDF
Apply API Governance to RESTful Service APIs using WSO2 Governance Registry a...
WSO2
 
PDF
Aws Technical Day 2015 - Amazon API Gateway
aws-marketing-il
 
PDF
"API Design: From User Need to Finished Spec" by Andrew Jordan, ex-Product @T...
TheFamily
 
DOCX
Fundamental essentials for api design
Michael James Cyrus
 
DOCX
Fundamental essentials for api design
Michael James Cyrus
 
DOCX
Fundamental Essentials for API Design
Michael James Cyrus
 
PDF
Modern REST API design principles and rules.pdf
Aparna Sharma
 
PDF
Modern REST API design principles and rules.pdf
Aparna Sharma
 
PDF
Open Ap Is State Of The Market
ConSanFrancisco123
 
PPTX
AWS User Group - Survey Results and Building APIs on AWS
Sebastian Krueger
 
PDF
Web API Design: Crafting Interfaces that Developers Love
Jamison K. Bell | OvenPOP 360
 
API Gateway report
Gleicon Moraes
 
Api design best practice
Red Hat
 
Designing Usable APIs featuring Forrester Research, Inc.
CA API Management
 
Creating a World-Class RESTful Web Services API
David Keener
 
Building a REST API for Longevity
MuleSoft
 
AWS Summit Barcelona 2015 - Introducing Amazon API Gateway
Vadim Zendejas
 
Api Design
Jason Harmon
 
MuleSoft Surat Meetup#39 - Pragmatic API Led Connectivity
Jitendra Bafna
 
The ultimate api checklist by Blendr.io
Blendr.io
 
Apply API Governance to RESTful Service APIs using WSO2 Governance Registry a...
WSO2
 
Aws Technical Day 2015 - Amazon API Gateway
aws-marketing-il
 
"API Design: From User Need to Finished Spec" by Andrew Jordan, ex-Product @T...
TheFamily
 
Fundamental essentials for api design
Michael James Cyrus
 
Fundamental essentials for api design
Michael James Cyrus
 
Fundamental Essentials for API Design
Michael James Cyrus
 
Modern REST API design principles and rules.pdf
Aparna Sharma
 
Modern REST API design principles and rules.pdf
Aparna Sharma
 
Open Ap Is State Of The Market
ConSanFrancisco123
 
AWS User Group - Survey Results and Building APIs on AWS
Sebastian Krueger
 
Web API Design: Crafting Interfaces that Developers Love
Jamison K. Bell | OvenPOP 360
 
Ad

More from 3scale (16)

PDF
APISTRAT KEYNOTE: Surfing the Wave between Chaos and Innovation
3scale
 
PPTX
A Connector, A Container and an API Walk into a Bar… Microservices Edition
3scale
 
PPTX
APIs and the Creation of Wealth in the Digital Economy - APIDays Paris 2015 K...
3scale
 
PPTX
API Model Canvas for successful API strategies and programs
3scale
 
PPTX
Building Successful API Programs in Higher Education
3scale
 
PPTX
APIs.JSON: Bootstrapping The Web of APIs
3scale
 
PDF
Kill the fail whale for your API
3scale
 
PDF
API as a Growth Tool
3scale
 
PDF
Enhance Mobile Dev with APItools
3scale
 
PDF
APIs for your Business + Stages of the API Lifecycle
3scale
 
PPTX
Changing the Face of Transport via APIs. Talk at APIDays Paris 2014
3scale
 
PPTX
If data is the new oil, then interfaces are the new delivery means -- Ignite ...
3scale
 
PPTX
APIs and Unlocking the Value of Your Data - Strata Barcelona 2014
3scale
 
PPTX
API Integration with APItools.com
3scale
 
PDF
Building Hypermedia APIs in JavaScript
3scale
 
PPTX
API Management Workshop (at Startupbootcamp Berlin)
3scale
 
APISTRAT KEYNOTE: Surfing the Wave between Chaos and Innovation
3scale
 
A Connector, A Container and an API Walk into a Bar… Microservices Edition
3scale
 
APIs and the Creation of Wealth in the Digital Economy - APIDays Paris 2015 K...
3scale
 
API Model Canvas for successful API strategies and programs
3scale
 
Building Successful API Programs in Higher Education
3scale
 
APIs.JSON: Bootstrapping The Web of APIs
3scale
 
Kill the fail whale for your API
3scale
 
API as a Growth Tool
3scale
 
Enhance Mobile Dev with APItools
3scale
 
APIs for your Business + Stages of the API Lifecycle
3scale
 
Changing the Face of Transport via APIs. Talk at APIDays Paris 2014
3scale
 
If data is the new oil, then interfaces are the new delivery means -- Ignite ...
3scale
 
APIs and Unlocking the Value of Your Data - Strata Barcelona 2014
3scale
 
API Integration with APItools.com
3scale
 
Building Hypermedia APIs in JavaScript
3scale
 
API Management Workshop (at Startupbootcamp Berlin)
3scale
 

Recently uploaded (20)

PPTX
PE introd.pptxfrgfgfdgfdgfgrtretrt44t444
nepmithibai2024
 
PPTX
Orchestrating things in Angular application
Peter Abraham
 
PPTX
L1A Season 1 ENGLISH made by A hegy fixed
toszolder91
 
PDF
𝐁𝐔𝐊𝐓𝐈 𝐊𝐄𝐌𝐄𝐍𝐀𝐍𝐆𝐀𝐍 𝐊𝐈𝐏𝐄𝐑𝟒𝐃 𝐇𝐀𝐑𝐈 𝐈𝐍𝐈 𝟐𝟎𝟐𝟓
hokimamad0
 
DOCX
Custom vs. Off-the-Shelf Banking Software
KristenCarter35
 
PDF
Azure_DevOps introduction for CI/CD and Agile
henrymails
 
PDF
The Internet - By the numbers, presented at npNOG 11
APNIC
 
PPTX
L1A Season 1 Guide made by A hegy Eng Grammar fixed
toszolder91
 
PPTX
04 Output 1 Instruments & Tools (3).pptx
GEDYIONGebre
 
PPT
Agilent Optoelectronic Solutions for Mobile Application
andreashenniger2
 
PPTX
internet básico presentacion es una red global
70965857
 
PPTX
法国巴黎第二大学本科毕业证{Paris 2学费发票Paris 2成绩单}办理方法
Taqyea
 
PPTX
ONLINE BIRTH CERTIFICATE APPLICATION SYSYTEM PPT.pptx
ShyamasreeDutta
 
PDF
Build Fast, Scale Faster: Milvus vs. Zilliz Cloud for Production-Ready AI
Zilliz
 
PPTX
原版西班牙莱昂大学毕业证(León毕业证书)如何办理
Taqyea
 
PPTX
PM200.pptxghjgfhjghjghjghjghjghjghjghjghjghj
breadpaan921
 
PPT
introduction to networking with basics coverage
RamananMuthukrishnan
 
PPTX
Optimization_Techniques_ML_Presentation.pptx
farispalayi
 
PDF
AI_MOD_1.pdf artificial intelligence notes
shreyarrce
 
PPTX
Presentation3gsgsgsgsdfgadgsfgfgsfgagsfgsfgzfdgsdgs.pptx
SUB03
 
PE introd.pptxfrgfgfdgfdgfgrtretrt44t444
nepmithibai2024
 
Orchestrating things in Angular application
Peter Abraham
 
L1A Season 1 ENGLISH made by A hegy fixed
toszolder91
 
𝐁𝐔𝐊𝐓𝐈 𝐊𝐄𝐌𝐄𝐍𝐀𝐍𝐆𝐀𝐍 𝐊𝐈𝐏𝐄𝐑𝟒𝐃 𝐇𝐀𝐑𝐈 𝐈𝐍𝐈 𝟐𝟎𝟐𝟓
hokimamad0
 
Custom vs. Off-the-Shelf Banking Software
KristenCarter35
 
Azure_DevOps introduction for CI/CD and Agile
henrymails
 
The Internet - By the numbers, presented at npNOG 11
APNIC
 
L1A Season 1 Guide made by A hegy Eng Grammar fixed
toszolder91
 
04 Output 1 Instruments & Tools (3).pptx
GEDYIONGebre
 
Agilent Optoelectronic Solutions for Mobile Application
andreashenniger2
 
internet básico presentacion es una red global
70965857
 
法国巴黎第二大学本科毕业证{Paris 2学费发票Paris 2成绩单}办理方法
Taqyea
 
ONLINE BIRTH CERTIFICATE APPLICATION SYSYTEM PPT.pptx
ShyamasreeDutta
 
Build Fast, Scale Faster: Milvus vs. Zilliz Cloud for Production-Ready AI
Zilliz
 
原版西班牙莱昂大学毕业证(León毕业证书)如何办理
Taqyea
 
PM200.pptxghjgfhjghjghjghjghjghjghjghjghjghj
breadpaan921
 
introduction to networking with basics coverage
RamananMuthukrishnan
 
Optimization_Techniques_ML_Presentation.pptx
farispalayi
 
AI_MOD_1.pdf artificial intelligence notes
shreyarrce
 
Presentation3gsgsgsgsdfgadgsfgfgsfgagsfgsfgzfdgsdgs.pptx
SUB03
 

API workshop by AWS and 3scale

  • 1. Designing and Managing Scalable APIs with AWS and 3scale Matthew McClean, @matthewmcclean Nicolas Grenié, @picsoung Manfred, @ManfredBo
  • 2. Workshop logistics: bit.ly/API-workshop (GH repo) AWS and 3scale accounts: 3scale.net/aws-loft/ Prerequisites: ● AWS CLI ● Java 1.8 ● Maven ● Node.js ● Serverless.com framework
  • 3. Content 1. API Design Best-Practices ○ API design principles ○ Practical tips ○ API definitions 2. AWS Services ○ Amazon API Gateway ○ AWS Lambda 3. 3scale API Management ○ Amazon API Gateway and 3scale integration ○ Customer Case Study: Rosette API
  • 4. Content 1. API Design Best-Practices ○ API design principles ○ Practical tips ○ API definitions 2. AWS Services ○ Amazon API Gateway ○ AWS Lambda 3. 3scale API Management ○ Amazon API Gateway and 3scale integration ○ Customer Case Study: Rosette API
  • 5. First API Design Principle Design the API with the developer in mind ...because developers are people too. Provide outstanding developer experience. Make developers successful ...and they make you successful. Img Src: http://dx.jeremiahlee.com/
  • 6. API Design vs Resource Design Resources are nucleus of REST API design. A resource is an abstraction of a certain piece of information. The selection of resources depends on business domain and developer needs. Fine-grained vs coarse-grained selection of resources. APIs are operations on the resources.
  • 7. Fine-grained vs coarse-grained API Design Simple vs flexible
  • 9. Respect the HTTP standard
  • 10. Verb Endpoint What for GET /book/{book_id} Retrieve details of a resource POST /book Create resource DELETE /book/{book_id} Delete resource PUT /book/{book_id} Update or create resource PATCH /book/{book_id} Update partial resource OPTIONS any URL return methods supported on this URL TRACE any URL Echoes CONNECT any URL Convert to TCP/IP tunnel HEAD /book/{book_id} Same as GET w/o response body
  • 13. Design - HTTP code Source: https://http.cat/
  • 15. Design - HTTP code Custom error? Create your own. it should not be already defined in the spec 1xx Informational 2xx Success 3xx Redirection 4xx Client error 5xx Server error document it !!
  • 16. Design - URLs Be explicit and intuitive GET /books - Retrieves a list of books GET /books/42 - Retrieves a specific book POST /books - Creates a new book PUT /books/42 - Updates book #42 PATCH /books/42 - Partially updates book #42 DELETE /books/42 - Deletes book #42 Singular or plural? keep it simple
  • 17. Design - Versioning Following software analogy API should be versionated v1 , v1.1, v2.0 curl -X GET -H “X-API-VERSION: 1.1” http://mysite.com/api/books.json http://mysite.com/api/v1/books.json http://mysite.com/api/v1.1/books.json http://mysite.com/api/books.json?v=1.1
  • 18. Design - Versioning How often are you going to change version? What about people already using your API? How many versions will you keep maintaining? What’s the roadmap?
  • 19. Design - Versioning Don’t explicitly version your API non breaking changes no version = flexibility = win
  • 20. API Definition Formats Support (API) design-first approaches Benefits: ● Language-agnostic API description ● Human- and machine-readable ● Understand capability without source code ● API discovery ● Interactive documentation Most common OpenAPI (born out of Swagger)
  • 21. OpenAPI? Swagger? API description spec contains: ● Endpoints ● Parameters ● Expected inputs, outputs Machine readable: ● Automate testing ● Interactive documentation ● SDK generation Petstore Example
  • 22. Supported by the industry
  • 24. Content 1. API Design Best-Practices ○ API design principles ○ Practical tips ○ API definitions 2. AWS Services ○ Amazon API Gateway ○ AWS Lambda 3. 3scale API Management ○ Amazon API Gateway and 3scale integration ○ Customer Case Study: Rosette API
  • 25. AWS Part by Matthew...
  • 26. Content 1. API Design Best-Practices ○ API design principles ○ Practical tips ○ API definitions 2. AWS Services ○ Amazon API Gateway ○ AWS Lambda 3. 3scale API Management ○ Amazon API Gateway and 3scale integration ○ Customer Case Study: Rosette API
  • 28. 3scale and API Gateway Integration
  • 30. How to achieve the Integration API deployed on API Gateway 3scale Custom Authorizer functions Cache API key to reduce latency framework To deploy Lambda functions SNS used for async update of cache
  • 31. Serverless module for easy configuration Community framework to build, deploy and maintain Lambda functions Clone our repo and deploy functions on your own infrastructure serverless function create serverless function deploy
  • 32. Hosted API Rollout with 3Scale Gregor Stewart, Basis Technology @olakrez
  • 35. 35
  • 36. Design 36 Minimise effort to support Hosted and In a Box deployment ● Develop “in a box” first, add 3Scale to deliver Hosted ● From “RPC” to API: Entities ○ Three Components, represented by two Endpoints ○ Reduced to a single endpoint, with options ○ Common options across entity-centric endpoints ○ Separately documented option blob and output type to enable full control ● Explicit Versioning
  • 37. 37 ● Server-based ● Custom NGINX ● Specialised Workers in Auto Scale Groups ● Integrated Caching and Queuing ● Security Focused Implementation
  • 38. Challenges and Next Steps 38 ● Stateless to Stateful Endpoints ● Further “idiomatising” hosted implementation to AWS ○ Moving cache outside to service ○ Porting suitable functions to Lambda ■ LanguageID vs Entity Linking
  • 39. Try it at: developer.rosette.com Gregor Stewart, Basis Technology @olakrez
  • 40. Wrap-up Successful API starts with good API design. Lambda is an effective way to implement APIs. Amazon API Gateway adds crucial API security features. Serverless allows to configure and deploy Lambda easily. 3scale adds valuable API business features. AWS and 3scale provide a full complement API program management solution.
  • 41. Lab overview 1. Create and deploy an API using the Amazon API Gateway and AWS Lambda 2. Integrate with 3scale to add API management features 3. Create tiered application plans with different API contracts (Optional) 4. Expose your API to developers with a developer portal and interactive API documentation (Optional) Github repo: bit.ly/API-workshop