How do you choose serverless compute on AWS?
Compare AWS Lambda with serverless containers and choose compute from workload duration, runtime control, scaling, isolation, and operating requirements.
How do you choose serverless compute on AWS?
Choosing serverless compute on AWS means matching the unit of work to the execution model. Lambda is designed for bounded, event-driven functions, while AWS Fargate runs containers without managing servers and suits longer-running processes, custom runtimes, sidecars, or greater control over CPU, memory, and the container lifecycle.
How this topic fits
Compute
Understand Lambda execution, scaling, concurrency, packaging, event sources, cold starts, and when serverless containers are the better fit.
Start with the shape of the work
Describe how work begins, how long it can run, whether it is synchronous or asynchronous, how much concurrency it needs, and what state or local resources it expects. Compute is a consequence of those constraints, not the starting point of the architecture.
A short handler responding to an API request, queue message, object event, or schedule often fits Lambda. A continuously running consumer, specialized binary, multi-process container, or job that exceeds Lambda's execution model may fit Fargate better.
When AWS Lambda is the stronger fit
Lambda manages execution environments and scales invocations from events. It is useful when work is bounded, stateless between invocations, and naturally connected to AWS event sources or managed service integrations.
Functions connect directly to API, queue, stream, storage, schedule, and event-bus sources.
Capacity follows individual invocations, with concurrency controls available to protect dependencies.
The team owns function code and configuration instead of a container scheduler or host fleet.
When serverless containers are the stronger fit
AWS Fargate supplies compute capacity for containers used with Amazon ECS or Amazon EKS. It removes server provisioning while preserving the container's process model, image, networking choices, and task-level resource configuration.
Use it when the workload needs a long-lived process, more runtime control, a container-oriented deployment model, larger or specialized resource combinations, or migration compatibility that would make a function rewrite artificial.
Make the boundary explicit
Compare latency, duration, concurrency, startup behavior, isolation, network access, deployment size, observability, team skills, and total cost at expected utilization. Include downstream capacity and operational ownership in the comparison.
A system can use both models. Keep each component behind an API, queue, stream, or event contract so its compute model can evolve without changing every producer and consumer.
Go deeper with AWS
Read the primary AWS documentation behind the service definitions and architecture guidance in this guide.
Next steps
Continue with the concepts that most directly shape this decision.
What is AWS Lambda?
Understand how AWS Lambda runs code, how functions are invoked, where permissions and state live, and when Lambda is a good compute choice.
What is serverless architecture?
Learn how managed compute, APIs, events, queues, workflows, data, identity, and observability fit together in a serverless architecture on AWS.
Questions about this topic
Browse all serverless concepts
Explore compute, APIs, events, workflows, data, security, reliability, operations, delivery, and AI from one connected AWS serverless learning path.
What is serverless?
Learn what serverless computing means, how it works on AWS, what the cloud provider manages, and which trade-offs still belong to your team.
What is AWS Lambda?
Understand how AWS Lambda runs code, how functions are invoked, where permissions and state live, and when Lambda is a good compute choice.
What is serverless architecture?
Learn how managed compute, APIs, events, queues, workflows, data, identity, and observability fit together in a serverless architecture on AWS.
AWS serverless security
A practical guide to identity, least privilege, event validation, secrets, data protection, dependencies, and incident visibility in AWS serverless systems.
What is agentic AI?
Learn what makes an AI system agentic, how models, tools, memory, orchestration, identity, and evaluation fit together, and where serverless patterns help on AWS.
What is cloud computing?
Understand how on-demand infrastructure and managed services change the way teams provision, scale, pay for, and operate software systems.
What is event-driven architecture?
Learn how producers, routers, and consumers communicate through events, and how to design schemas, delivery, retries, and ownership deliberately.
What is a serverless API?
Understand the request path, authentication, routing, compute, data, throttling, observability, and failure controls behind a serverless API on AWS.
What are serverless workflows?
Learn when explicit workflow state improves retries, branching, parallel work, human approval, visibility, and recovery in distributed applications.
What is Amazon API Gateway?
Learn how API Gateway creates, publishes, secures, monitors, and operates HTTP, REST, and WebSocket APIs for AWS and external backends.
What is Amazon EventBridge?
Understand EventBridge event buses, rules, pipes, schemas, targets, schedules, permissions, delivery, and recovery in event-driven AWS systems.
Make the next serverless decision explicit.
Explore focused products for repeatable work, or bring the architecture decision that needs context and experienced review.