When we talk about prices, we often only talk about Lambda costs. In our applications, however, we rarely use only Lambda. Usually we have other building blocks like API Gateway, data sources like SNS, SQS or Kinesis. We also store our data either in S3 or in serverless databases like DynamoDB or recently in Aurora Serverless. All of these AWS services have their own pricing models to look out for. In this talk, we will draw a complete picture of the total cost of ownership in serverless applications and present a decision-making list for determining if and whether to rely on serverless paradigm in your project. In doing so, we look at the cost aspects as well as other aspects such as understanding application lifecycle, software architecture, platform limitations, organizational knowledge and plattform and tooling maturity. We will also discuss current challenges adopting serverless such as lack of high latency ephemeral storage, unsufficient network performance and missing security features.
4. The Value Proposition of
Serverless
Let’s talk about of Total Cost of
Ownership of the Serverless paradigm
5. TCO Full Picture
No Infrastructure
Operation and
Maintenance
Forrest Brazeal „The Business Case For Serverless” https://www.trek10.com/blog/business-case-for-serverless
7. 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
8. Auto Scaling And Fault 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?
9. TCO Full Picture
No Infrastructure
Operation and
Maintenance
Auto Scaling and
Fault Tolerance
Built in
Own less, build more
Forrest Brazeal „The Business Case For Serverless” https://www.trek10.com/blog/business-case-for-serverless
“AWS Lambda is winning, but first it had to die” https://acloudguru.com/blog/engineering/aws-lambda-is-winning-but-first-it-had-to-die
10. 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
11. TCO Full Picture
No Infrastructure
Operation and
Maintenance
Auto Scaling and
Fault Tolerance
Built in
Own less, build more
Lower technical debt
Forrest Brazeal „The Business Case For Serverless” https://www.trek10.com/blog/business-case-for-serverless
13. TCO Full Picture
No Infrastructure
Operation and
Maintenance
Auto Scaling and
Fault Tolerance
Built in
Own less, build more
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
14. Focus On Business Value and
Innovation
Every organization wants exactly this!
15. Total Cost of Ownership of the Serverless paradigm
No Infrastructure
Operation and
Maintenance
Auto Scaling and
Fault Tolerance
Built in
Own less, build more
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
16. 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?
21. Explore phase
• Quickly validate
hypotheses
• Rapidly experiment
• Run experiments as
cheaply as possible
Serverless is a perfect fit
Image: burst.shopify.com/photos/a-look-across-the-landscape-with-view-of-the-sea Vadym Kazulkin @VKazulkin , ip.labs GmbH
22. Exploit phase
• Built something that does
provide customer value
• Build it on scale
• Build a profitable product
around it
partly serverless and partly not
serverless architecture
Image: Robert Scoble via Flickr Vadym Kazulkin @VKazulkin , ip.labs GmbH
23. Application lifecycle
• How much of my stack should I own
to be able to deliver business value?
• What should I outsource to my
service provider : SLA, regulatory
compliance, price, and roadmap?
Vadym Kazulkin @VKazulkin , ip.labs GmbH
24. Existing
applications
• You can’t magically move
them to the cloud providers
(especially make your
application Serverless)
• You can try to modernize
parts of them
Vadym Kazulkin @VKazulkin , ip.labs GmbH
25. Strangler Pattern
• Add a proxy (API
Gateway or Application
Loadbalancer), which
sits between the legacy
application and the user
• Add new services and
link it to the proxy
Marin Fowler „StrangerFigApplication” https://martinfowler.com/bliki/StranglerFigApplication.html Vadym Kazulkin @VKazulkin , ip.labs GmbH
26. 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
28. Understand your
workloads
• Event-driven
• API-driven
• Batch Job
• Internal Tool
• ML/AI
• Big Data
Image: flickr.com/photos/everywhereatonce/294789504 Vadym Kazulkin @VKazulkin , ip.labs GmbH
29. Lambda Layers
& Lambda
Runtime API
Door opener for use
cases like:
• Big Data
• ML/AI
Vadym Kazulkin @VKazulkin , ip.labs GmbH
A Shared File System
for Your Lambda
Functions
Door opener for use case
like:
• ML/AI
30. Understand your workloads
• Do we need to access specialized
hardware ?
• GPU access required?
• Another RAM/CPU ratio?
• Do we need constantly high
performance?
• Response time below 100 ms
(bidding or gaming platforms)
“A Berkeley View on Serverless Computing” https://www2.eecs.berkeley.edu/Pubs/TechRpts/2019/EECS-2019-3.html
31. Understand your workloads
• Do we need high throughput ?
• Lambda‘s network bandwidth is limited
(an order of magnitude lower than a
single modern SSD) shared between all
functions packed on the same VM
• Do functions need to communicate with
each other?
• functions are not directly network
accessible, they must communicate via
an intermediary service
“A Berkeley View on Serverless Computing” https://www2.eecs.berkeley.edu/Pubs/TechRpts/2019/EECS-2019-3.html
34. :
Source: Ajay Nair „Become a Serverless Black Belt” https://www.youtube.com/watch?v=oQFORsso2go
Cold Start
35. AWS Lambda cold start duration
per programming language
Source: Mikhail Shilkov: „AWS Lambda: Cold Start Duration per Language. 2020 edition” https://mikhail.io/serverless/coldstarts/aws/languages/
36. Cold start duration
• Below 1 second is best-case cold start duration for very simple Lambda
like HelloWorld with no dependencies
• It goes up significantly with more complex scenarios
• Dependencies to multiple OS projects
• Clients instantiation outside of the handler method to communicate with other
(AWS) services (e.g. DynamoDB, SNS, SQS, 3rd party)
• To minimize the cold start time apply best practices specific to your
programming language
• Worst-case cold starts can be higher than 10 and even 20 seconds
38. Don‘t be scared
of cold starts
To avoid cold starts them
completely, you have to :
• Overpay
• Overprovision
Cold starts don’t really
matter if the you make
the call asynchronously
Vadym Kazulkin @VKazulkin , ip.labs GmbH
39. Max connection limit
of RDS
• Max number of connections depends
on the RAM of the selected RDS
• for db.t3.medium 450 max
connections
• Solutions for not reaching the max
connection limit for calling RDS from
Lambda
• Use NoSQL Database (DynamoDB)
• Use RDS-Proxy
• Use Data API for Aurora Serverless
Vadym Kazulkin @VKazulkin , ip.labs GmbH
40. Understand Service
Quotas 1/2
• Max parallel executions of all
Lambdas in each AWS Account per
Region
• Soft limit of 500-3000 parallel
• API Gateway throttle limit
• 1000 requests per second
• Invocation duration & timeouts
• Lambda 15min
• API Gateway integration 29sec
Vadym Kazulkin @VKazulkin , ip.labs GmbH
James Beswick: Operating Lambda: Application design and Service Quotas
https://aws.amazon.com/blogs/compute/operating-lambda-application-design-and-service-quotas-part-1/
41. Understand Service
Quotas 2/2
• Payload limit
• API Gateway 10 Mb
• Lambda 6 Mb
• SQS 256 Kb
• Max Memory assigned to Lambda
• 10GB
Vadym Kazulkin @VKazulkin , ip.labs GmbH
52. Tom McLaughlin Talk:
What do we do when
the server goes away?
• Observability (Logging, Monitoring,
Tracing, & Alerting
• Chaos Engineering & Game Days
• Help understand constraints
of AWS services & choose the right
one
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
Charity Majors „The Future of Ops Careers” https://thenewstack.io/the-future-of-ops-careers Vadym Kazulkin @VKazulkin , ip.labs GmbH
53. Help understand constraints of AWS services &
choose the right one. Example Event Sources:
Vadym Kazulkin @VKazulkin , ip.labs GmbH
54. 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
55. 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
57. Co-evolution of practices with
Serverless 1/2
• True DevOps
• Complete infrastructure automation
• Chaos Engineering
• 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/
58. Co-evolution of practices with
Serverless 2/2
• Each team or even developer can have its own
(AWS test) account per feature or service
• Only minimal local testing (quick functional
tests)
• Adopt “testing in production”
Michael Bryzek “What do you know about testing in production?” https://www.youtube.com/watch?v=z-ATZTUgaAo