Skip to main content

Decision guides

Lambda vs Containers

Per-request functions against always-on containers: a choice about traffic shape, latency tolerance and how much of the runtime you want to own.

Reviewed 2026-09-21 · next review 2027-03-21

WHAT IS BEING DECIDED How application code runs: as functions invoked per request, or as containers running continuously behind a load balancer. The decision turns on traffic shape far more than on preference — the same code can be cheap in one model and expensive in the other purely because of how requests arrive. HOW TO WEIGH IT Weight cost-at-your-traffic-shape heavily and calculate it rather than estimating: spiky or low-volume traffic is dramatically cheaper as functions, while steady high-volume traffic is dramatically cheaper as containers. The crossover is real and findable with a spreadsheet. Weight cold-start tolerance heavily for user-facing synchronous paths. Weight portability by whether you might move clouds, since a function is a deeper coupling to the platform than a container is. WHEN EACH WINS Lambda wins for event-driven and intermittent work: scheduled jobs, queue consumers, webhook handlers, and anything whose traffic is bursty or occasional. Paying nothing while idle is a genuine advantage, and there is no fleet to patch. Containers win for sustained traffic, long-running or stateful-ish processing, workloads needing large memory or specialised runtimes, and anywhere consistent low latency matters more than idle cost. They also win when you want one runtime model across everything rather than two. HOW TO DECIDE Model the monthly cost at your actual request volume and duration profile, then check whether cold starts are acceptable on your latency-sensitive paths. Those two answers usually decide it. A mixed estate is legitimate — functions for events, containers for the request path — provided you accept operating two deployment models. See /noops for an honest account of what managed runtimes remove, and /finops for the cost modelling.

Weigh it yourself

The weights below are a starting suggestion, not a recommendation. Move them to match what your situation actually rewards — the totals are arithmetic on your weights, computed in your browser.

What you pay when demand is intermittent, which is where the models diverge most.

0 = does not matter here · 1–5 = increasingly decisive

What you pay when demand is continuous and predictable.

0 = does not matter here · 1–5 = increasingly decisive

Whether cold starts are acceptable on the paths users wait for.

0 = does not matter here · 1–5 = increasingly decisive

Execution duration limits, memory ceilings, and unusual runtime needs.

0 = does not matter here · 1–5 = increasingly decisive

How much rework a move to another platform would require.

0 = does not matter here · 1–5 = increasingly decisive

  • Containers85% of the weight you assigned
  • Functions (AWS Lambda)60% of the weight you assigned

Using the suggested starting weights. This is your arithmetic, not a verdict from this site.

How each option rates

Ratings of each option against each criterion, with the reason for each rating
CriterionFunctions (AWS Lambda)Containers
Cost under spiky or low traffic5/5

Zero cost while idle makes intermittent and bursty workloads very cheap.

2/5

You pay for capacity whether or not requests arrive, and scale-to-zero is rarely practical.

Cost under steady high traffic2/5

At sustained high volume the per-invocation model costs substantially more than reserved compute.

5/5

Reserved or spot capacity at sustained volume is far cheaper per request.

Latency consistency3/5

Cold starts are manageable with provisioned concurrency, which reduces the cost advantage.

5/5

Warm processes give consistent latency with no cold-start class of problem.

Runtime and resource freedom2/5

Execution duration and memory ceilings constrain long or heavy work.

5/5

Any runtime, any duration, large memory, background threads — no platform ceiling.

Portability2/5

Handler signatures and event shapes are platform-specific.

5/5

A container image runs anywhere that runs containers.

When this comparison stops applying

  • Traffic is spiky but latency-critical — provisioned concurrency erodes the cost advantage, and at that point containers often win outright.
  • You already operate an orchestrator: the marginal cost of one more service on it is near zero, which changes the arithmetic entirely.
  • The workload is genuinely event-driven glue rather than a service, where functions win regardless of the rest of the table.