APIs are the hot topic everyone talks about. Today, even CEO's appear to know what an API is. SOA is dead. Long live the API. This talk will give an overview of designing and implementing REST APIs in the context of AWS. We will cover the basics, but get pretty technical for most of the presentation. Followed by a deep dive of building a Survey API using API Gateway, Lambda, and DynamoDB (Surprised? ;-).
Two architectural styles will be showcased.
1. Server-less design - API Gateway and Lambda
2. Server-based design - Elastic Beanstalk
Live demo will be given using API Gateway and Lambda to design a basic API from scratch in only 15 minutes.
Presentation on how to chat with PDF using ChatGPT code interpreter
AWS User Group - Survey Results and Building APIs on AWS
1. #6 - Survey Results and Building APIs on AWS
10 November 2015
Presenter: Sebastian Krueger – Co-Founder and Technical Director at API Talent
2. Acknowledgements
We would like to thanks our sponsors for their help in making
AWS User Group Wellington a success.
Bronnie – OptimalPeople
Dan - OptimalBI
Buzzy – Amazon Web Services
Seb – API Talent
3. Agenda
• Part I: Survey Results
• Part II: Building APIs on AWS
• API Overview
• API Case Study
• Server-based APIs on AWS Overview
• Server-less APIs on AWS Overview / Demo
8. Survey: Meetup Content
0
5
10
15
20
25
30
Technical Deep Dive AWS Service Overview Generic Use Cases Wellington AWS
Customer Solutions
Meetup Content
Meetup Content
0
5
10
15
20
25
30
Technical Deep Dive AWS Service Overview Generic Use Cases Wellington AWS
Customer Solutions
Meetup Content – Most Preferred
Meetup Content - The Most
9. Survey: Meetup Content – Service Category
0
2
4
6
8
10
12
14
16
18
20
Service Category First Choice
Service Category First Choice
10. Survey: Meetup Content – Service Category
0
2
4
6
8
10
12
14
16
18
20
Service Category First Choice
Service Category First Choice
0
2
4
6
8
10
12
Service Category Second Choice
Service Category Second Choice
11. Survey: Meetup Speaker Type
0
5
10
15
20
25
30
AWS Staff Enterprise AWS
Customers
Startup AWS
Customers
AWS Technology
Partners
AWS Consulting
Partners
Speaker Type
Speaker Type
12. Survey: Meetup Speaker Type
0
5
10
15
20
25
30
AWS Staff Enterprise AWS
Customers
Startup AWS
Customers
AWS Technology
Partners
AWS Consulting
Partners
Speaker Type
Speaker Type
0
2
4
6
8
10
12
14
AWS Staff Enterprise AWS
Customers
Startup AWS
Customers
AWS Technology
Partners
AWS Consulting
Partners
Speaker Type – Most Preferred
Speaker Type - The Most
13. Survey: Respondents - Who are you?
0
2
4
6
8
10
12
14
16
18
Cloud
Architect
DevOps
Engineer / IT
Ops
Application
Developer
Manager
(Practice /
Project)
Other
Job Function
Job Function
0
5
10
15
20
Every day, all day
long
Weekly Monthly Not at all
AWS Usage Frequency
AWS Usage Frequency
0
2
4
6
8
10
12
No skills Novice /
Beginner
Intermediate Advanced Expert World Class
Cloud Ninja
AWS Skill Level
AWS Skill Level
14. Survey: Respondents – AWS Certs
0
2
4
6
8
10
12
14
Solutions Architect
- Associate
Developer -
Associate
SysOps
Administrator -
Associate
Solutions Architect
- Professional
DevOps Engineer -
Professional
AWS Certs Completed
AWS Certs Completed
0
2
4
6
8
10
12
14
Not interested Considering it Started Studying
More Certs?
More Certs?
18. What is an API?
An Application Programming Interface (API) is a
specification intended to be used as an interface by
software components to communicate with each
other. An API may include specifications for routines,
data structures, object classes, and variables.
Source: Wikipedia
19. An analogy: The evolution of the car industry
follows the logic of APIs
Yesterday
Carmaker = craftsman
• Tailor made
• Custom design for each element of the car (wheels, seats,
brakes, lights, roof, etc.)
• Restricted modularity
• No standardised processes
Source: 3Scale, What is an API?
Today
Carmaker = system integrator
• Car divided into subsystems (powertrain, brakes, steering,
suspension, etc.)
• Main elements designed separately and reused in
different cars
• Standardised processes
• Communication interfaces between different engineering
teams
20. An analogy: The evolution of the car industry
follows the logic of APIs
22. API Case Study: Fitbit API, externalising R&D
Fitbit is a fitness tracker that records health and
fitness data.
Originally, there was only one application using
the data developed by Fitbit.
In 2011, Fitbit created an API to allow third party
developers to create fitness apps using Fitbit
health data such as daily steps, calories burned,
food eaten and weight.
23. Thriving innovation based on the Fitbit API
34 Apps were built on the Fitbit API creating innovative uses of fitness
and health data.
24. What would it have cost if there were no APIs?
What would it have cost if Fitbit had developed these apps themselves?
Let’s assume 1 application = $50,000
34 applications are using the fitness data from Fitbit API
Developing these apps would have cost FitBit:
$1,700,000
27. But…What do these APIs actually look like?
APIs can be classified in several categories depending what abstraction
is being described.
API Category Example Timeline
Operating System API for MS Windows
API for Apple Mac OS X (Cocoa)
1985-
2001-
Programming Languages Java API 1995-
Application Services API for SAP (BAPI) 1990s-
Infrastructure Services Amazon Web Services API 2002-
Web Services Twitter API 2006-
28. REST architecture for APIs
RESTFul is a style of software architecture that allows data exchange
through human readable URIs.
REST language uses nouns and verbs, and has an emphasis on
readability. It ultimately uses less bandwidth than other languages
such as SOAP for instance.
• GET – Access a resource
• PUT – Update a resource
• POST – Create a resource
• DELETE – Delete a resource
29. Let’s Build an API using AWS
There are a few options:
• Roll your own (raw EC2) (could use CodeDeploy)
• OpsWorks
• Elastic Beanstalk
• API Gateway / Lambda
Use 3rd Party PaaS (on top of AWS):
• Heroku, Cloud 66, etc, etc, etc
30. First Up: AWS Beanstalk
• EC2 - Elastic Compute Cloud
• S3 – Simple Storage Service
• ELB – Elastic Load Balancer
• Auto Scaling – starts new EC2 instances
• EBS – Elastic Block Storage; virtual hard disks
AWS Beanstalk provides a convenience layer on top of all of these
services.
31. Elastic Beanstalk in a Nutshell
• EC2 Server
• + Linux
• + OpenJDK
• + Tomcat
• Scaling Elastic Load Balancer /
Auto Scaling
• Deploy artefacts on S3
• Can add database (RDS)
33. Let’s build a Java-based Web API
DEMO TIME
GET http://somewhere/hello/seb
Returns:
“Hello seb”
34. Amazon API Gateway and AWS Lambda
AMS Lambda + Amazon API Gateway means no infrastructure to
manage - AWS does the scaling for you.
Amazon API Gateway is a fully managed service that makes it easy for
developers to create, publish, maintain, monitor, and secure APIs at any
scale.
Lambda functions is stateless, trigger based code execution.
Just like a car which consists of several subsystems designed by different specialised teams (internal or partners) who communicate with each other all along the design process…
...an API is a software brick that allows someone to share data, content and functionalities with others, for them to build new services based on this data, content and functionalities (i.e. using one or several bricks). The services built can use one or several APIs from the same or different APIs providers.
If Fitbit had not had an API, they would have had to develop applications internally to create innovative use cases. Without an API, it would not be able to leverage third party developers creativity.
Fitbit lets developers create new apps with its data, which results in higher usage of the Fitbit device. It only costs Fitbit the maintenance of the API.