Putting Node.js Serverless Apps into Production without the - - PowerPoint PPT Presentation

putting node js serverless apps into production without
SMART_READER_LITE
LIVE PREVIEW

Putting Node.js Serverless Apps into Production without the - - PowerPoint PPT Presentation

Putting Node.js Serverless Apps into Production without the Pitfalls Ein Shanaghy @eoins @eoins Im going to talk about JS Modern JavaScript and Applications Serverless Pitfalls and how we How to overcome them Build Them Recipes


slide-1
SLIDE 1

@eoins

Putting Node.js Serverless Apps into Production without the Pitfalls

Eóin Shanaghy

@eoins

slide-2
SLIDE 2

@eoins

I’m going to talk about

Modern Applications How to Build Them Serverless

JS

JavaScript and Serverless Pitfalls and how we

  • vercome them

Recipes for Effective Serverless with JS

slide-3
SLIDE 3

@eoins

The Modern Application

Scalable User-focused Reliable Intelligent Fast to market Experimental!

slide-4
SLIDE 4

@eoins

The best way to build a modern application

slide-5
SLIDE 5

@eoins

Build it with Wordpress!

slide-6
SLIDE 6

@eoins

Build it with Haskell!

slide-7
SLIDE 7

@eoins

Build it with Rails!

slide-8
SLIDE 8

@eoins

Build it with Erlang!

slide-9
SLIDE 9

@eoins

Build it with Java Microservices

  • n Kubernetes
slide-10
SLIDE 10

@eoins

Build it with Serverless using JavaScript

slide-11
SLIDE 11

@eoins

Why would you do this?!!

slide-12
SLIDE 12

@eoins

THE PURSUIT OF PERFECTION REALITY

slide-13
SLIDE 13

@eoins

There are always trade-offs

slide-14
SLIDE 14

@eoins

The pursuit of perfection

slide-15
SLIDE 15

@eoins David Redfern/Redferns/Getty Images

slide-16
SLIDE 16

@eoins

slide-17
SLIDE 17

@eoins

CLOUD IaC MICROSERVICES INFRASTRUCTURE COMPLEXITY FUNCTIONS AS A SERVICE

λ

MANAGED SERVICES

slide-18
SLIDE 18

@eoins

#1 - Managed Services (incl. FaaS) #2 - Event-driven #3 – Pay only for what you use #4 – No idling infrastructure #5 – Less code Serverless

slide-19
SLIDE 19

@eoins

JavaScript

slide-20
SLIDE 20

@eoins

The Success of Node.js

Event-Driven I/O Single thread Developer Productivity Modules

Comprehend Find Create Ditch Easy to:

slide-21
SLIDE 21

@eoins

Is JS a Good Fit for Serverless?

Maybe not…

  • One process per request
  • No HTTP server
  • Lack of types

But actually…

  • Fast to start
  • Fast runtime
  • No compilation overhead
  • Huge module ecosystem
  • Familiarity, ubiquity
  • Still highly productive!
  • JSON
slide-22
SLIDE 22

@eoins

50-60% of Lambda Functions

New Relic, For the Love of Serverless 2020 Report

slide-23
SLIDE 23

@eoins

Should We Choose JavaScript?

It matters less than ever before Start with what you know Experiment Solve the problems you observe

slide-24
SLIDE 24

@eoins handler.js

slide-25
SLIDE 25

@eoins lib/accommodation.js

slide-26
SLIDE 26

@eoins serverless.yml

slide-27
SLIDE 27

@eoins

curl https://8dmtx7a123.execute-api.eu-west- 1.amazonaws.com/dev/accomodation\?county\=Louth

slide-28
SLIDE 28

@eoins

requestId requestId: d791228a-687f-45ed- 918c-3165a7c20f5c, ip ip: 91.123.228.33, caller caller: -, user user: - , requestTime requestTime: 29/Feb/2020:14:23:14 +0000, httpMethod httpMethod: GET, resourcePath resourcePath: /accomodation, status status: 200, protocol protocol: HTTP/1.1, responseLength responseLength: 105418

slide-29
SLIDE 29

@eoins

Challenges

Learning Curve Best Practices? Moving Target New Models Organisational Change Migration is Hard

slide-30
SLIDE 30

@eoins

Serverless Adoption Rollercoaster

Experience Joy

Initial PoC Architecting a Production Application MVP Deployed Migrate DynamoDB Schema Scaling to massive user numbers! Lock down API Gateway + IAM Roles Maturity

slide-31
SLIDE 31

@eoins

  • 1. Put all best practices together
  • 2. Make opinionated decisions
  • 3. Replicate production environment
  • 4. Make it open source
slide-32
SLIDE 32

@eoins

slide-33
SLIDE 33

@eoins

slic.app

slide-34
SLIDE 34

@eoins

slide-35
SLIDE 35

@eoins

slide-36
SLIDE 36

@eoins

slide-37
SLIDE 37

@eoins

slide-38
SLIDE 38

@eoins

Targets AWS

slide-39
SLIDE 39

@eoins

slide-40
SLIDE 40

@eoins

Separate Accounts

slide-41
SLIDE 41

@eoins

Serverless Framework CDK

slide-42
SLIDE 42

@eoins

Infrastructure

slide-43
SLIDE 43

@eoins

Infrastructure

slide-44
SLIDE 44

@eoins

Infrastructure

slide-45
SLIDE 45

@eoins

CDK

slide-46
SLIDE 46

@eoins

Continuous Deployment

Essential Infrastructure resources + code Deployment time is critical

slide-47
SLIDE 47

@eoins

slide-48
SLIDE 48

@eoins

Observability

slide-49
SLIDE 49

@eoins

Structured Logs

{"level":30,"time":1575753091452,"pid":88157,"hostname":" eoinmac","name":"pino-logging- example","a":1,"b":2,"msg":"Hello world","v":1}

slide-50
SLIDE 50

@eoins

Centralized Logs

slide-51
SLIDE 51

@eoins

Service Metrics

Service Example Metrics Lambda Invocations, Errors, IteratorAge, ConcurrentExecutions DynamoDB ReturnedBytes, ConsumedWriteCapacityUnits Lex MissedUtteranceCount,RuntimePollyErrors Textract UserErrorCount, ResponseTime Rekognition DetectedFaceCount,DetectedLabelCount Polly RequestCharacters, ResponseLatency

slide-52
SLIDE 52

@eoins

Application and Service Metrics

slide-53
SLIDE 53

@eoins

Application and Service Metrics

slide-54
SLIDE 54

@eoins

slide-55
SLIDE 55

@eoins

Distributed Tracing

slide-56
SLIDE 56

@eoins

Distributed Tracing

slide-57
SLIDE 57

@eoins

slide-58
SLIDE 58

@eoins

slide-59
SLIDE 59

@eoins

Chapter 6!

slide-60
SLIDE 60

@eoins

Serverless is about productivity and agility Don’t seek perfection Move out of your comfort zone enough Check out SLIC Starter to avoid some Serverless pitfalls!

slide-61
SLIDE 61

@eoins

Thank You