AWS Lambda: Difference between revisions

Content deleted Content added
 
(One intermediate revision by the same user not shown)
Line 26:
 
==Features==
In 2019, at the AWS annual cloud computing conference (AWS re:Invent), the AWS Lambda team announced "Provisioned Concurrency", a feature that "keeps functions initialized and hyper-ready to respond in double-digit milliseconds."<ref>{{cite web |date=3 December 2019 |title=New – Provisioned Concurrency for Lambda Functions |url=https://aws.amazon.com/blogs/aws/new-provisioned-concurrency-for-lambda-functions/ |access-date=2020-10-12 |website=aws.amazon.com |archive-date=2020-10-18 |archive-url=https://web.archive.org/web/20201018033719/https://aws.amazon.com/blogs/aws/new-provisioned-concurrency-for-lambda-functions/ |url-status=live }}</ref> The Lambda team described Provisioned Concurrency as "ideal for implementing interactive services, such as web and mobile backends, latency-sensitive [[microservices]], or synchronous APIs."<ref>{{Cite web |date=2019-12-03 |title=New – Provisioned Concurrency for Lambda Functions |url=https://aws.amazon.com/blogs/aws/new-provisioned-concurrency-for-lambda-functions/ |access-date=2020-02-03 |website=Amazon Web Services |language=en-US |archive-date=2020-02-03 |archive-url=https://web.archive.org/web/20200203223548/https://aws.amazon.com/blogs/aws/new-provisioned-concurrency-for-lambda-functions/ |url-status=live }}</ref>
 
=== Concurrency Models ===
Reserved Concurrency sets a maximum number of concurrent executions for a specific function and reserves that capacity from the account’s overall concurrency limit. However, it does not keep execution environments initialized or guarantee that any instances remain running when the function is idle.<ref>{{Cite web |title=Configuring reserved concurrency for a function - AWS Lambda |url=https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html |access-date=2025-04-08 |website=docs.aws.amazon.com}}</ref>
 
Provisioned Concurrency, in contrast, maintains a specified number of pre-initialized execution environments, ensuring that the function does not experience cold starts and does not scale down to zero.<ref>{{Cite web |title=Configuring provisioned concurrency for a function - AWS Lambda |url=https://docs.aws.amazon.com/lambda/latest/dg/provisioned-concurrency.html |access-date=2025-04-08 |website=docs.aws.amazon.com}}</ref>
 
=== Lambda Function URL ===
The Lambda Function URL gives Lambda a unique and permanent [[URL]] which can be accessed by [[authenticated]] and non-authenticated users alike.<ref name=":0">{{Cite web |title=Lambda function URLs - AWS Lambda |url=https://docs.aws.amazon.com/lambda/latest/dg/lambda-urls.html |access-date=2024-03-01 |website=docs.aws.amazon.com |archive-date=2024-03-01 |archive-url=https://web.archive.org/web/20240301105416/https://docs.aws.amazon.com/lambda/latest/dg/lambda-urls.html |url-status=live }}</ref>
 
Line 41 ⟶ 46:
==Portability==
Migration from AWS Lambda to other AWS compute services, such as Amazon ECS, presents challenges due to tight integration with AWS Lambda's APIs, often referred to as service lock-in. <ref name=":7" /><ref name=":8" /> Tools like AWS Lambda Web Adapter offer a pathway for [[Software portability|portability]] by enabling developers to build web applications using familiar frameworks under a monolithic Lambda design pattern.<ref name=":7">{{Cite web |title=AWS Lambda Web Adapter |website=[[GitHub]] |url=https://github.com/awslabs/aws-lambda-web-adapter |url-status=live |archive-url=https://web.archive.org/web/20241128211006/https://github.com/awslabs/aws-lambda-web-adapter |archive-date=2024-11-28 |access-date=2024-11-29}}</ref><ref name=":8">{{Cite web |title=The Lambda monolith |url=https://docs.aws.amazon.com/lambda/latest/dg/monolith.html |url-status=live |archive-url=https://web.archive.org/web/20241126020340/https://docs.aws.amazon.com/lambda/latest/dg/monolith.html |archive-date=2024-11-26 |access-date=2024-11-29}}</ref> However, this approach introduces limitations, including coarser-grained alerting and access controls, potential cold start delays with large dependencies, and limited suitability for non-HTTP APIs. <ref name=":6" />
 
==Tools==
AWS Lambda Powertools is an open-source library developed by AWS that provides utilities for observability, tracing, and logging in AWS Lambda functions.<ref>{{Cite web |date=2020-06-22 |title=Simplifying serverless best practices with Lambda Powertools {{!}} AWS Open Source Blog |url=https://aws.amazon.com/blogs/opensource/simplifying-serverless-best-practices-with-lambda-powertools/ |access-date=2025-03-22 |website=aws.amazon.com |language=en-US}}</ref> It includes structured logging, metrics, and tracing tools for Python, Java, and TypeScript. As of March 2025, it also includes data masking support for Python. <ref>{{Cite web |title=Homepage - Powertools for AWS Lambda (Python) |url=https://docs.powertools.aws.dev/lambda/python/latest/ |access-date=2025-03-22 |website=docs.powertools.aws.dev}}</ref><ref>{{Cite web |title=Data Masking - Powertools for AWS Lambda (Python) |url=https://docs.powertools.aws.dev/lambda/python/latest/utilities/data_masking/ |access-date=2025-03-22 |website=docs.powertools.aws.dev}}</ref>
 
== Threading and Scalability in AWS Lambda ==