The goal of Serverless is to focus on writing the code that delivers business value and offload everything else to your trusted partners (like Cloud providers or SaaS vendors). You want to iterate quickly and today’s code quickly becomes tomorrow’s technical debt. In this talk we will show why Serverless adoption increases the developer productivity and how to measure it. We will also go through AWS Serverless architectures where you only glue together different Serverless managed services relying solely on configuration, minimizing the amount of the code written.
Measure and Increase Developer Productivity with Help of Serverless at AWS Community Day Bay Area 2020
1. Measure and increase developer
productivity with the help of Serverless
Vadym Kazulkin, ip.labs
November 13, 2020
Bay Area
2. Contact
Vadym Kazulkin
ip.labs GmbH Bonn, Germany
Co-Organizer of the Java User Group Bonn
and Serverless Bonn Meetup
v.kazulkin@gmail.com
@VKazulkin
https://www.linkedin.com/in/vadymkazulkin/
https://www.iplabs.de/
7. Cognitive Load
• Intrinsic
• Extraneous
• How to automate tests (unit, integration, end-to-end, web, desktop, mobile)
• How to build, package, deploy and run my application
• How to configure monitoring, alerting, auto-scaling, logging and tracing
• How to operate and maintain infrastructure
• How to build-in fault-tolerance and resiliency
• How to make the hardware, networking and application secure
• Germane
8. Cognitive Load
• Intrinsic
• Extraneous
• Germane
• Domain Knowledge (payment, e-commerce)
• Business processes and workflows
9. Cognitive Load
• Intrinsic ->
become fluent in it
• Extraneous ->
minimize amount of what we
implement/operate/support/own by ourselves
• Germane ->
minimize amount of what we have to implement
by ourselves
11. What is holding us back from
being productive?
Technical Debt - reflects the implied cost
of additional rework caused by choosing an
easy (limited) solution now instead of using
a better approach that would take longer
”The Cost of Poor Quality Software in the US: A 2018 Report”
https://www.it-cisq.org/the-cost-of-poor-quality-software-in-the-us-a-2018-report/The-Cost-of-Poor-Quality-Software-in-the-US-2018-Report.pdf
12. Technical Debt
• Even a perfect solution can become the
technical debt over the time
• Version of programming language comes
out of support (Java 8, JS Frameworks)
• Security considerations forces us to
upgrade one of our dependencies (library
or web application server version)
• One of our dependencies (e.g. to open
source project) is discontinued
13. Technical Debt
Think of what can happen to your software over
the entire life cycle of our product
14. Technical Debt
• is related to amount of code written
• is related to amount of dependencies used
• open source projects, programming
languages, databases, (web) application
servers
15. Legacy Systems are systems that can’t
evolve
”The Cost of Poor Quality Software in the US: A 2018 Report”
https://www.it-cisq.org/the-cost-of-poor-quality-software-in-the-us-a-2018-report/The-Cost-of-Poor-Quality-Software-in-the-US-2018-Report.pdf
Legacy System
17. Evolutionary Architecture –
Fitness functions
• Source code metrics (such as measuring
cyclomatic complexity)
• Unit tests (% of coverage and % of success)
• Performance metrics (such as API latency or
throughput)
• Security (encryption at rest, e.g. checking that all S3
buckets have encryption enabled, or automatic key rotation
for all external APIs, with tools such as the AWS Secrets
Manager)
• ArchUnit, Sonar, CI/CD Tools
• CodeCommit,…CodeDeploy, Jenkins
Danilo Poccia „ Serverless + Evolutionary Architectures + Safe Deployments = Speed in the Right Direction”
https://blog.usejournal.com/serverless-evolutionary-architectures-safe-deployments-speed-in-the-right-direction-7b4b01e27254
18. The Value Proposition of
Serverless
But let’s talk about of Total Cost of Ownership of
the Serverless paradigm
19. TCO Full Picture
No Infrastructure
Operation and
Maintenance
Forrest Brazeal „The Business Case For Serverless” https://www.trek10.com/blog/business-case-for-serverless
21. TCO Full Picture
No Infrastructure
Operation and
Maintenance
Auto Scaling and
Fault Tolerance
Built in
Forrest Brazeal „The Business Case For Serverless” https://www.trek10.com/blog/business-case-for-serverless
22. Auto Scaling And Faul Tolerance
Built In
• Can you get capacity planning
and auto scaling right?
• Do you want to solve the hard problem
of fault tolerance by yourself?
23. TCO Full Picture
No Infrastructure
Operation and
Maintenance
Auto Scaling and
Fault Tolerance
Built in
Do more with less
Forrest Brazeal „The Business Case For Serverless” https://www.trek10.com/blog/business-case-for-serverless
24. Do more with less
By heavily relying on the managed
Serverless services you
• Need fewer engineers to start
implementing your new product idea
• Can do more with the same amount of
people
25. TCO Full Picture
No Infrastructure
Operation and
Maintenance
Auto Scaling and
Fault Tolerance
Built in
Do more with less
Lower technical
debt
Forrest Brazeal „The Business Case For Serverless” https://www.trek10.com/blog/business-case-for-serverless
27. TCO Full Picture
No Infrastructure
Operation and
Maintenance
Auto Scaling and
Fault Tolerance
Built in
Do more with less
Lower technical
debt
Focus on Business
Value and Innovation
Forrest Brazeal „The Business Case For Serverless” https://www.trek10.com/blog/business-case-for-serverless
28. Focus On Business Value and
Innovation
Every organization wants exactly this!
29. TCO Full Picture
No Infrastructure
Operation and
Maintenance
Auto Scaling and
Fault Tolerance
Built in
Do more with less
Lower technical
debt
Faster Time to
Market
Forrest Brazeal „The Business Case For Serverless” https://www.trek10.com/blog/business-case-for-serverless
Focus on Business
Value and Innovation
30. Faster Time To Market
• Time To Market is the key differentiator in
today’s business!
• Ask yourself: what is core for your business
and what you can get as Commodity +(Utility)
as a Service?
31. Serverless Mindset at ip.labs
“Accelerate Innovation and Maximize Business Value with Serverless Applications”
https://www.slideshare.net/AmazonWebServices/accelerate-innovation-and-maximize-business-value-with-serverless-applications-srv212r1-aws-reinvent-2018
32. How to measure success
See DORA State of DevOps 2018-2019 Reports
36. AWS Lambda Deployment
Best Practices:
• API Gateway Stage variables and Lambda
Aliases
• Lambda Alias Traffic Shifting
Chris Munns: “Testing and Deployment Best Practices for AWS Lambda-Based Applications”
https://www.youtube.com/watch?v=zJQDAsWm-5k&list=LLYgjRSI2oCzI9eooyFrWR7A&index=1
37. AWS Lambda Deployment
Best Practices
• AWS Lambda Alias Canary and Linear Traffic
Shifting & AWS SAM Safe Deployments
• CloudWatch Rollback Alarms & Lambda hooks
Chris Munns: “Testing and Deployment Best Practices for AWS Lambda-Based Applications”
https://www.youtube.com/watch?v=zJQDAsWm-5k&list=LLYgjRSI2oCzI9eooyFrWR7A&index=1
39. Wardley Maps
Simon Wardley https://www.slideshare.net/swardley/why-the-fuss-about-serverless-88107645
Co-evolution of practices
to become productive
with Serverless
40. Co-evolution of practices with
Serverless 1/2
• True DevOps (even DevSecOps)
Sheen Brisals “Why the ‘WHY’ matters more than the ‘WHAT’ in Serverless!”
https://medium.com/lego-engineering/why-the-why-matters-more-than-the-what-in-serverless-2ef56c397962
DevOps Topologies: https://web.devopstopologies.com/
41. Charity Majors: „The Future of Ops careers“
• Advocates for the internal observability team (even if you pay for
SaaS observability solution and use Serverless-first approach)
• team should write libraries, generate examples, and drive
standardization; ushering in consistency, predictability, and usability
• team should partner with internal teams to evaluate use cases. They
might also write glue code and helper modules to connect different
data sources and create cohesive visualizations
• team becomes an integration point between your organization and the
outsourced work
Charity Majors „The Future of Ops Careers”
https://thenewstack.io/the-future-of-ops-careers
Vadym Kazulkin @VKazulkin , ip.labs GmbH
42. Tom McLaughlin Talk:
What do we do when
the server goes away?
• Monitoring & Alerting
• Chaos Engineering & Game Days
• Infrastructure as Code & Testing
• Help understand constraints of
AWS services, trade offs between
them & choose the right one(s)
Tom McLaughlin „What do we do when the server goes away”
https://speakerdeck.com/tmclaugh/serverless-devops-what-do-we-do-when-the-server-goes-away
Vadym Kazulkin @VKazulkin , ip.labs GmbH
43. Help understand constraints of AWS services &
choose the right one. Example Event Sources:
Vadym Kazulkin @VKazulkin , ip.labs GmbH
44. Event Sources
• SQS and SNS are
charged for requests
• Kinesis charges for
shard hours & PUT
requests
Image: https://blog.binaris.com/lambda-pricing-pitfalls/ Vadym Kazulkin @VKazulkin , ip.labs GmbH
45. Event Sources
• Cost for Kinesis grows
with slower rate
• Attractive at to
operate at scale
Image: https://blog.binaris.com/lambda-pricing-pitfalls/ Vadym Kazulkin @VKazulkin , ip.labs GmbH
46. Co-evolution of practices with
Serverless 1/2
• True DevOps (even DevSecOps)
• FinDev responsibilities in the teams
Sheen Brisals “Why the ‘WHY’ matters more than the ‘WHAT’ in Serverless!”
https://medium.com/lego-engineering/why-the-why-matters-more-than-the-what-in-serverless-2ef56c397962
DevOps Topologies: https://web.devopstopologies.com/
47. FinDev Concept
Activity-based costing on a
digital operation-by-operation
basis
• Figure out features which deliver
business value comparing to their
cost
Aleksander Simovic & Mark Schwarz „FinDev and Serverless Microeconomics: Part 1”
https://aws.amazon.com/de/blogs/enterprise-strategy/findev-and-serverless-microeconomics-part-1/
Vadym Kazulkin @VKazulkin , ip.labs GmbH
48. Co-evolution of practices with
Serverless 1/2
• True DevOps (even DevSecOps)
• FinDev responsibilities in the teams
• Complete infrastructure automation
• Chaos Engineering
Sheen Brisals “Why the ‘WHY’ matters more than the ‘WHAT’ in Serverless!”
https://medium.com/lego-engineering/why-the-why-matters-more-than-the-what-in-serverless-2ef56c397962
DevOps Topologies: https://web.devopstopologies.com/
49. Co-evolution of practices with
Serverless 2/2
• Each developer has its own (AWS test) account
even per feature or service
• No local testing environment or only for quick
functional tests
• Testing in production
Michael Bryzek “What do you know about testing in production?” https://www.youtube.com/watch?v=z-ATZTUgaAo
50. Using Serverless ecosystem
with the right engineering practices in place will
significantly reduce
• extraneous and germane cognitive load
• amount of dependencies (i.e. no execution runtime
and web application server to take care of)
• the amount of code written
51. Let’s explore how to write less code
with Serverless ecosystem at AWS
52. How to write less code with
AWS Serverless services
• Write fewer Lambda functions
• Write less Infrastructure as a Code
• Use (AWS) Services/Frameworks which provide meaningful abstractions
53. How to write less code with
AWS Serverless services 1/3
• Write fewer Lambda functions
• use direct AWS service integrations in case the Lambda only
calls the AWS service itself
54. Less Lambda functions means less:
• code to write, test, run and maintain
• CI/CD (deploy, rollback strategies) to maintain
• Infrastructure as a Code (IAM policies, permission) to write and test
• cold-start worries
• point of failures and retries
• security concerns
• worries about Lambda limits (e.g. concurrency settings per AWS account)
• spending on Lambda, CloudWatch and 3rd party SaaS on (AWS) (monthly) bill
Sheen Brisals “Don’t wait for Functionless. Write less Functions instead”
https://medium.com/lego-engineering/dont-wait-for-functionless-write-less-functions-instead-8f2c331cd651
55. How to write less code with
AWS Serverless services 2/3
• Write fewer Lambda functions
• use more direct service integrations in case the Lambda only calls the
Service itself
• Write less Infrastructure as a Code
• applies not only for Lambda but also to other services like AppSync
• Use (AWS) Services/Frameworks which provide meaningful abstractions
• Amplify Framework or Serverless Framework Components
56. How to write less code with
AWS Serverless services 3/3
• API Gateway Service Integration
• HTTP APIs Storage-First Service
Integration
• Step Functions Service Integration
• Event Bridge Filtering and Routing
• Lambda Destinations
• Export DynamoDB Table Data to S3
• AppSync and Direct Lambda
Resolvers
• Amplify Framework
• Serverless Framework
Components
57. Sheen Brisals “Don’t wait for Functionless. Write less Functions instead”
https://medium.com/lego-engineering/dont-wait-for-functionless-write-less-functions-instead-8f2c331cd651
API Gateway Service Integration
58. API Gateway Service Integration with
Dynamo DB : Example ID generator 1/2
Sheen Brisals “Sequence Numbering in Serverless via API Gateway”
https://medium.com/lego-engineering/sequence-numbering-in-serverless-via-api-gateway-40e5f6c83e93
https://github.com/ToQoz/api-gateway-mapping-template
59. API Gateway Service Integration with
Dynamo DB : Example ID generator 2/2
Sheen Brisals “Sequence Numbering in Serverless via API Gateway”
https://medium.com/lego-engineering/sequence-numbering-in-serverless-via-api-gateway-40e5f6c83e93
https://github.com/ToQoz/api-gateway-mapping-template
61. Step Functions Service Integration
“Service Integrations with AWS Step Functions” https://docs.aws.amazon.com/step-functions/latest/dg/concepts-service-integrations.html
62. Event Bridge Filtering and Routing
“Reducing custom code by using advanced rules in Amazon EventBridge”
https://aws.amazon.com/de/blogs/compute/reducing-custom-code-by-using-advanced-rules-in-amazon-eventbridge/
64. Export DynamoDB Table Data to S3
https://aws.amazon.com/de/blogs/aws/new-export-amazon-dynamodb-table-data-to-data-lake-amazon-s3/
65. AppSync and Direct Lambda
Resolvers
https://aws.amazon.com/de/appsync
“Introducing Direct Lambda Resolvers: AWS AppSync GraphQL APIs without VTL” https://aws.amazon.com/de/blogs/mobile/appsync-direct-lambda/
68. Serverless with the focus on you
core domains will enable
• iterative development mind set
• experimentation culture
• focus on business value innovation and
faster time to market
• evolutionary architectures
69. Evolutionary Architecture –
supports guided, incremental
change across multiple dimensions
• Incremental change
• Appropriate architectural coupling
• Fitness functions
”Architectural Coupling” https://learning.oreilly.com/library/view/building-evolutionary-architectures/9781491986356/ch04.html
• Serverless ecosystem supports
evolutionary architectures really
well
• All Serverless solutions often
suffer from the “Antipattern:
Last 10% Trap”
71. A Shared File
System for Your
Lambda
Functions
Door opener for use
case like:
• ML/AI
Christian Bannes and Vadym Kazulkin @VKazulkin , ip.labs GmbH
75. Jeremy Daly: “Mixing VPC and Non-VPC Lambda Functions for Higher Performing Microservices”
https://www.jeremydaly.com/mixing-vpc-and-non-vpc-lambda-functions-for-higher-performing-microservices/ Vadym Kazulkin @VKazulkin , ip.labs GmbH
Lambda behind the
Virtual Private
Cloud (VPC)
76. Lambda behind the VPC
• The network interface creation happens
when Lambda function is created or its
VPC settings are updated
• Reduced additional cold start from approx.
10 seconds to below 1 second
Chris Munns: "Announcing improved VPC networking for AWS Lambda functions”
https://aws.amazon.com/de/blogs/compute/announcing-improved-vpc-networking-for-aws-lambda-functions/
77. Amazon Aurora
Serverless Data
API for MySql and
Postgres available
https://docs.aws.amazon.com/de_de/AmazonRDS/latest/AuroraUserGuide/data-api.html Christian Bannes and Vadym Kazulkin @VKazulkin , ip.labs GmbH
78. RDS Proxy –
Generally Available
for Aurora MySQL, Aurora
PostgreSQL, RDS MySQL
and RDS PostgreSQL
Christian Bannes and Vadym Kazulkin @VKazulkin , ip.labs GmbH
79. Recent CloudWatch Improvements
• Search over multiple Log Groups became possible
• CloudWatch Logs Insights
• enables you to interactively search and analyze your
log data in Amazon CloudWatch Logs
• Embedded Metric Format
• JSON specification used to instruct CloudWatch Logs to
automatically extract metric values embedded in
structured log events.
80. Further Improvement Areas for
Serverless Ecosystem 1/2
• EFS improvements
• Enable calling Lambda upon EFS Events (file created or updated)
• Integrate with AWS compliance and governance services i.e.
AWS Config, AWS CloudTrail like S3 does
• CloudWatch improvements
• Observability (no match to Lumigo or Epsagon)
• Alarms (no match to PagerDuty or Lumigo or Epsagon)
81. Further Improvement Areas for
Serverless Ecosystem 2/2
• CodeCommit improvements
• not nearly comparable to GitHub and BitBucket
• X-Ray support for all (async) Serverless services
• EventBridge