serverless apps on aws
TRANSCRIPT
Serverless Apps on AWSDean Bryen - Solutions Architect - AWS
James Hall - Co-Founder - Parallax
@deanbryen@parallax
What are your goals?
3
Racing within a window of time
4
Focus is on solving a problem
5
Skills are in Development not Infrastructure
6
Over-Engineering vs Re-Engineering
The Evolution of Architecture
8
The Monolith
9
Micro Services
10
API Driven Development
The Evolution of Compute and Storage
12
Physical Servers / Disks ->VM’s
13
Containers
14
Platform Level Services
My Application Challenge
Build a micro service based web application that…..
Scales per request
Requires no deployment effort
Fault Tolerant
Has a RESTful API interface with a Web client
The Catch
NO Servers
NO Monolithic App or Explicit Web Service
NO Explicit code for scaling and fault tolerance
And do it within 45 minutes…
What Services Could we use?
Static Assets in Amazon S3
Internet scale HTTP/S based object store
Inerently Highly Available and Fault Tolerant
Designed for 11 9’s of Durability
Can host static websites
Holds trillions of objects
Serverless micro services with AWS Lambda
Event Driven Computing service
Never pay for idle
Scales per request
Supports Node.js, python and Java (or other JVM based languages)
Event triggers from other AWS Services
23 different ‘Power Levels’ of AWS Lambda
A RESTful API with Amazon API Gateway
Host multiple versions and stages of your API
Create and distribute API Keys to your developers
Throttle and Monitor API Calls
Cache Responses
Transform Data
Generate SDK’s (Including Swagger Support)
Interact directly with AWS Lambda
A NoSQL Data Store with Amazon DynamoDB
Managed noSQL Data Store
Can be either a Document or Key/Value store
Simply provision read and write throughput
Enables you to focuss on your data
DynamoDB streams enables you to take actions on events
Inherently Highly Available and Fault Tolerant
Putting it all together
The Service Itself
Static Site in S3 www.servicecheck.com
Web Client API Gateway/serviceCheck
Lambda serviceLogger
Lambda serviceCheck
DynamoDBservices
Serverless Framework - Previously JAWS
It’s more cost effective
Demo
Some other serverless patterns
Serverless Real Time Clickstream
Raw data pushed to S3
Amazon Redshift
Amazon Kinesis
Amazon Kinesis
AWS Lambda
Serverless DAM Architecture
users
Ingest Bucket
CloudFormation Template
DynamoDB
Cognito
Lambda MetaData
Extract
Asset Bucket
Index
Logs Bucket
Static Site
Elastic Transcoder
IAM
ElasticSearch
API$Gateway$
Lambda App Logic
Serverless Chat Application
Internet
Activity Indicator
Chat Service
Activity
Messages
Search Service
DynamoDB Streams
Elasticsearch Service
S3 Web Hosting Twilio
Slack Chat
API Gateway
IoT Device
IoT Processing
Website
AWS IoT or Amazon SNS
One Column
[email protected] 226477
Subtitle
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has a the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.
Here is an example: - Bullet Point one - Bullet Point one - Bullet Point one
It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
@parallax
“Everybody loved the idea, some little geniuses created this app where you can record your part.”
@parallax Serverless Applications on AWS
David Guetta
“The longer I spent watching the intro video, the more
it looked like David sort of didn't want to be there. He
was shifting around on his chair like a man who'd just
nicked a Mars bar.”
– VICE
@parallax
Traditional Architecture
@parallax@parallax
@parallax
Traditional Architecture
Serverless Applications on AWS
£ £ £ £ £ £ £
@parallax
Traditional Architecture
Serverless Applications on AWS
With AWS Serverless
@parallax@parallax Serverless Applications on AWS
@parallax
Without “Servers”
Serverless Applications on AWS
Serverless Framework
@parallax@parallax Serverless Applications on AWS
• Pay-per-use Pricing • No servers to manage • Run nano/microservices
(or monoliths!)
@parallax Serverless Applications on AWS
How it works
@parallax@parallax Serverless Applications on AWS
@parallax
Page lifecycle
Serverless Applications on AWS
1. User visits
HTTPSGET /
S3 with CloudFront
2. CSS & JS
HTTPSGET*.js*.css
S3 with CloudFront
index.html
3. Lang detect
API Gateway w/Lambda
HTTPSGET/users/country
HTTPSPOST/users/update
4. User fills details
API Gateway w/Lambda
@parallax
Page lifecycle
Serverless Applications on AWS
5.
5. FB Login (optional)
HTTPSGET api.facebook.com
Hits Facebook Hosted Endpointvia Facebook Javascript SDK
6. YouTube
HTTPSGETyoutube.com
YouTube iframe
{“email”: “xyz”,“profile_id”: 123}
7. Start recording
API Gateway w/Lambda
Responds with S3 upload token
HTTPSGET/recordings/token
Uploads directly to S3 bucket over HTTPS using token
6.
7. 8.
HTTPSPOSTbucket.s3.amazon/UID/recording-X.mp3
8. Upload recording
@parallax
Page lifecycle
Serverless Applications on AWS
9. Submit details
API Gateway w/Lambda
10. Artwork gen
HTTPSPOST/users/generate_artwork
API Gateway w/Lambda.Create image, put on S3, return S3 image URL
11. Artwork display
CloudFront w/ S3
HTTPSGET/domain.com/UID.png
AddThis.js is populated with the share texts, and includes the S3 URL
HTTPGETaddthis.com/file.js
HTTPSPOST/users/update
{ url: “domain.com/UID.png” }
10. 11.
12. Social share 13. Social share
HTTPSGEThttps://twitter.com/intent/tweet?text=XYZ
12. 13.
Directly hits the social media service
@parallax Serverless Applications on AWS
@parallax Serverless Applications on AWS
Chelsea FC / Delta
@parallax@parallax Serverless Applications on AWS
@parallax
Deployment
@parallax@parallax Serverless Applications on AWS
@parallax Serverless Applications on AWS
@parallax Serverless Applications on AWS
The Future? GraphQL
@parallax@parallax Serverless Applications on AWS
@parallax@parallax
@parallax@parallax
{ user(id: 3500401) { id, name, isViewerFriend, profilePicture(size: 50) { uri, width, height } }}
@parallax@parallax
{ "user" : { "id": 3500401, "name": "Jing Chen", "isViewerFriend": true, "profilePicture": { "uri": "http://someurl.cdn/pic.jpg", "width": 50, "height": 50 } }}
@parallax Serverless Applications on AWS
Some sequences may have been shortened.
@parallax Serverless Applications on AWS
@parallax Serverless Applications on AWS
@parallax Serverless Applications on AWS
@parallax Serverless Applications on AWS
@parallax Serverless Applications on AWS
@parallax Serverless Applications on AWS
Build small apps to help your DevOps
@parallax@parallax Serverless Applications on AWS
One more thing
@parallax@parallax Serverless Applications on AWS
@parallax Serverless Applications on AWS
@parallax Serverless Applications on AWS
Summary and Next Steps
Summary
Utilise Platform Level Services that have built in HA
Use a microservice approach
Use a common interface for services such as RESTful APIs
Store static files in Amazon S3
Use AWS Lambda as the glue between AWS services
Next Steps
Sign up for an AWS Account
Try out a new server-less service
Make use of AWS Forums and Support
Come and meet an architect at the loft
Check out aws.amazon.com for more information
Thank You
@deanbryen
Dean Bryen - Solutions Architect - AWS James Hall - Co-Founder - Parallax
@parallax