The document discusses the "Infinity Stones" concept as an analogy for key considerations when building serverless applications on AWS Lambda. It describes the Space, Time, Mind, Power, Soul and Reality "stones" which represent code size and dependencies, function timeouts and pricing, code design, memory allocation, design principles for scale and performance, and pragmatic considerations for real-world constraints. Understanding these different aspects is important for developing scalable serverless applications.
6. Space Stone - Code Size
● Cold starts are directly proportional to the
deployment package size
● Never have unnecessary code/dependencies
7. Space Stone - Lambda Layers
● a ZIP archive that contains
libraries/dependencies
● Pull in additional code and content
● A function can use up to 5 layers at a time
● Helpful in reducing the code duplications
14. Time Stone - Time
Stats for lambda function that calculates 1000 times all prime numbers less than 1000000
128 mb 11.722965 sec $0.024628
256 mb 6.678945 sec $0.028035
512 mb 3.194954 sec $0.026830
1024 mb 1.456984 sec $0.024638
Stats courtesy:
https://www.slideshare.net/AmazonWebServices/the-best-practices-and-hard-lessons-learned-of-serverless-applicati
ons-aws-startup-day-boston-2018pdf-106324321
25. Reality Stone - Pragmatics
Serverless is easy to code, but harder to
design!
● Concurrency
● Latency caused by VPC
● Database constraints
26. Reality Stone - Pragmatics
You Can always over power cold
starts! 😉
27. Reality Stone - Pragmatics
● Violate SRP, if needed
● State management is against the design, but you
might eventually have to maintain states
● Design your application with Serverless in mind
31. Understanding the Infinity Stones of LambdaLand
● Space stone (code size): The deployment package size becomes very
important in the context of lambda cold starts
● Time stone (time): Lambda timeouts is one of the two configurable settings of
a lambda function. This becomes very important in terms of pricing and
performance of the serverless application
● Mind stone (code): The core of the application still remains the code! A
generic python function can be made as a lambda function, it is easy, but
understanding how lambdas work also becomes important for coding
serverless functions
32. Understanding the Infinity Stones of LambdaLand
● Power stone (memory): This is the second configurable setting of a lambda
function. Increasing the RAM doesn’t always boost your billing. You have to
play with it!
● Soul stone (design principles): The most important of the stones. Plays an
important role in improving the application’s scale and performance
● Reality stone (pragmatics): The reality is always different from theory.
Understanding the world of serverless is important to develop scalable
applications
33. <div>Icons made by <a href="https://www.flaticon.com/authors/skyclick" title="Skyclick">Skyclick</a> from <a href="https://www.flaticon.com/"
title="Flaticon">www.flaticon.com</a> is licensed by <a href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0" target="_blank">CC 3.0
BY</a></div>