21
Serverless + JS Kieran (Kio) Goodary

Serverless Presentation

Embed Size (px)

Citation preview

Page 1: Serverless Presentation

Serverless + JSKieran (Kio) Goodary

Page 2: Serverless Presentation

10 Years

Page 3: Serverless Presentation
Page 4: Serverless Presentation

Before we continue…

“server”

We’re talking your classic web server

Page 5: Serverless Presentation

This presentation is a little…

AWS-esque

Page 6: Serverless Presentation

Root Server

Time

Sanity

Cost

Page 7: Serverless Presentation

Time

Sanity

Cost

IaaSInfrastructure as a Service

Page 8: Serverless Presentation

Time

Sanity

Cost

PaaSPlatform as a Service

Page 9: Serverless Presentation

Time

Sanity

Cost

Serverless

Page 10: Serverless Presentation
Page 11: Serverless Presentation

Deploys in seconds

20

Multipurpose usage

Page 12: Serverless Presentation

Minimal configuration

EnvironmentConfigured

InfinitelyScalable

FaultTolerant

EdgeLocations

Page 13: Serverless Presentation

You’ll probably never get charged

Billed every 100ms

First 3.2 million seconds are free, every month

every 100ms costs $0.000000208

Page 14: Serverless Presentation

Serverless Framework

CLI-driven Multiple LanguageSupport

Multiple PlatformSupport

Well Funded Strong CommunityUsesCloudFormation

Page 15: Serverless Presentation

npm install serverless -gsls create —-template aws-nodejs —-path create /create

/create/serverless.yml

/create/handler.js

events:- http:

path: users/create

method: post- sns: federation-identity-sign-up- s3: user-profile-mugshots

module.exports.hello = (event, context, callback) => { const response = { statusCode: 200, body: JSON.stringify({ message: 'Go Serverless v1.0! Your function executed successfully!', input: event, }), }; callback(null, response);};

Page 16: Serverless Presentation

sls deploy

Serverless: Packaging service...Serverless: Uploading CloudFormation file to S3...Serverless: Uploading service .zip file to S3 (25.62 KB)...Serverless: Updating Stack...Serverless: Checking Stack update progress.................Serverless: Stack update finished...Serverless: Removing old service versions...Service Informationservice: createstage: devregion: us-east-1api keys: Noneendpoints: POST - https://09u3jupt76.execute-api.us-east-1.amazonaws.com/dev/createfunctions: create-dev-hello: arn:aws:lambda:us-east-1:305311140082:function:create-dev-hello

Page 17: Serverless Presentation

😄That’s it.

It is literally that easy.

Page 18: Serverless Presentation

Show ‘em that tingjsonb.in

Page 19: Serverless Presentation

0servers used

Page 20: Serverless Presentation

jsonb.in

Route 53

CloudFront Distribution

S3 Bucket (Site Assets)

React App

create

read

update

S3 Bucket (Site Data)

Page 21: Serverless Presentation

👍🏾👌🏾Thank you!

Do not follow me on Twitter:@kiog

digitalindustria.com