This document summarizes a presentation about best practices and lessons learned for serverless applications. It discusses optimizing Lambda function performance by matching resource allocation to logic, using VPC configurations carefully to avoid impacting resilience, and separating core logic from handlers. It also provides tips on monitoring functions using X-Ray and CloudWatch, handling errors with dead letter queues, and avoiding orchestration in code by using Step Functions.
there are different layers - the lambda compute substrate, the container, and the code. the substrate is invisible to customers, but the container and runtime is instantiated on demand for scale events, and the function is instantiated for every request. In this case, everything inside the handler is considered part of the function, and everything outside the handler is considered an “initialization call’ and run along with the container initialization.
there are different layers - the lambda compute substrate, the container, and the code. the substrate is invisible to customers, but the container and runtime is instantiated on demand for scale events, and the function is instantiated for every request. In this case, everything inside the handler is considered part of the function, and everything outside the handler is considered an “initialization call’ and run along with the container initialization.
there are different layers - the lambda compute substrate, the container, and the code. the substrate is invisible to customers, but the container and runtime is instantiated on demand for scale events, and the function is instantiated for every request. In this case, everything inside the handler is considered part of the function, and everything outside the handler is considered an “initialization call’ and run along with the container initialization.
When a request arrives for the first for your function, Lambda will first download your code onto the part of the compute substrate where your code will execute, and start a new container (Sized based on your function allocation), then instantiate your runtime, and then execute your code. This container is kept alive for some window of time, depending on your traffic patterns, and if another request comes in, only the handler is executed again. You experience *this part* as the infamous cold start, and this part as the ongoing warm start. Both are important – 99% of your requests wi