The Hitchhikers Guide to Serverless JavaScript Steve Faulkner - - PowerPoint PPT Presentation

the hitchhiker s guide to serverless javascript steve
SMART_READER_LITE
LIVE PREVIEW

The Hitchhikers Guide to Serverless JavaScript Steve Faulkner - - PowerPoint PPT Presentation

The Hitchhikers Guide to Serverless JavaScript Steve Faulkner @southpolesteve Director of Engineering Serverless Serverless there are still servers servers platforms! * as a Service Database-aaS Caching-aaS


slide-1
SLIDE 1

The Hitchhiker’s Guide to “Serverless” JavaScript

slide-2
SLIDE 2

Steve Faulkner

@southpolesteve

slide-3
SLIDE 3
slide-4
SLIDE 4
slide-5
SLIDE 5

Director of Engineering

slide-6
SLIDE 6

“Serverless”

slide-7
SLIDE 7
slide-8
SLIDE 8

“Serverless”

slide-9
SLIDE 9

there are still servers…

slide-10
SLIDE 10

servers platforms!

slide-11
SLIDE 11

* as a Service

slide-12
SLIDE 12

Database-aaS Caching-aaS Logging-aaS Metrics-aaS Servers-aaS

slide-13
SLIDE 13

business logic?

slide-14
SLIDE 14

Functions-aaS

slide-15
SLIDE 15

myApp(request) #=> response

slide-16
SLIDE 16
slide-17
SLIDE 17
slide-18
SLIDE 18
slide-19
SLIDE 19

Lambda + API Gateway

slide-20
SLIDE 20

Functions-aaS + Routing-aaS

slide-21
SLIDE 21

$ per request

slide-22
SLIDE 22

scales magically*

slide-23
SLIDE 23

Lambda

slide-24
SLIDE 24

write code zip upload function()

slide-25
SLIDE 25

node java python C#

slide-26
SLIDE 26

shim + rust/go/haskell

slide-27
SLIDE 27

function(event,context,cb){ cb(null, ‘Hello World’) }

slide-28
SLIDE 28

versioning aliases RAM + CPU logging non-http events

slide-29
SLIDE 29

API Gateway

slide-30
SLIDE 30

swagger

  • r

click a lot

slide-31
SLIDE 31

cache/throttle authorization api keys logging/metrics custom domains ssl

slide-32
SLIDE 32
slide-33
SLIDE 33

10-20 million calls per day

slide-34
SLIDE 34

< $$$

slide-35
SLIDE 35
slide-36
SLIDE 36

frontend

slide-37
SLIDE 37
slide-38
SLIDE 38

API Gateway

S3

Lambda(SSR)

html + js

slide-39
SLIDE 39

Ember

slide-40
SLIDE 40

Ember Riot

slide-41
SLIDE 41

Ember Riot Preact

slide-42
SLIDE 42

why preact?

slide-43
SLIDE 43

components simple small

slide-44
SLIDE 44

backend

slide-45
SLIDE 45

graphiql.bustle.com

slide-46
SLIDE 46

API Gateway

Lambda

JSON dynamoDB

redis*

slide-47
SLIDE 47

Ruby

slide-48
SLIDE 48

Ruby JS (REST)

slide-49
SLIDE 49

Ruby JS (REST) Purescript

slide-50
SLIDE 50
slide-51
SLIDE 51

Ruby JS (REST) Purescript JS (GraphQL)

slide-52
SLIDE 52

why graphQL?

slide-53
SLIDE 53

graphiQL

slide-54
SLIDE 54

types

slide-55
SLIDE 55

field resolution

slide-56
SLIDE 56

dataloader

slide-57
SLIDE 57

why serverless?

slide-58
SLIDE 58
  • ps
slide-59
SLIDE 59

#noops

slide-60
SLIDE 60

#noops

slide-61
SLIDE 61

benchmarks
 fallbacks load testing monitoring
 #lessops

slide-62
SLIDE 62

scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale scale

slide-63
SLIDE 63

1 -> 1000 rps

slide-64
SLIDE 64

1000 -> 0 rps

slide-65
SLIDE 65

iteration

slide-66
SLIDE 66

single function deployments

slide-67
SLIDE 67

$$$$

slide-68
SLIDE 68

events API

slide-69
SLIDE 69

ec2 ~$2500/mo

slide-70
SLIDE 70

lambda api gateway ~$400/mo

slide-71
SLIDE 71

why not?

slide-72
SLIDE 72

lock in

slide-73
SLIDE 73

const express = require(‘express’) const fn = require(./lambda-fn/) const app = express() app.get('/', (req, res) => { fn.handler(null, null, (err, result) => { res.json(result) }) }); app.listen(3000)

slide-74
SLIDE 74

cold functions

slide-75
SLIDE 75

const data = loadBigData() // Takes 15s module.exports.handler = function(e,ctx,cb){ processBigData(data, cb) }

slide-76
SLIDE 76

long tasks

slide-77
SLIDE 77

5 min max

slide-78
SLIDE 78

s3(3GB) Lambda Kinesis Firehose Elasticsearch

slide-79
SLIDE 79

testing

slide-80
SLIDE 80

test in the cloud?

slide-81
SLIDE 81

tools!

slide-82
SLIDE 82

serverless framework node-lambda apex claudia.js

slide-83
SLIDE 83
slide-84
SLIDE 84

npm install -g shep

slide-85
SLIDE 85

JavaScript Only no CF
 swagger
 webpack
 environments

slide-86
SLIDE 86

shep new my-api shep generate endpoint shep deploy production

slide-87
SLIDE 87

questions? Steve Faulkner @southpolesteve