Use AWS Lambda when your code runs in response to events or requests and finishes within its time limit, by default 15 minutes per invocation, and you want AWS to handle everything else. Use AWS Fargate when you want to run containers, long-running services or workloads that don't fit Lambda's model, on ECS or EKS without managing servers. Both are serverless; Lambda is functions first, Fargate is containers first.
I read AWS's Lambda product page and Lambda FAQs, then the Fargate product page and Fargate FAQs. Lambda has changed more than many comparisons show: AWS now talks about Event Functions, Web Functions and Lambda Managed Instances.
Lambda and Fargate compared
| AWS Lambda | AWS Fargate | |
|---|---|---|
| What you deploy | Functions with a handler, or a web app on a port (Web Functions) | Containers as ECS tasks or EKS pods |
| Runs with | Lambda-managed compute or Lambda Managed Instances | Amazon ECS or Amazon EKS |
| Time limit | 15 minutes per invocation by default | None stated on the pages I read |
| Isolation | Lambda manages networking and isolation | Each task or pod gets its own runtime environment |
| Windows | Not covered on the pages I read | Windows containers on ECS |
| Free option (as of October 2026) | Not stated on the pages I read | Not stated on the pages I read |
What Lambda is today
AWS's FAQ says Lambda Event Functions, the new name for Lambda functions, run your code in response to events and API calls. You write a handler, connect a source such as SQS, and Lambda runs it, with each execution environment handling one request at a time by default. An invocation can run for up to 15 minutes by default, and durable functions support multi-step workflows lasting up to a year.
There's more choice than before. Lambda Web Functions run a standard web app built on a framework such as Express or Hono, listening for HTTP requests on a port. Lambda Managed Instances give dedicated capacity in your account, and SnapStart can cut startup from several seconds to under a second for latency-sensitive apps.
Lambda's home page adds that it sits natively on Amazon Kinesis, Apache Kafka, Amazon SQS and DynamoDB Streams, so you get sub-second processing as data arrives without provisioning or tuning throughput. For sustained, high-throughput pipelines, AWS points you to Lambda Managed Instances. If you're processing streams, that's a big reason to start with Lambda, and you won't have servers to patch.
What Fargate is built for
AWS describes Fargate as a serverless, pay-as-you-go compute engine for containers that works with both Amazon ECS and Amazon EKS. It takes server management, resource allocation and scaling off your plate, and each ECS task or EKS pod runs in its own dedicated runtime environment for isolation.
The FAQ adds practical limits. Fargate runs Windows containers on ECS and Arm-based Graviton tasks on ECS, but Arm workloads on EKS need EC2 instead. You can watch it with Container Insights or third-party monitoring tools, so you don't lose visibility when there's no server to log into.
What changes the answer
Lambda Web Functions blur the old line, because you can now run a normal web framework app on Lambda instead of rewriting it as handlers. Even so, the shape still decides it: short, event-driven pieces of work suit Lambda, while containers you already build and run for long periods suit Fargate.
A five-question check
- Does the work start from an event, such as a file upload or a queue message, and finish quickly? Lambda.
- Do you already ship your app as a container image? Fargate runs it as is.
- Does a job run longer than 15 minutes? Look at Fargate, or Lambda's durable functions for multi-step workflows.
- Running Kubernetes on EKS? Fargate can run your pods without managing nodes.
- Need Windows containers? Fargate supports them on ECS.
For background, here's what cloud hosting is and why businesses use it, and if you're adding AI on AWS, what AWS Bedrock does.
Want AI doing the heavy lifting in your marketing?
I build the systems that handle the boring 80 percent, so you get your week back. Done properly, with the human kept in.
My advice on Lambda or Fargate
For glue code, APIs with spiky traffic and anything triggered by events, I'd start with Lambda, because there's less to manage and the newer Web Functions cover simple web apps too. For services that already live in containers, run for long periods or sit on Kubernetes, I'd use Fargate. You can also use both, Lambda for events and Fargate for the always-on parts.
Do you make a cloud or serverless tool? Tool makers can ask to be considered for a featured place in comparisons like this one.
Frequently asked questions
How long can a Lambda function run?
AWS says an invocation can run for up to 15 minutes by default, or up to 90 minutes for some invocations on Lambda Managed Instances.
Is Fargate serverless?
Yes. AWS calls Fargate a serverless, pay-as-you-go compute engine for containers.
Does Fargate work with Kubernetes?
Yes. AWS says Fargate works with both Amazon ECS and Amazon EKS.
What is a Lambda Web Function?
AWS says it runs a standard application listening for HTTP requests on a port, such as an Express or Hono app, instead of an event handler.
Can Fargate run Windows containers?
Yes, on Amazon ECS, according to the Fargate FAQs.


