Slide 1

Slide 1 text

server-side goes serverless @ythecombinator @feliborgez

Slide 2

Slide 2 text

!!!

Slide 3

Slide 3 text

#1 it has nothing to do with serveless but…

Slide 4

Slide 4 text

#1

Slide 5

Slide 5 text

#2 + architecture - code

Slide 6

Slide 6 text

#3 pretty much focused on experiences

Slide 7

Slide 7 text

stalkr

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

Travis CI 

Slide 10

Slide 10 text

GitHub 

Slide 11

Slide 11 text

Apex 

Slide 12

Slide 12 text

Heroku 

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

http://getstal.kr

Slide 15

Slide 15 text

/ Matheus Albuquerque full-stack developer draft illustration enthusiast open source lover web alchemist Felipe Borges back-ender minecraft lover mobile developer google enthusiast

Slide 16

Slide 16 text

/ Matheus Albuquerque full-stack developer draft illustration enthusiast open source lover web alchemist Felipe Borges back-ender minecraft lover mobile developer google enthusiast

Slide 17

Slide 17 text

/ Matheus Albuquerque full-stack developer draft illustration enthusiast open source lover web alchemist Felipe Borges back-ender minecraft lover mobile developer google enthusiast

Slide 18

Slide 18 text

/ Matheus Albuquerque full-stack developer draft illustration enthusiast open source lover web alchemist Felipe Borges back-ender minecraft lover mobile developer google enthusiast

Slide 19

Slide 19 text

/ Matheus Albuquerque full-stack developer draft illustration enthusiast open source lover web alchemist Felipe Borges back-ender minecraft lover mobile developer google enthusiast #after 

Slide 20

Slide 20 text

who ???

Slide 21

Slide 21 text

back-end development

Slide 22

Slide 22 text

back-end development devops

Slide 23

Slide 23 text

back-end development devops IaaS

Slide 24

Slide 24 text

back-end development devops IaaS PaaS

Slide 25

Slide 25 text

back-end development devops IaaS PaaS BaaS

Slide 26

Slide 26 text

back-end development devops IaaS PaaS BaaS FaaS

Slide 27

Slide 27 text

history

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

back in 2012…

Slide 30

Slide 30 text

No content

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

problems we have

Slide 34

Slide 34 text

× development costs × scaling costs × operational management

Slide 35

Slide 35 text

so what ???

Slide 36

Slide 36 text

micro service nano service serverless Function as a Service Backend as a Service

Slide 37

Slide 37 text

#1 serverless

Slide 38

Slide 38 text

✓ logic is executed in an environment without visible processes, OS, servers or virtual machines ✓ the responsibility for provisioning and managing the infrastructure belongs entirely to the service provider ✓ significantly depend on third-party services ✓ functionality needed was offered as services, covering databases, messaging, authentication, etc ✓ software developer focuses on writing code

Slide 39

Slide 39 text

#2 Backend as a Service

Slide 40

Slide 40 text

✓ started as MBaaS ✓ provide server-side logic ✓ manage their internal states ✓ applications that do not have application- specific, server-side logic ✓ use third-party services for everything

Slide 41

Slide 41 text

✓ Authentication as a Service (Auth0, AWS Cognito, Firebase) ✓ Logging as a Service (Loggly, Logsense, Amazon Elasticsearch Service) ✓ Analytics as a Service (Amazon Kinesis, Keen IO).

Slide 42

Slide 42 text

#3 Functions as a Service

Slide 43

Slide 43 text

✓ short-living stateless functions ✓ triggered by events ✓ provider does the rest: ✓ provisioning instances of such functions, ✓ terminating instances, ✓ monitoring all of them, ✓ identity and logging services, ✓ …

Slide 44

Slide 44 text

Auth0 Webtask AWS Lambda Google Cloud Functions Azure Functions IronFunctions IBM OpenWhisk

Slide 45

Slide 45 text

#4 Micro & Nano services

Slide 46

Slide 46 text

✓ a suite of small services ✓ each running in its own process ✓ each communicating with lightweight mechanisms ✓ these services are built around business capabilities ✓ independently deployable

Slide 47

Slide 47 text

microservice !→ all CRUD operations on an account nanoservice !→ each account operation: create, read, update, and delete

Slide 48

Slide 48 text

back to problems

Slide 49

Slide 49 text

#1 development costs

Slide 50

Slide 50 text

e.g. authentication

Slide 51

Slide 51 text

code your own authentication functionality

Slide 52

Slide 52 text

✓ removes much of the database administration overhead ✓ provides mechanisms of authorization for different types of users

Slide 53

Slide 53 text

#2 scaling costs

Slide 54

Slide 54 text

1 request / minute 50 ms / request 0.1% mean CPU usage / hour

Slide 55

Slide 55 text

100ms compute / minute 0.15% of the overall time

Slide 56

Slide 56 text

✓ democratize things ✓ breaking down components by logic / domain even without working with the operational costs (startups )

Slide 57

Slide 57 text

e.g. inconsistent traffic

Slide 58

Slide 58 text

https://martinfowler.com/articles/serverless.html

Slide 59

Slide 59 text

200 https://martinfowler.com/articles/serverless.html

Slide 60

Slide 60 text

autoscaling

Slide 61

Slide 61 text

less than 4% of total uptime total hardware capability x 10

Slide 62

Slide 62 text

try: code optimization

Slide 63

Slide 63 text

#3 operational management

Slide 64

Slide 64 text

on the BaaS side

Slide 65

Slide 65 text

less components maybe… = less work *

Slide 66

Slide 66 text

on the FaaS side

Slide 67

Slide 67 text

× compressing your code × puppet / chef × start / stop shell scripts × decisions about whether to deploy one or many containers on a machine

Slide 68

Slide 68 text

when to use?

Slide 69

Slide 69 text

#1 slack bots

Slide 70

Slide 70 text

#2 database wrappers

Slide 71

Slide 71 text

#3 scientific computing

Slide 72

Slide 72 text

http://ericjonas.com/pywren.html

Slide 73

Slide 73 text

Slide 74

Slide 74 text

different ways

Slide 75

Slide 75 text

#1 command pattern

Slide 76

Slide 76 text

http://freecontent.manning.com/patterns-for-solving-problems-in-serverless-architectures/

Slide 77

Slide 77 text

#2 messaging pattern

Slide 78

Slide 78 text

http://freecontent.manning.com/patterns-for-solving-problems-in-serverless-architectures/

Slide 79

Slide 79 text

#3 priority queue pattern

Slide 80

Slide 80 text

http://freecontent.manning.com/patterns-for-solving-problems-in-serverless-architectures/

Slide 81

Slide 81 text

#4 fan-out pattern

Slide 82

Slide 82 text

http://freecontent.manning.com/patterns-for-solving-problems-in-serverless-architectures/

Slide 83

Slide 83 text

#5 pipes & filters pattern

Slide 84

Slide 84 text

http://freecontent.manning.com/patterns-for-solving-problems-in-serverless-architectures/

Slide 85

Slide 85 text

drawbacks

Slide 86

Slide 86 text

× not efficient for long-running applications × vendor lock-in × introduce additional overhead for function/microservice calls × multitenancy × cold start × different methods for logging in functions

Slide 87

Slide 87 text

up & running

Slide 88

Slide 88 text

No content

Slide 89

Slide 89 text

$ npm install -g firebase-tools $ firebase init $ firebase deploy $ firebase login $ firebase init functions const functions = require('firebase-functions'); …

Slide 90

Slide 90 text

in the end…

Slide 91

Slide 91 text

✓ reduced time ✓ lower operational and development costs ✓ works well with agile development ✓ allows developers to focus on code and to deliver faster ✓ fits with microservices ✓ reduces the complexity ✓ simplifies packaging and deployment

Slide 92

Slide 92 text

!!!

Slide 93

Slide 93 text

No content

Slide 94

Slide 94 text

questions?

Slide 95

Slide 95 text

thanks! @ythecombinator @feliborgez