AWS Lambda
Run code without thinking about servers or clusters. Serverless, event-driven compute scaling from zero to tens of thousands of instances in milliseconds.
Run code without thinking about servers or clusters. Serverless, event-driven compute scaling from zero to tens of thousands of instances in milliseconds.
Coming from Google Cloud?
Both are serverless compute platforms running code on demand with automatic scale-to-zero and millisecond billing, but Lambda focuses heavily on event-driven cloud integrations while Cloud Run standardizes on HTTP containers.
- Scale-to-zero with per-millisecond execution billing.
- Automatic elastic scaling from zero to thousands of concurrent instances.
- Support for standard language runtimes (Python, Node.js, Go, Java) and OCI container images.
- Execution Limits: AWS Lambda has a strict 15-minute maximum execution timeout; Cloud Run supports up to 60-minute execution timeouts.
- Concurrency per Instance: Lambda handles exactly 1 concurrent request per microVM sandbox; Cloud Run handles up to 1,000 concurrent requests per container instance.
- Ecosystem Breadth: Lambda integrates natively with over 200 AWS event sources, EventBridge pipes, and Step Functions state machines.
What is AWS Lambda?
AWS Lambda is a serverless compute service that lets you run code without provisioning or managing servers. Lambda executes your code only when needed and scales automatically, from a few requests per day to hundreds of thousands per second. You pay strictly for the compute time you consume—there is zero charge when your code is not running.
Decision Guide: When to Choose This Service
Use AWS Lambda for event-driven processing (S3 file uploads, DynamoDB streams, Kinesis telemetry), REST/GraphQL APIs with API Gateway, scheduled cron tasks with EventBridge, and asynchronous integration queues where zero-idle server billing is desired.
Do NOT use AWS Lambda for long-running processes exceeding 15 minutes (use AWS Fargate, ECS, or EC2 instead) or ultra-consistent sub-millisecond memory cache servers (use Redis/ElastiCache).
Core Architectural Pillars
Init phase (static globals), Invoke phase (handler execution), and microVM freeze.
Reserved Concurrency (guaranteed caps protecting downstream databases) and Provisioned Concurrency (zero cold starts).
Adjusting memory (128 MB to 10,240 MB) proportionally scales dedicated CPU cores and network throughput.
Synchronous (API Gateway request-response), Asynchronous (S3/SNS fire-and-forget with DLQ), and Event Source Mapping (Kinesis/SQS polling).