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.
A presentation at Serverless Days - Boston in March 2019 in Boston, MA, USA by Chris Munns
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.
Why are we here today? © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. https://secure.flickr.com/photos/mgifford/4525333972
Serverless is changing the software industry © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Photo by Markus Spiske on Unsplash
Amazon is no different in this! © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Photo by Chris Munns
So how does AWS build Serverless Services Using Serverless? © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
So how does AWS build Serverless Services Using Serverless? With a compiler! © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
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
Less time managing servers == more laughs! © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
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
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
Two-pizza teams Full ownership Full accountability Aligned incentives “DevOps” © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon S3 at launch: © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon S3 today: © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
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
Self-service Technology-agnostic Encourage best practices Single-purpose services © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
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
Deployment service No downtime deployments Health checking Versioned artifacts and rollbacks © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
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.
continuous delivery == happier developers! © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. https://www.flickr.com/photos/cannnela/4614340819/
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.
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
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.
https://aws.amazon.com/about-aws/global-infrastructure/ © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
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.
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
So that brings us back to… © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
OK, let’s get real © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Photo by Clem Onojeghuo on Unsplash
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
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
SQS queue © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
SQS queue SQS queue © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
SQS queue DLQ SQS queue DLQ © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. DLQ
SQS queue DLQ Alarm DLQ Alarm Alarm SQS queue © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. DLQ
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
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
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
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Publishing Applications Publisher Console Publish Apps Publishers (AWS Customers) © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS SDK
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.
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
SQS queue sqs-dlq app SQS queue sqs-dlq app © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. lambda-dlq app
SQS queue sqs-dlq app SQS queue sqs-dlq app © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. lambda-dlq app
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
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
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
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
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
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
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
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
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.
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.
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
Nope. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
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.
“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
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.
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!
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.
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.
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.
Yawn.. Well that was kinda.. boring…? © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Photo by Raphael Schaller on Unsplash
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.
Going back to Amazon © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Photo by Chris Munns
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.
What if 2 pizzas is 1 too many? © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
?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.
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.
aws.amazon.com/serverless © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Chris Munns munns@amazon.com @chrismunns © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. https://www.flickr.com/photos/theredproject/3302110152/
? © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. https://secure.flickr.com/photos/dullhunk/202872717/