0% found this document useful (0 votes)
8 views1 page

Lambda

AWS Lambda allows users to run code without managing servers, utilizing micro-containers for function execution. It features cold starts, reserved concurrency, and Lambda Layers for dependency management, while providing scalability and security through IAM. The service supports integration with various AWS services and offers observability tools like CloudWatch for monitoring performance.

Uploaded by

maciewehner8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views1 page

Lambda

AWS Lambda allows users to run code without managing servers, utilizing micro-containers for function execution. It features cold starts, reserved concurrency, and Lambda Layers for dependency management, while providing scalability and security through IAM. The service supports integration with various AWS services and offers observability tools like CloudWatch for monitoring performance.

Uploaded by

maciewehner8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

AWS LAMBDA

RUN CODE WITHOUT THINKING ABOUT SERVERS OR CLUSTERS

INTRODUCTION MICRO-CONTAINERS COLD STARTS THE INTERNALS THE HANDLER METHOD


Virtual machines and containers made infrastructure Don’t get this wrong: serverless doesn’t mean that there are Starting a micro-container on-demand takes time. This is Each provisioned Lambda micro-container is only able to What’s important here: everything outside this entrance
management a lot easier. Lambda takes this another step no servers at all. It’s just abstracted away and managed by called the cold-start period. Lambda needs to download process one request at a time. Even if there are multiple method will be executed first when your function receives a
further by virtualizing the runtime and only offering AWS.

your code and start such a small container to run it. containers already provisioned, there can be another cold cold start and won’t disappear from memory until it's de-
functions as a unit of scaling. As you’re not responsible for Additional time can be taken to bootstrap global logic of start if all of them are currently busy handling requests.

provisioned.

any infrastructure, this is called serverless.

For a function invocation, AWS will spin-up a micro- your function, e.g. loading your main framework.

Time

container if there’s none that is already available for your The execution of the global code outside of your handler
1 7
Time
Starting Micro- 2
You’ll only bring the code and the Lambda environment function. The container is kept for a small period of time until Downloading Code Container Execute
Initialisation Code
Executing Handler
Code 4 6
method will be executed with high memory & CPU settings
Environment
takes care of provisioning the underlying infrastructure and the resources are freed so they can be assigned for other 5 and isn’t billed for the first 10s.

micro-containers to execute it.

tasks. There are a lot of best practices and tricks to reduce the time 3
Make use of this by always bootstrapping your core
The Evolution of Serverless until your actual function logic can execute Looking at the invocation scenario above you can see that framework outside the handler method.
Virtual Machines Containers Functions Keeping the packaged size of your functions small five Lambda micro-containers were started due to the
RESERVED CONCURRENCY Regularly health checks to invoke your functions request timings. The first re-use did only happen at request
Reserved concurrency ensures that that is concurrency level
Bootstrapping general code outside the handler function. number six. OBSERVABILITY
LAYERS is always available to your function.

Having in-depth observability for your lambda-powered,


Necessary dependencies need to be included in your event-driven architecture is still a goliath task.

deployment package. As dependencies can quickly reach This means PROVISIONED CONCURRENCY ️ VERSIONING & ALIASES Mostly, you'll design event-driven, async architectures that
multiple megabytes, packaging and code deployment can The reserved concurrency will be subtracted from your Reduce your latency fluctuations by keeping the underlying You can publish immutable versions for your Lambda involve a lot of other services like for example SQS, so
take up more time, even if you just want to update your own accounts regional soft limit. This limit is shared by infrastructure provisioned.

functions and then use a reference at all places that need to there’s just not a single log group to monitor.

code.

functions that do not have a reserved concurrency invoke this functions.

configured Keep in mind: this introduces additional costs.


CloudWatch helps a lot in the first place via Metrics & Alerts.

Your function can’t exceed the concurrency. If you’ve Also, deployments of your function will take more time as This allows you to easily switch between different function Many of them are predefined, like
configured a reserved concurrency of five, the sixth your updated code needs to be published as a fixed version. versions. If your function is exposed to the internet via AWS Errors: your function did not finish with exit code zer
With Lambda Layers, you can can bundle your parallel request will result in an invocation error. API Gateway, you can also integrate canary deployments by Throttles: concurrency limit was exceeded

dependencies separately and then attach them to one or using weighted aliases. This enables you to send only a Familiarize yourself with CloudWatch’s possibilities.

several functions. You can also use multiple layers in the SERVERLESS BENEFITS fraction of traffic to your new deployment to check for error
same function.

LAMBDA@EDGE ️ We believe that cloud-native development like serverless


spikes while the major load resides on your stable version. For enterprise-scale applications: rely on third-party tools
Lambda's not only good for computation workloads or REST computing are the future as they come with great benefits
like Dashbird.io to get all activities of your Lambdas and
backends. You can also use them with CloudFront.
reduced operations as you don’t need to worry about
Be aware, that your Lambda deployment unit and all of the other related, common services like API Gateway, SQS, SNS,
attached layers can’t exceed 250 MB in an unzipped state.
It enables you to execute code at different stages when your infrastructure DESTINATIONS DynamoDB & much more in a single place.
CloudFront distribution is called.

out-of-the-box scalability for your functions If your Lambda function is invoked but fails to complete
a pay-as-you-go pricing model - you won’t pay for successfully, you can use the Lambda destination feature to
SECURITY By that you can for example easily implement authorization unused compute resources send the results of the
Events
Event
Queue
Events
SERVICE EVOLUTION
Your function is protected via IAM. By default, there's no rules or route calls to different origin servers.

higher agility & development speed compared to failed invocation to a


Lambda is continuously improved. Since Lambda’s release
ingress traffic possible to your function, but all egress to the traditional approaches different destination,
date back in 2014, AWS introduced among other things
internet.
Generally, you can do a lot as you're also able to use the a lower entry barrier to event-driven architectures due like a SQS queue. This
Invocation AWS Hyperplane support for Lambda to significantly
Records
You can attach your function to a VPC to access other private AWS-SDK and invoke other services.
to native integrations with messaging services like SQS can be useful for debugging
Failed Event
reduce cold start times when attached to a VPC
Destination
resources or restrict egress traffic to the internet via security Another tip: CloudFront functions - the lightweight, and SNS that enable you to build very resilient or for handling error cases. fine-grained billing in 1ms periods instead of 100ms
groups and network access control lists. cheaper alternative with a reduced feature set. ecosystems. running Lambda on Graviton2 / ARM processors, which
offer a better cost-performance efficiency
much higher memory & vCPU configurations
up to 10GB of temporary local storage at /tmp.

You might also like