Asset 20 8 2
Does AI recommend your business? Run the free check →

Join 15,000 business owners, marketers and entrepreneurs. The Sunday newsletter you'll be annoyed only arrives once a week.

Article

AWS Lambda vs Fargate: Functions or Serverless Containers?

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 LambdaAWS Fargate
What you deployFunctions with a handler, or a web app on a port (Web Functions)Containers as ECS tasks or EKS pods
Runs withLambda-managed compute or Lambda Managed InstancesAmazon ECS or Amazon EKS
Time limit15 minutes per invocation by defaultNone stated on the pages I read
IsolationLambda manages networking and isolationEach task or pod gets its own runtime environment
WindowsNot covered on the pages I readWindows containers on ECS
Free option (as of October 2026)Not stated on the pages I readNot 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

  1. Does the work start from an event, such as a file upload or a queue message, and finish quickly? Lambda.
  2. Do you already ship your app as a container image? Fargate runs it as is.
  3. Does a job run longer than 15 minutes? Look at Fargate, or Lambda's durable functions for multi-step workflows.
  4. Running Kubernetes on EKS? Fargate can run your pods without managing nodes.
  5. 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.

Work with me

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.

Published and maintained by the Lilach Bullock team, covering marketing, AI and business growth.
Your buyers are asking AI who to use. Does it say you?

See for free whether ChatGPT, Claude, Perplexity, Gemini and Google name you, and get the plan to become the answer.

Check my AI visibility →
Sundays only

Get the Sunday newsletter.

One email a week. AI experiments, marketing tactics, and the workflows Lilach is building right now in her own business.

Subscribe free

Let’s get your marketing running on AI.

Book a free 30-minute call

We figure out what you need, where AI fits in, and what working together would look like.

Book the call →

Or take the 30-second calculator

You’ll see the hours and the money quietly leaking out of your week, and the three workflows worth building first.

Take the calculator →

Or grab the free AI resource library

Prompt packs, templates, checklists, and swipe files. The exact tools I build for paying clients. Yours, free.

Get the library →
Keep reading

More from the blog.