How AWS builds Serverless services using Serverless

A presentation at Serverless Days - Boston in March 2019 in Boston, MA, USA by Chris Munns

Slide 1

Slide 1

How AWS builds Serverless services using Serverless Chris Munns Principal Developer Advocate AWS Serverless © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Slide 2

Slide 2

Why are we here today? © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. https://secure.flickr.com/photos/mgifford/4525333972

Slide 3

Slide 3

Serverless is changing the software industry © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Photo by Markus Spiske on Unsplash

Slide 4

Slide 4

Amazon is no different in this! © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Photo by Chris Munns

Slide 5

Slide 5

So how does AWS build Serverless Services Using Serverless? © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Slide 6

Slide 6

So how does AWS build Serverless Services Using Serverless? With a compiler! © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Slide 7

Slide 7

So how does AWS build Serverless Services Using Serverless? With a compiler! ba-dum-tshh © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Photo by Josh Sorenson on Unsplash

Slide 8

Slide 8

Less time managing servers == more laughs! © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Slide 9

Slide 9

For today A look at how Amazon does development © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. How serverless has changed things What you can learn from us

Slide 10

Slide 10

Development transformation at Amazon: 1994-2001 monolithic architecture + hierarchical organization © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 2002+ decoupled services + 2 pizza teams

Slide 11

Slide 11

Two-pizza teams Full ownership Full accountability Aligned incentives “DevOps” © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Slide 12

Slide 12

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Slide 13

Slide 13

Amazon S3 at launch: © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Slide 14

Slide 14

Amazon S3 today: © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Slide 15

Slide 15

2 Pizza Team Responsibility Venn Diagram THEIR PRODUCT Responsible for © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. * Deployment tools CI/CD tools Monitoring tools Metrics tool Logging tools APM tools Infrastructure provisioning tools Security tools Database management tools Testing tools …. Not responsible for *Unless their product belongs in the blue

Slide 16

Slide 16

Self-service Technology-agnostic Encourage best practices Single-purpose services © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Slide 17

Slide 17

2 Pizza Team Responsibility Venn Diagram THEIR PRODUCT Responsible for © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. * Deployment tools CI/CD tools Monitoring tools Metrics tool Logging tools APM tools Infrastructure provisioning tools Security tools Database management tools Testing tools …. Not responsible for *Unless their product belongs in the blue

Slide 18

Slide 18

Deployment service No downtime deployments Health checking Versioned artifacts and rollbacks © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Slide 19

Slide 19

Pipelines Automated actions and transitions; from check-in to production Development benefits: • Faster • Safer • Consistent & Standardized • Visualization of the process © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Slide 20

Slide 20

continuous delivery == happier developers! © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. https://www.flickr.com/photos/cannnela/4614340819/

Slide 21

Slide 21

Thousands of teams × Microservice architecture × Continuous delivery × Multiple environments

60 million deployments a year* *2016 number © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Slide 22

Slide 22

2 Pizza Team Responsibility Venn Diagram Application development Infrastructure management Application configuration Pipeline configuration Alarms Runbooks Testing Compliance Roadmap tracking Goals tracking On-call Support escalation …. Responsible for © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. * NOT THEIR PRODUCT Not responsible for *Unless their product belongs in the blue

Slide 23

Slide 23

Quick poll! How many of you run in 7 or fewer AWS Regions? How many of you run in 5 or fewer AWS Regions? How many of you run in just 2 AWS Regions? How many of you run in just 1 AWS Region? © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Slide 24

Slide 24

https://aws.amazon.com/about-aws/global-infrastructure/ © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Slide 25

Slide 25

Determining the right balance The more time spent on operational tasks, the less time spent on development tasks © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Slide 26

Slide 26

2 Pizza Team Responsibility Venn Diagram Can we shift more from a NOTto the team’s responsibility THEIR THEIR platform/shared services? PRODUCT PRODUCT Responsible for © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Not responsible for

Slide 27

Slide 27

So that brings us back to… © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Slide 28

Slide 28

OK, let’s get real © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Photo by Clem Onojeghuo on Unsplash

Slide 29

Slide 29

From the earliest days of AWS Lambda we saw lots of repeatable patterns (internally and externally) © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Photo by Kristian Strand on Unsplash

Slide 30

Slide 30

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Slide 31

Slide 31

SQS queue © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Slide 32

Slide 32

SQS queue SQS queue © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Slide 33

Slide 33

SQS queue DLQ SQS queue DLQ © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. DLQ

Slide 34

Slide 34

SQS queue DLQ Alarm DLQ Alarm Alarm SQS queue © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. DLQ

Slide 35

Slide 35

SQS queue DLQ Redrive DLQ Alarm DLQ Alarm Alarm SQS queue DLQ Redrive © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. DLQ DLQ Redrive

Slide 36

Slide 36

SQS queue DLQ Redrive DLQ Alarm DLQ Alarm Alarm SQS queue DLQ Redrive © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. DLQ DLQ Redrive

Slide 37

Slide 37

SQS queue DLQ Redrive DLQ Alarm DLQ Alarm Alarm SQS queue DLQ Redrive © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. DLQ DLQ Redrive

Slide 38

Slide 38

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Slide 39

Slide 39

Publishing Applications Publisher Console Publish Apps Publishers (AWS Customers) © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS SDK

Slide 40

Slide 40

Consuming Applications Public Website Discover & Deploy Apps Lambda Console Consumers (AWS Customers) AWS SDK © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Slide 41

Slide 41

SQS queue DLQ Redrive DLQ Alarm DLQ Alarm Alarm SQS queue DLQ Redrive © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. DLQ DLQ Redrive

Slide 42

Slide 42

SQS queue sqs-dlq app SQS queue sqs-dlq app © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. lambda-dlq app

Slide 43

Slide 43

SQS queue sqs-dlq app SQS queue sqs-dlq app © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. lambda-dlq app

Slide 44

Slide 44

fork-event-search-analytics-pipeline app SQS queue sqs-dlq app © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. lambda-dlq app

Slide 45

Slide 45

AWS Serverless Application Repository API © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/serverlessrepo.html

Slide 46

Slide 46

Auth Lambda SDK API API Lambda Auth Lambda Search API Assets Bucket Entity/View Tables API Lambda Search Domain © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Async Processing Lambdas

Slide 47

Slide 47

Auth Lambda SDK API API Lambda Auth Lambda Search API Assets Bucket Entity/View Tables API Lambda Search Domain © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Async Processing Lambdas

Slide 48

Slide 48

Auth Lambda SDK API API Lambda Auth Lambda Search API Assets Bucket Entity/View Tables API Lambda Search Domain © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Async Processing Lambdas

Slide 49

Slide 49

Auth Lambda SDK API API Lambda Auth Lambda Search API Assets Bucket Entity/View Tables API Lambda Search Domain © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Async Processing Lambdas

Slide 50

Slide 50

Auth Lambda SDK API API Lambda Auth Lambda Search API Assets Bucket Entity/View Tables API Lambda Search Domain © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Async Processing Lambdas

Slide 51

Slide 51

Auth Lambda SDK API API Lambda Auth Lambda Search API Assets Bucket Entity/View Tables API Lambda Search Domain © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Async Processing Lambdas

Slide 52

Slide 52

Not seen • Async processing Lambdas interfacing with Amazon SNS/Amazon SQS • A few other internal services • Alpha/beta/gamma • Multiple regions © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Slide 53

Slide 53

Not seen • Async processing Lambdas interfacing with Amazon SNS/Amazon SQS • A few other internal services • Alpha/beta/gamma • Multiple regions • A single Amazon EC2 instance per region, to test that the service is working properly BEST PRACTICE ALERT: Don’t test from the managed service to managed service to be tested © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Slide 54

Slide 54

Did building serverless-ly mean a massive shift in tools/practices? © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Photo by Carlos Irineu da Costa on Unsplash

Slide 55

Slide 55

Nope. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Slide 56

Slide 56

Building with Serverless services at AWS • • • • • Using Amazon CloudFormation/AWS SAM to manage infrastructure Leveraging existing CI/CD tools that have been tweaked to support tools like SAM Difference in telemetry data made up for with more logging and usage of tools like AWS X-Ray Same languages as always: Java, Python, Node.js Little to no changes in development/testing practices: • • • • peer review test in “cloud” linting, syntax checking, unit/service testing canary deploy out slowly & rollback immediately if things go boom © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Slide 57

Slide 57

“Tell me your biggest pain points right now” © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Photo by Zhen Hu on Unsplash

Slide 58

Slide 58

Tell me your biggest pain points right now: Limits Scoping the size of a service Proper “stack” boundaries Improving alarms/monitoring Improving testing (always) © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Slide 59

Slide 59

Tell me your biggest pain points right now: Limits Scoping the size of a service Proper “stack” boundaries AWS Service teams are Improving alarms/monitoring Improving testing (always) © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. just like you!

Slide 60

Slide 60

Tell me your biggest pain points right now: Limits Scoping the size of a service Proper “stack” boundaries AWS Service teams are Improving alarms/monitoring Improving testing (always) just like you! Except……. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Slide 61

Slide 61

What you can do to be like AWS • Organizational structure aligns with microservice based architecture which aligns well with serverless • Standardized, yet flexible tools made supporting serverless essentially “snapping in” new capabilities • CI/CD is a must • Peer review is the one thing you aren’t doing but should • Understanding when you need a REST API vs. using another invoke model • related: Sync vs. async © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Slide 62

Slide 62

What you can do to be like AWS • If moving to #serverless feels like a giant shift for your org/team, move slow and purposefully • If someone is telling you that you need all new tools to develop for serverless, they are wrong or selling you something • Potentially something that competes What customers tell me: Serverless benefits pay off vs. the time ramping up © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Slide 63

Slide 63

Yawn.. Well that was kinda.. boring…? © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Photo by Raphael Schaller on Unsplash

Slide 64

Slide 64

That’s kind of the idea… and it can lead to an exciting future © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Slide 65

Slide 65

Going back to Amazon © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Photo by Chris Munns

Slide 66

Slide 66

What happens if we reduce operational burden massively and reduce the amount of code we have to write? © 2018, 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Slide 67

Slide 67

What if 2 pizzas is 1 too many? © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Slide 68

Slide 68

?x more Thousands of teams × Microservice architecture If fewer people are needed to × Continuous delivery build things, can we build Multiple environments more× things & faster??? > XXX million deployments a year? © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Slide 69

Slide 69

About me: Chris Munns - munns@amazon.com, @chrismunns • Principal Developer Advocate - Serverless • New Yorker • Previously: • AWS Business Development Manager – DevOps, July ’15 - Feb ‘17 • AWS Solutions Architect Nov, 2011- Dec 2014 • Formerly on operations teams @Etsy and @Meetup • Little time at a hedge fund, Xerox and a few other startups • Rochester Institute of Technology: Applied Networking and Systems Administration ’05 • Internet infrastructure geek © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Slide 70

Slide 70

aws.amazon.com/serverless © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Slide 71

Slide 71

Chris Munns munns@amazon.com @chrismunns © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. https://www.flickr.com/photos/theredproject/3302110152/

Slide 72

Slide 72

? © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. https://secure.flickr.com/photos/dullhunk/202872717/