Slide 1

Slide 1 text

@n_bass Building Everything on Serverless

Slide 2

Slide 2 text

@n_bass λ

Slide 3

Slide 3 text

@n_bass Cloud App / Hobby Projects Enter Serverless + Serverless Compute Examples Under the Hood AWS Lambda Serverless Framework Live Demo

Slide 4

Slide 4 text

@n_bass How do you write + run cloud apps?

Slide 5

Slide 5 text

@n_bass Code Test Deploy Monitor Provision Infrastructure

Slide 6

Slide 6 text

@n_bass Your Code! Virtual Machine (or maybe PaaS) ? Your Code! Database/Datastore Logs Cron HTTP/S SSH

Slide 7

Slide 7 text

@n_bass Infrastructure and Management

Slide 8

Slide 8 text

@n_bass Infrastructure and Management

Slide 9

Slide 9 text

@n_bass Infrastructure is an implementation detail.

Slide 10

Slide 10 text

@n_bass Developers should care about only their code.

Slide 11

Slide 11 text

@n_bass Drop the infrastructure.

Slide 12

Slide 12 text

@n_bass Code Test Deploy Monitor Provision Infrastructure

Slide 13

Slide 13 text

@n_bass Idle Code == Idle Servers

Slide 14

Slide 14 text

@n_bass Serverless?

Slide 15

Slide 15 text

@n_bass HTTP API for Web/Mobile App HTTPS Trigger Event Your Code! Function Database/ Datastore Services Other Functions, APIs APIs Logs, … Monitoring

Slide 16

Slide 16 text

@n_bass Serverless == BaaS

Slide 17

Slide 17 text

@n_bass Serverless Compute == FaaS

Slide 18

Slide 18 text

@n_bass Serverless Function

Slide 19

Slide 19 text

@n_bass Serverless (BaaS) Serverless Compute (FaaS) Serverless Function

Slide 20

Slide 20 text

@n_bass Serverless is another abstraction.

Slide 21

Slide 21 text

@n_bass FaaS PaaS IaaS

Slide 22

Slide 22 text

@n_bass But there are servers?!?!?!

Slide 23

Slide 23 text

@n_bass Good Use Cases

Slide 24

Slide 24 text

@n_bass HTTP API for Web/Mobile App HTTPS Call Event Your Code! Function Database/ Datastore Service

Slide 25

Slide 25 text

@n_bass Example: ACM@UC Slack Badge

Slide 26

Slide 26 text

@n_bass Scheduled Event Event Your Code! Function Messaging, Reporting, etc. API Automated Tasks Data API

Slide 27

Slide 27 text

@n_bass New Image/ Video in S3 Bucket Event Your Code! Function S3 Bucket Service Image and Video Resizing

Slide 28

Slide 28 text

@n_bass Bad Use Cases Persistent Connections, State Sharing

Slide 29

Slide 29 text

@n_bass Building Everything on Serverless

Slide 30

Slide 30 text

@n_bass Building Everything on Serverless Some Things

Slide 31

Slide 31 text

@n_bass Containers

Slide 32

Slide 32 text

@n_bass Simple Function: Availability Event Instance Function HTTPS GET Instance Instance Instance https://martinfowler.com/articles/serverless.html

Slide 33

Slide 33 text

@n_bass Containers Package code into an image that can be run (almost anywhere)

Slide 34

Slide 34 text

@n_bass Container Reuse aws.amazon.com/blogs/compute/container-reuse-in-lambda/

Slide 35

Slide 35 text

@n_bass

Slide 36

Slide 36 text

@n_bass HTTP Call Event Stream S3 Bucket Database Queue (SQS) Logs And more…

Slide 37

Slide 37 text

@n_bass Cost Serverless Computing for College Students?

Slide 38

Slide 38 text

@n_bass $ = Number Requests + Compute Time (gb-sec)

Slide 39

Slide 39 text

@n_bass Pricing on AWS Lambda • $0.2 per 1 million requests • $0.00001667 per gb-sec

Slide 40

Slide 40 text

@n_bass Sample Function 1 million requests
 800ms per request
 256mb (0.25gb) memory -> $0.2 -> 1M * 0.8sec -> 0.8M sec -> 0.8M sec * 0.25gb = 200,000 gb-sec
 200,000 * $0.00001667 = $3.34
 Total = $0.2 + $3.34 = $3.54/month

Slide 41

Slide 41 text

@n_bass AWS Free Tier aws.amazon.com/free/

Slide 42

Slide 42 text

@n_bass λ

Slide 43

Slide 43 text

@n_bass Serverless Framework (serverless.com)

Slide 44

Slide 44 text

@n_bass Serverless != Serverless Framework

Slide 45

Slide 45 text

@n_bass

Slide 46

Slide 46 text

@n_bass Serverless Framework is Cloud Agnostic

Slide 47

Slide 47 text

@n_bass Why A Framework?

Slide 48

Slide 48 text

@n_bass Live Demo

Slide 49

Slide 49 text

@n_bass Simple HTTP Endpoint (hello world) Event Our Code! Respond 200 OK Function HTTPS GET

Slide 50

Slide 50 text

@n_bass Scheduled Event: Weather Report Scheduled Event (1d) Event Our Code! Get data, then send email Function darksky.net API API AWS SES API

Slide 51

Slide 51 text

@n_bass Building Some Things on Serverless

Slide 52

Slide 52 text

@n_bass Resources • serverless.com • serverless.com/framework/docs/providers/aws/guide/quick-start/ • aws.amazon.com/lambda • aws.amazon.com/free • cloud.google.com/free • github.com/serverless/examples • github.com/anaibol/awesome-serverless • martinfowler.com/articles/serverless.html • www.youtube.com/watch?v=Y6B3Eqlj9Fw • github.com/openfaas/faas