---
title: AWS Lambda
description: Serverless compute service that runs code in response to events without provisioning or managing servers.
url: https://www.factualminds.com/glossary/aws-lambda/
publishDate: 2026-06-13
updateDate: 2026-06-13
---

# AWS Lambda

> Serverless compute service that runs code in response to events without provisioning or managing servers.

## Definition

AWS Lambda runs your code in response to events — HTTP requests via API Gateway or Function URLs, S3 notifications, DynamoDB Streams, SQS messages, EventBridge rules — without you managing servers. AWS handles scaling from zero to account concurrency limits, patches the runtime, and bills in millisecond increments for active compute plus per-request charges. Managed runtimes in 2026 include **Node.js 22** and **Python 3.13** among the supported language set; container images extend the model to custom dependencies up to 10 GB.

Two 2025-era capabilities extend Lambda beyond short-lived handlers. **Lambda Durable Functions** coordinate multi-step workflows with built-in state and retries for runs lasting seconds to a year without idle compute between steps. **Lambda Managed Instances** run functions on EC2-backed capacity (including GPU shapes) while keeping the Lambda deployment and scaling model — useful when inference needs dedicated hardware or EC2 pricing constructs.

Invocation models matter for error handling: **synchronous** callers see failures immediately (API Gateway, ALB); **asynchronous** invocations retry twice then route to DLQ; **stream/poll** sources (Kinesis, DynamoDB Streams, SQS) use batching, partial batch failure, and checkpoint semantics.

## When to use it

- Event-driven glue: transform S3 uploads, react to DynamoDB changes, fan out from EventBridge, or drain SQS with automatic scale-out.
- HTTP APIs and webhooks with unpredictable traffic where provisioning EC2 or EKS nodes ahead of demand wastes money.
- Scheduled jobs (EventBridge Scheduler) replacing cron on a always-on box — pay only for execution time.
- Multi-step workflows that fit **Durable Functions** or small Step Functions graphs without maintaining orchestration infrastructure.

## When not to use it

- Sustained high CPU for hours (video encoding, large ETL) — EC2 Spot, Batch, or Fargate usually cost less per CPU-hour.
- Processes needing **>15 minutes** per invocation without refactoring into Durable Functions or Step Functions segments.
- Latency-sensitive APIs that cannot tolerate cold starts and where Provisioned Concurrency cost exceeds a small always-warm container service.

## Tips

- Initialize **SDK clients and DB pool handles outside the handler**; reuse across warm invocations. For RDS/Aurora, front with **RDS Proxy** — cold starts opening hundreds of direct connections will exhaust `max_connections`.
- Run **Lambda Power Tuning** (open source) on production-like payloads; memory scales CPU proportionally and the cheapest configuration is rarely the default 128 MB.
- Use **SnapStart** on Java and minimize deployment package size on Node/Python to shrink cold-start duration; enable Provisioned Concurrency only on routes where p99 latency is contractual.
- For SQS triggers, enable **ReportBatchItemFailures** so one poison message does not fail an entire batch of ten.
- Evaluate **Managed Instances** when GPU inference or large `/tmp` (up to 10 GB ephemeral) is required but you still want Lambda's deployment pipeline.

## Gotchas

- **Serious:** Lambda in a **VPC** without proper subnet routing loses internet access and can stall on ENI creation — use VPC endpoints for AWS APIs and size subnets for ENI density per AZ.
- **Serious:** **Concurrency limits** are regional defaults (1,000); a surge or recursive loop (`Lambda → SNS → Lambda`) can throttle the whole account — set reserved concurrency on critical functions and caps on triggers.
- **Regular:** **15-minute timeout** is hard; long Bedrock calls or batch jobs need chunking, async invocation, or Durable Functions.
- **Regular:** **/tmp** is ephemeral and shared per execution environment — do not treat it as durable cache across invocations without S3 or ElastiCache.
- **Regular:** CloudWatch Logs ingestion costs often exceed Lambda compute on chatty functions — structured logging at INFO, not DEBUG, in hot paths.

## Official references

- [Lambda Durable Functions](https://docs.aws.amazon.com/lambda/latest/dg/durable-functions.html) — checkpointing and long-running workflows.
- [Lambda Managed Instances](https://docs.aws.amazon.com/lambda/latest/dg/lambda-managed-instances.html) — EC2-backed capacity for specialized hardware.

## Related FactualMinds content

- [AWS Serverless Services](/services/aws-serverless/)
- [Generative AI on AWS](/services/generative-ai-on-aws/)
- [AWS Well-Architected Review Checklist](/blog/aws-well-architected-framework-6-pillars-explained/)

## Related AWS Services

- aws-serverless
- generative-ai-on-aws

## Related Posts

- aws-well-architected-framework-6-pillars-explained

---

*Source: https://www.factualminds.com/glossary/aws-lambda/*
