AWS Lambda
Edge & ServerlessServerless compute service that runs code without managing servers
Features
- Event-driven serverless execution
- Support for Node.js, Python, Go, Java, and more
- Automatic scaling from zero to thousands of instances
- Integration with 200+ AWS services
Pros
- No server management, pay only for execution time
- Massive scale with proven reliability
- Deep integration with the AWS ecosystem
Cons
- Cold starts add latency to first requests
- 15-minute execution time limit
- Complex pricing with multiple dimensions
Overview
AWS Lambda is the original serverless compute platform, introduced by Amazon in 2014. It lets you run code in response to events (HTTP requests, queue messages, file uploads, database changes) without provisioning or managing servers. Lambda automatically scales from zero to handle any number of concurrent requests.
Lambda supports multiple runtimes including Node.js, Python, Java, Go, .NET, and Ruby, plus custom runtimes for any language. Functions are triggered by events from API Gateway, SQS, S3, DynamoDB, and 200+ other AWS services, making it the glue that connects AWS services together.
Pricing is based on the number of requests and compute duration (measured in GB-seconds), with a generous free tier of 1 million requests per month.
When to Use
Choose AWS Lambda for event-driven workloads within the AWS ecosystem. It is ideal for API backends, data processing pipelines, scheduled tasks, and integration between AWS services. For latency-sensitive edge workloads, consider Cloudflare Workers.
Getting Started
export const handler = async (event: APIGatewayEvent) => {
return {
statusCode: 200,
body: JSON.stringify({ message: 'Hello from Lambda!' })
}
}
# Deploy with AWS SAM
sam init --runtime nodejs20.x
sam deploy --guided