AWS Lambda

A serverless compute service that runs code without server management, using a fully pay-per-use model based on request count and execution duration

Overview

AWS Lambda is a serverless compute service that lets you run code without provisioning or managing servers. It automatically executes functions in response to events from many AWS services, such as file uploads to S3, HTTP requests via API Gateway, and data changes in DynamoDB. It supports major language runtimes and also allows deployment via container images. Billing is metered by request count and execution duration, and a free tier is offered; check the official AWS Lambda pricing page for current rates and eligibility. As of September 2026, AWS documentation states a maximum execution time of 15 minutes per invocation and a memory ceiling of 10,240 MB per function.

Choosing Between Synchronous, Asynchronous, and Event Source Mapping Invocations

Lambda supports three invocation models, each suited to different use cases. Synchronous invocations (such as HTTP requests via API Gateway or SDK calls) block the caller until the function returns a response, making them ideal for request-response patterns like API backends. Asynchronous invocations (triggered by S3 event notifications, SNS, or EventBridge) queue events internally and process them without the caller waiting - Lambda automatically retries on failure and can route failed events to a dead-letter queue or on-failure destination. Event source mappings pull records in batches from streaming and queue services like SQS, Kinesis, and DynamoDB Streams, with Lambda managing the polling, batching, and checkpointing. Choosing the right model affects error handling strategy, cost, and latency characteristics. As of September 2026, AWS documentation lists a default concurrent execution quota of 1,000 per Region, increasable to tens of thousands through a quota increase request.

Cold Start Causes and Mitigation Strategies

A cold start occurs when Lambda creates a new execution environment, involving downloading the deployment package, initializing the runtime, and running initialization code. This adds latency to the first invocation. The primary factors affecting cold start duration are deployment package size, runtime choice, and the amount of initialization code (such as establishing database connections). Provisioned Concurrency reduces cold starts by keeping execution environments warm in advance, though charges apply during the idle period. For Java runtimes, SnapStart takes a snapshot of the initialized environment and restores it on invocation, shortening cold start times. Azure Functions faces a comparable cold start problem, and plans that keep instances warm are cited as the mitigation; because per-plan specifications such as execution timeouts change over time, check Microsoft's official documentation when comparing the two services.

Step Functions Integration and Deployment Strategies

When combined with Step Functions, you can build workflows that orchestrate multiple Lambda functions with sequencing, parallel execution, branching, and error handling. Step Functions Express Workflows handle high-volume, short-duration tasks at lower cost, while Standard Workflows support long-running processes with a durable execution history. A common pattern is using Step Functions to coordinate a data processing pipeline where one Lambda validates input, another transforms data, and a third writes results - with automatic retry and error handling at each step. For deployment, Infrastructure as Code management using AWS SAM or the Serverless Framework is recommended. SAM's local testing capabilities (sam local invoke) let you test functions locally before deploying, and integrating with CI/CD pipelines through CodePipeline or GitHub Actions makes deployment automation straightforward. Canary and linear deployment strategies via CodeDeploy gradually shift traffic to new function versions, reducing the blast radius of faulty deployments.

References (Official AWS Resources)

The primary sources for this page are the official AWS website and documentation. Check the official pages below for the latest specifications and pricing.

If this page and the official documentation disagree, treat the official documentation as authoritative.

ShareXB!