When is a container in ECS/Fargate better than a Lambda function?
Answer out loud or in your head first, then compare.
Answer
A container suits a program that should run longer, keep a process alive, or needs specific libraries and resources. A Lambda function often simplifies short work triggered by an event. ECS manages the containerised application, and Fargate can provide the resources to run it.
Example: long document parsing may run more comfortably in a separate program, and short message classification in a function. It's not a rigid split. I compare running time, cost, scaling and restarts. A long-running agent should save its progress whatever the choice: a process failure mustn't mean the only record of the actions performed disappears.
Why it matters: Develops the difference between three services named explicitly in the offer.
Possible follow-ups: What happens to a started job while a new version is being deployed?
How did it go? Be honest — “Not yet” puts the question on your review list.
Start with
- E-P01 · What is cloud computing? — AWS, Cloudflare and infrastructure
- E-P03 · What is Cloudflare, and what is it for? — AWS, Cloudflare and infrastructure
- E-P04 · How does Cloudflare differ from AWS? — AWS, Cloudflare and infrastructure
Further reading
- AWS: Using Lambda with Amazon SQS(opens in a new tab)Docs; accessed 22.10.2026. Polling, batches, duplicates and partial batch responses.
- AWS Decision Guides: Fargate or Lambda?(opens in a new tab)Updated 21.08.2026. Choosing compute by how long the workload runs and what kind it is.