serverless apps on aws

74
Serverless Apps on AWS Dean Bryen - Solutions Architect - AWS James Hall - Co-Founder - Parallax [email protected] @deanbryen @parallax

Upload: amazon-web-services

Post on 14-Apr-2017

1.043 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Serverless Apps on AWS

Serverless Apps on AWSDean Bryen - Solutions Architect - AWS

James Hall - Co-Founder - Parallax

[email protected]

@deanbryen@parallax

Page 2: Serverless Apps on AWS

What are your goals?

Page 3: Serverless Apps on AWS

3

Racing within a window of time

Page 4: Serverless Apps on AWS

4

Focus is on solving a problem

Page 5: Serverless Apps on AWS

5

Skills are in Development not Infrastructure

Page 6: Serverless Apps on AWS

6

Over-Engineering vs Re-Engineering

Page 7: Serverless Apps on AWS

The Evolution of Architecture

Page 8: Serverless Apps on AWS

8

The Monolith

Page 9: Serverless Apps on AWS

9

Micro Services

Page 10: Serverless Apps on AWS

10

API Driven Development

Page 11: Serverless Apps on AWS

The Evolution of Compute and Storage

Page 12: Serverless Apps on AWS

12

Physical Servers / Disks ->VM’s

Page 13: Serverless Apps on AWS

13

Containers

Page 14: Serverless Apps on AWS

14

Platform Level Services

Page 15: Serverless Apps on AWS

My Application Challenge

Page 16: Serverless Apps on AWS

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

Page 17: Serverless Apps on AWS

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…

Page 18: Serverless Apps on AWS

What Services Could we use?

Page 19: Serverless Apps on AWS

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

Page 20: Serverless Apps on AWS

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

Page 21: Serverless Apps on AWS

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

Page 22: Serverless Apps on AWS

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

Page 23: Serverless Apps on AWS

Putting it all together

Page 24: Serverless Apps on AWS

The Service Itself

Static Site in S3 www.servicecheck.com

Web Client API Gateway/serviceCheck

Lambda serviceLogger

Lambda serviceCheck

DynamoDBservices

Page 25: Serverless Apps on AWS

Serverless Framework - Previously JAWS

Page 26: Serverless Apps on AWS

It’s more cost effective

Page 27: Serverless Apps on AWS

Demo

Page 28: Serverless Apps on AWS

Some other serverless patterns

Page 29: Serverless Apps on AWS

Serverless Real Time Clickstream

Raw data pushed to S3

Amazon Redshift

Amazon Kinesis

Amazon Kinesis

AWS Lambda

Page 30: Serverless Apps on AWS

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

Page 31: Serverless Apps on AWS

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

Page 32: Serverless Apps on AWS

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

Page 33: Serverless Apps on AWS

“Everybody loved the idea, some little geniuses created this app where you can record your part.”

@parallax Serverless Applications on AWS

David Guetta

Page 34: Serverless Apps on AWS
Page 35: Serverless Apps on AWS

“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

Page 36: Serverless Apps on AWS

@parallax

Page 37: Serverless Apps on AWS

Traditional Architecture

@parallax@parallax

Page 38: Serverless Apps on AWS

@parallax

Traditional Architecture

Serverless Applications on AWS

Page 39: Serverless Apps on AWS

£ £ £ £ £ £ £

@parallax

Traditional Architecture

Serverless Applications on AWS

Page 40: Serverless Apps on AWS

With AWS Serverless

@parallax@parallax Serverless Applications on AWS

Page 41: Serverless Apps on AWS

@parallax

Without “Servers”

Serverless Applications on AWS

Page 42: Serverless Apps on AWS

Serverless Framework

@parallax@parallax Serverless Applications on AWS

Page 43: Serverless Apps on AWS

• Pay-per-use Pricing • No servers to manage • Run nano/microservices

(or monoliths!)

@parallax Serverless Applications on AWS

Page 44: Serverless Apps on AWS

How it works

@parallax@parallax Serverless Applications on AWS

Page 45: Serverless Apps 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

Page 46: Serverless Apps on AWS

@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

Page 47: Serverless Apps on AWS

@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

Page 48: Serverless Apps on AWS

@parallax Serverless Applications on AWS

Page 49: Serverless Apps on AWS

@parallax Serverless Applications on AWS

Page 50: Serverless Apps on AWS

Chelsea FC / Delta

@parallax@parallax Serverless Applications on AWS

Page 51: Serverless Apps on AWS

@parallax

Page 52: Serverless Apps on AWS

Deployment

@parallax@parallax Serverless Applications on AWS

Page 53: Serverless Apps on AWS

@parallax Serverless Applications on AWS

Page 54: Serverless Apps on AWS

@parallax Serverless Applications on AWS

Page 55: Serverless Apps on AWS

The Future? GraphQL

@parallax@parallax Serverless Applications on AWS

Page 56: Serverless Apps on AWS

@parallax@parallax

Page 57: Serverless Apps on AWS

@parallax@parallax

{ user(id: 3500401) { id, name, isViewerFriend, profilePicture(size: 50) { uri, width, height } }}

Page 58: Serverless Apps on AWS

@parallax@parallax

{ "user" : { "id": 3500401, "name": "Jing Chen", "isViewerFriend": true, "profilePicture": { "uri": "http://someurl.cdn/pic.jpg", "width": 50, "height": 50 } }}

Page 59: Serverless Apps on AWS

@parallax Serverless Applications on AWS

Some sequences may have been shortened.

Page 60: Serverless Apps on AWS

@parallax Serverless Applications on AWS

Page 61: Serverless Apps on AWS

@parallax Serverless Applications on AWS

Page 62: Serverless Apps on AWS

@parallax Serverless Applications on AWS

Page 63: Serverless Apps on AWS

@parallax Serverless Applications on AWS

Page 64: Serverless Apps on AWS

@parallax Serverless Applications on AWS

Page 65: Serverless Apps on AWS

@parallax Serverless Applications on AWS

Page 66: Serverless Apps on AWS

Build small apps to help your DevOps

@parallax@parallax Serverless Applications on AWS

Page 67: Serverless Apps on AWS

One more thing

@parallax@parallax Serverless Applications on AWS

Page 68: Serverless Apps on AWS

@parallax Serverless Applications on AWS

Page 69: Serverless Apps on AWS

@parallax Serverless Applications on AWS

Page 70: Serverless Apps on AWS

Summary and Next Steps

Page 71: Serverless Apps on AWS

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

Page 72: Serverless Apps on AWS

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

Page 73: Serverless Apps on AWS

awsloft.london

closing.party && startup.showcase

28 April :: 18:00 >> 22:00

Page 74: Serverless Apps on AWS

Thank You

[email protected]

@deanbryen

Dean Bryen - Solutions Architect - AWS James Hall - Co-Founder - Parallax

@parallax