Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS -...

51
Serverless, Well Actually... Bob Kepford

Transcript of Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS -...

Page 1: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

Serverless, Well Actually...Bob Kepford

Page 2: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 2

Bob is a Lead Architect at Mediacurrent who has been

slinging Drupal code since 2008. An active member of

the Drupal community, Bob manages the Fresno,

California Drupal User's Group, co-organizes the

Decoupled Days Conference, belongs to the Drupal

Association, and is the editor of TheWeeklyDrop, a

popular Drupal newsletter.

When he's not in front of a computer, Bob enjoys a

good cup of coffee, playing bass, watching Dodgers

baseball, and hanging out with his wife and two sons in

sunny California.

Bob KepfordLead Architect

/in/kepford

@kepford

Page 3: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 3

About Mediacurrent

Page 4: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 4

Who We Are

Mediacurrent is a full-service digital agency that

implements world class open source software

development, strategy, and design to achieve

defined goals for enterprise organizations

seeking a better return on investment.

Page 5: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 5

Serverless, what is it?

...cloud-computing execution model in which the cloud provider acts as the server, dynamically managing the allocation of machine resources.

Pricing is based on the actual amount of resources consumed by an application, rather than on pre-purchased units of capacity.”

“~ Wikipedia

Page 6: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 6

Mediacurrent is a full-service digital agency that

implements world class open source software

development, strategy and design to achieve defined

goals for enterprise organizations seeking a better

return on investment.

Who We Are

Page 7: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 7https://readwrite.com/2012/10/15/why-the-future-of-software-and-apps-is-serverless/

“The phrase “serverless” doesn’t mean servers are no longer involved. It simply means that developers

no longer have to think that much about them.”~ Ken Fromm

Page 8: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 8

So there IS a Server!

Page 9: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 9

Yeah. The Name. Whatever.

Page 10: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 10

Page 11: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 11

4 Pillars of Serverless

1. Service based

2. Cloud runtime

3. Usage based pricing

4. Managed infrastructure

~ Bob Kepford - noted tech luminary

Page 12: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 12

S.C.U.M.

Page 13: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 13

So What’s the Big Deal?

Low start up cost Predictable Pricing Web Scale Write your front-end &

back-end Javascript

Built for microservices

approaches

Page 14: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 14

Components of Serverless

● FaaS (Functions as a Service)

● HTTP Endpoints

● Events / Scheduling

● File Services

● Data stores (SQL/NoSQL)

● Messaging Services (Email, SMS)

● Queuing Services

● Authentication Services

● Logging Services

Page 15: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 15

How'd We Get Here?

● Microservices

● AWS

● PaaS / Containerization

● Kubernetes

● Serverless

Page 16: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 16

Service Providers

● Amazon (AWS)

● Google (Cloud & Firebase)

● Microsoft (Azure)

● IBM (Uses Apache OpenWhisk which is OSS)

● Some that build on top of AWS like Webtask

Page 17: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 17

Serverless Languages

Page 18: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 18

Languages Used for Serverless Development

Page 19: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 19

Common Uses

● Static websites - contact forms

● Image processing

● Ops / Infrastructure

● IoT

● Data normalization - GraphQL Server

● Offloading expensive tasks from your web server

● Serverless at the edge

● Bots - A Slackbot

● Avoid high upfront costs for infrastructure

Page 20: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 20

● Discrete API functionality

● Scale is a concern

● Cost is a concern

● Maintenance is a concern

● Tight timeline &

inexperienced team

● Execution time is critical

● Need co-located resources

● Pricing: Some high traffic

situations. Mileage varies

When should I use it? When should I avoid it?

Page 21: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 21

How much does it cost?

● It depends...

● Do your homework and use Calculators

● It can be cost effective

● Set billing limits and notifications

Page 22: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 22

Concerns● Vendor Lock-In

● Identity & Access Management

● Cold starts

Page 23: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 23

● Serverless framework - serverless.com

● Serverless Plugins - github.com/serverless/plugins

● SAM (AWS Serverless Application Model) -

github.com/awslabs/serverless-application-model

Frameworks and Tools

Page 24: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 24

● CLI tool for deployment

● Standardizes project structure

● Rich plugin ecosystem

● Eases migration between providers

Serverless Framework

Page 25: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 25

Getting Startednpm install serverless -g

serverless create --template aws-nodejs --path my-service

cd my-service

Page 26: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 26

Real World Use Case

Page 27: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 27

Page 28: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 28

Page 29: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 29

github.com/kepford/serverless-feedbin-to-pinboard

Feedbin to Pinboard

Page 30: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 30

Page 31: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 31

Project Directory

Page 32: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 32

serverless.yml

Page 33: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 33

serverless.yml

Page 34: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 34

serverless.yml

Page 35: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 35

package.json

Page 36: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 36

handler.js getIds()

Page 37: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 37●●●●●●

handler.js getItems()

Page 38: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 38

Deployment

sls deploy

sls deploy -s prod

sls deploy -f functionName -s dev

Page 39: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 39

Serverless Deploy

Page 40: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 40

Project Teardown

sls remove

sls remove -s prod

Page 41: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 41

Removal

Page 42: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 42

Logging? Yep!

sls logs -f hello -s dev -t

Tail the logs on dev for function named hello.

Page 43: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 43

Local Development? Yep

sls offline start

sls invoke -f functionName -l

Page 44: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 44

Serverless Offline

Page 45: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 45

The Serverless Revolution is Coming

Page 46: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 46

Resources

● Think FAAS with TREK10 - Podcast

● The Serverless Framework with Node.js & AWS - Udemy Course

● Serverless Status - Newsletter

● Serverless Chronicle - Newsletter

● The Power of Serverless - Site for Frontend Developers

● Visualizing Cloud Starts - by Mikhail Shilkov

● Debunking Serverless Tropes 🔥 - Ryan Marsh

Page 47: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

Call for papersThe Decoupled Days 2019 call for papers is extended until May 3, 2019 at 11:59pm EST.

SponsorshipsFor sponsorship information, reach out to our team at [email protected].

@decoupleddaysFollow us on Twitter to stay updated on important announcements.

#decoupleddays • decoupleddays.com • @decoupleddays

Page 48: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

Friday, April 12, 2019

#DrupalContributions

Contribution Opportunities

9:00-18:00Room: 602

Mentored Contribution

First TimeContributor Workshop

9:00-12:00Room: 606

GeneralContributions

9:00-18:00Room: 6A

Join Us!

Page 49: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

Thank you!

@mediacurrent

What did you think?Locate this session at the DrupalCon Seattle website:

http://seattle2019.drupal.org/schedule

Take the Survey!https://www.surveymonkey.com/r/DrupalConSeattle

Page 50: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 50

Title

Text

Page 51: Well Actually Serverless, - DrupalCon Well Actually...The Serverless Framework with Node.js & AWS - Udemy Course Serverless Status - Newsletter Serverless Chronicle - Newsletter The

| 51

Today’s Team

Josh LinardVP, Sales

Executive Sponsor

Dave TerryPartner, Client Services

Bill ShaouySenior Business Analyst

Matt DavisLead Architect

Emerging Technology

●●●●●●