Cloud
Serverless vs containers: choosing the right model
14 November 2026

Serverless suits event-driven, stateless work with variable traffic and a small operations team. Containers suit long-running, stateful or steady workloads that need control over the runtime. Most production systems end up using both, so the real decision is made per workload, not per company. This article sets out the differences in operations, cost, performance, limits and portability, then gives the order in which the decision is best taken.
TL;DR
- Serverless hands provisioning, patching and scaling to the cloud provider; containers leave the runtime, image and scaling policy with the engineering team.
- Neither is universally cheaper: serverless tends to win on spiky or low traffic, containers on steady, high-volume load.
- Serverless has hard ceilings (execution time, memory, payload size) and ties code more closely to a platform; containers are more portable but demand more operational work.
- A hybrid is common: a container-based core with serverless functions for bursty, asynchronous tasks.
- The choice should follow platform limits, state, traffic shape, latency budget and team capability, in that order.
Table of Contents
- What each model actually is
- Serverless vs containers at a glance
- Operations and control
- Scaling, performance and latency
- Cost: where each model wins
- Limits, lock-in and portability
- When to choose which
- Using both: the hybrid pattern
- Perspective
- How we can help with the decision
- FAQ
- Sources
What each model actually is
Serverless is an application development model in which the cloud provider provisions, scales and maintains the underlying server infrastructure on demand, including operating-system management, security patching, capacity management, load balancing, monitoring and logging. Servers still exist, as IBM’s guide points out, but they are invisible to the developer. The best-known product is AWS Lambda, which offers event functions, web functions that run standard HTTP servers, and isolated microVMs for running generated code.
A container is an application packaged together with its libraries, settings and dependencies. According to Cloudflare’s technical guide, it shares the host kernel while running in an isolated user-space environment. Because the package carries its own dependencies, the same image runs on a laptop, a test cluster or a production cloud.
Containers at scale need an orchestrator. Kubernetes is an open-source system for automating the deployment, scaling and management of containerised applications. A cluster consists of a control plane that makes global decisions such as scheduling and responds to cluster events, and worker nodes that host the Pods in which the application workload runs. Managed offerings such as Amazon ECS and EKS take part of that burden away, but the team still owns images, configuration and capacity policy.
The practical difference is where the line of responsibility is drawn. Serverless moves it far up the stack, so the team writes functions and configures triggers. Containers move it lower, so the team owns the runtime environment and the work that comes with it.
Serverless vs containers at a glance
The table summarises the differences that most often decide an architecture. Figures refer to AWS because it is the most widely documented platform; other providers set their own limits.
| Criterion | Serverless (for example AWS Lambda) | Containers (for example ECS, EKS, Kubernetes) |
|---|---|---|
| Operational overhead | Minimal | Low to medium on ECS, higher on EKS |
| Scaling | Starts at zero, scales per request, idle environments shut down | Instances or tasks added by utilisation, with capacity kept for spikes |
| Runtime control | Limited; provider manages runtimes | Full control over languages, libraries and operating environment |
| Execution limit | 15 minutes per invocation on Lambda | No equivalent limit in the comparison |
| Startup latency | Cold starts possible after inactivity | Generally lower, as containers stay running |
| Cost shape | Pay per request and execution time | Pay for provisioned capacity |
| Portability | More dependent on the platform | Runs wherever a compatible runtime exists |
| Security burden | Application code, secrets and IAM roles | Adds guest operating system and image security |
The operational overhead ratings and the 15-minute limit come from AWS’s 2026 comparison of Lambda, ECS and EKS. The scaling behaviour is described in an AWS re:Post guide from March 2025.
Operations and control
The operational trade-off is the one that most affects staffing. In serverless, the vendor manages the backend, software updates and scaling. With containers, developers gain control over the operating environment, languages and libraries, but they must manage and update the containers they deploy.
AWS’s builder guidance is explicit about the split: with containers, users are responsible for base images, operating-system updates and vulnerability patching, whereas Lambda abstracts servers, runtimes and horizontal scaling but offers less direct access to the execution environment. The same guide notes that serverless does not remove security work, it concentrates it: customer responsibility sits in application code, secrets and IAM roles, while container users keep a broader burden covering the guest operating system and images.
A team of three engineers building a product with unpredictable demand will feel this difference immediately. Every hour not spent on node upgrades or cluster capacity is an hour spent on features. A platform team of ten operating dozens of long-running services will value the opposite: precise control over networking, runtime versions and resource allocation.
Observability is the part of serverless that is easiest to underestimate. JFrog’s guide observes that one request may cross many short-lived functions and services, which makes centralised logs, correlated metrics and distributed tracing essential. Containers have this problem too in microservice form, but a single long-lived service is easier to inspect than a chain of ephemeral invocations.
Scaling, performance and latency
Scaling behaviour differs in kind. Serverless functions are allocated resources only when invoked and can scale down to zero, while container deployments generally keep a chosen number of containers available and require the developer or orchestrator to scale them. For an internal tool used a few hundred times a day, scaling to zero is a considerable advantage. For an API handling constant traffic, there is little idle time to save.
Latency follows the same logic. InfoQ’s comparison says containers generally have lower startup latency because they remain running, while serverless functions can experience cold starts after a period of inactivity. Whether a cold start matters depends on the latency budget: a nightly report generator does not care, whereas a checkout endpoint with a strict response-time target might.
Serverless platforms also publish firm ceilings. According to the 2026 AWS comparison cited above, Lambda has a 15-minute maximum execution time, cold starts, and limits of 10 GB of RAM and 10 GB of ephemeral storage. Container platforms impose no equivalent limit on execution time in that comparison, which is why long-running processes, workloads that keep state between requests and specific runtime requirements point towards containers.
The ceilings are not unique to one vendor, and they vary. Scaleway’s documentation, for instance, lists maximum execution times of up to one hour for its functions and containers and 24 hours for jobs, and separates lightweight event-driven functions, stateless HTTP containers and batch jobs that run to completion. The lesson is to read the limits of the specific platform before committing, since they decide which workloads fit.
Cost: where each model wins
The question of whether serverless is cheaper or more expensive has no universal answer. AWS’s FinOps guidance states that Lambda costs include request charges and compute based on memory and execution duration, while containers can be more cost-effective for steady, high-volume workloads. It also advises comparing compute, data transfer and logging costs, along with development and operational requirements, rather than compute alone.
The published list price shows the shape of the serverless model. AWS’s pricing page lists Lambda event functions at $0.20 per million requests and $0.0000166667 per GB-second for x86 functions, with a monthly free tier of 1 million requests and 400,000 GB-seconds. These are US list prices as published on that page and can change, so the live pricing page is the reference for any budget.
A worked example from an October 2026 pricing comparison makes the effect concrete. Assuming 300,000 requests a month, 200 ms per request and 512 MB of memory, Lambda plus an HTTP API cost $0.86 before free tiers, while one small Fargate task (0.25 vCPU, 0.5 GB) cost $9.01 a month. The comparison excluded load balancers, data transfer and logging, so it shows the compute gap at low volume rather than a full bill. At low and spiky traffic, paying per request is cheaper than paying for a task that is idle most of the time.
The balance shifts with sustained load, because per-request charges accumulate while a provisioned container serves more requests at the same fixed price. JFrog lists higher cost for continuous workloads among the trade-offs of serverless. A sound estimate therefore needs three inputs: the expected requests per month, the average duration and memory per request, and how evenly traffic is spread through the day. A model built on those figures, and refreshed against the live price list, is more reliable than a rule of thumb.
Engineering time belongs in the same calculation. A container platform that needs part of an engineer’s week for upgrades, patching and capacity planning carries a cost that does not appear on the cloud invoice.

Limits, lock-in and portability
Portability is the strongest argument for containers. Container images can be deployed wherever a compatible runtime exists, while serverless applications are more dependent on the platform that runs their code. JFrog names vendor lock-in alongside cold starts and distributed observability as the main trade-offs of serverless. AWS itself notes that ECS configurations are tied to AWS, whereas EKS requires Kubernetes expertise and operational work.
Two mitigations are worth designing in from the start. The first is to keep business logic in plain libraries that do not depend on the function runtime, so that moving a handler elsewhere is a matter of rewriting a thin adapter. The second is to externalise state. Serverless functions are commonly stateless, event-triggered units whose state is held in databases, object stores or key-value systems, and that discipline also makes later migration to containers considerably easier.
Containers have their own constraint, which is the expertise they demand. A Kubernetes cluster has a control plane with an API server, a datastore, a scheduler and controllers, and worker nodes running a container runtime. Operating it well is a specialist job, which is why many teams choose a managed container service before they choose a self-run cluster.
When to choose which
AWS’s FinOps guidance gives a compact rule. Serverless functions fit event-driven, stateless workloads with variable or unpredictable traffic, infrequently used services, and teams that want to minimise operational overhead. Containers fit long-running processes, steady and predictable traffic, workloads that need state between requests, and specific runtime environments. Cloudflare adds that containers are useful for migrating legacy applications, because the existing runtime can be packaged largely as it is, while serverless suits intermittent traffic and reduces maintenance.
In practice, the following situations recur:
A startup validating a product with uncertain demand usually benefits from serverless first: no idle cost, no cluster to run, and scaling that follows adoption. A company modernising a legacy Java application will typically find containers the natural destination, because the application already expects a long-running process and a particular runtime. An integration layer that reacts to webhooks, file uploads or messages from other systems suits functions, since each event is short and independent. A public API with constant traffic and tight latency requirements generally belongs on containers.
A useful order for the decision, drawn from 2026 OCI guidance on picking per workload, is: hard platform limits first, then state and connection requirements, traffic shape, latency budget, number of services, team capability and, last, pricing at actual volumes. Starting with price is the common mistake, because a cheaper model that cannot meet a limit or a latency target is not an option at all.

Using both: the hybrid pattern
The two models are complements, not rivals. Cloudflare describes a hybrid in which serverless handles most tasks and containers take the functions needing extra memory, very large files or long-running execution. InfoQ’s article title makes the same point by asking whether the two are rivals or cohorts.
A typical mixed system keeps a steady core API and its stateful services on containers, then uses functions for bursty work such as image processing, webhook handling, notifications and billing updates. Finite jobs that exceed a function’s limits run as container tasks. The routing principle is simple: stateless, event-driven and cold-start-tolerant work goes to serverless; stateful, latency-critical or custom-networking work goes to containers.
The cost of a hybrid is coordination. Two deployment models mean two sets of tooling, two monitoring approaches and clear rules about which workload belongs where. Those rules are an architecture decision, and they are cheaper to set at the start than to untangle after a year of ad hoc choices.
Perspective
The question we hear most often is which model is better, and it is rarely the right question. The useful one is which model fits a specific workload, a specific team and a specific growth path.
Our work spans Next.js, React and TypeScript front ends, Java back ends built on Spring Boot, Quarkus and Jakarta EE, message-driven architectures, and cloud-native infrastructure with containerisation, Kubernetes and Red Hat OpenShift. That breadth is the reason we have no preferred answer to bring in. Our approach is to operate without vendor bias, and every consulting engagement ends with a written recommendation, so the reasoning behind a serverless, container or hybrid choice can be reviewed and challenged long after the engagement closes.
We also see the decision as part of a lifecycle, not a one-off. A function-based prototype can become a container-based core as load stabilises, and a legacy monolith can be moved to containers first and decomposed later. Clients work directly with the engineers who design, build and maintain the system, so the people recommending an architecture are the ones who will answer for how it runs in production.
Pepe F.
How we can help with the decision
A choice between serverless, containers and a hybrid is easier to get right when someone has costed the workloads, mapped the limits and written the conclusion down before any infrastructure is built. Vicedomini Softworks is an Italian software engineering company, and its architecture and technology stack service covers stack selection, roadmapping and migration, alongside custom development, code audit and technical debt review, and AI and automation work. Clients speak directly to the engineers, not to an account manager.

For organisations that want ongoing technical leadership around such decisions, the CTO subscription plans start with CTO Advisory from €1,800 per month, followed by Fractional CTO from €4,000 per month and CTO Partner from €7,500 per month. An initial assessment is available from €3,500 as a one-off. Examples of delivered work are collected in the case studies.
FAQ
Is serverless cheaper than containers?
Not in every case. Serverless is billed per request and execution time, so it is typically cheaper for low or spiky traffic. Containers can be more cost-effective for steady, high-volume workloads, according to AWS’s FinOps guidance. Data transfer, logging and engineering time should be included in any comparison.
Is Kubernetes a container?
No. A container packages an application with its dependencies, while Kubernetes is the system that automates the deployment, scaling and management of containerised applications. Containers run inside Pods on Kubernetes worker nodes, and the control plane decides where they are placed.
Is serverless actually serverless?
No, servers are still involved. The difference is that they are invisible to the developer: the provider handles provisioning, scaling, operating-system updates, security patching and monitoring. The name describes the developer’s experience, not the physical reality.
Can serverless and containers be used together?
Yes, and many systems do. A common split keeps the steady core and stateful services on containers and sends bursty, asynchronous tasks to functions. Work that needs extra memory, large files or long execution time stays on containers, as Cloudflare’s guidance describes.
Sources
- AWS Lambda: serverless computing
- What is serverless computing? (AWS)
- What is serverless computing? (IBM)
- Kubernetes
- Cluster Architecture (Kubernetes documentation)
- Serverless computing vs. containers (Cloudflare)
- Serverless vs. containers: Lambda, ECS and EKS in 2026 (AWS Builder Center)
- Containers or serverless functions (AWS re:Post)
- Containers vs. serverless: finding the right balance (AWS Builder Center)
- Containers and serverless: rivals or cohorts? (InfoQ)
- A FinOps guide to comparing containers and serverless (AWS)
- AWS Lambda pricing
- Serverless vs containers: choosing the right compute model (Techplained)
- Differences between serverless jobs, containers and functions (Scaleway)
- Serverless vs containers (Check Point)
- Everything you wanted to know about serverless computing (JFrog)
- Serverless vs containers on OCI: picking per workload
This article was produced with AI assistance and reviewed for accuracy. It is provided for general information only and is not professional advice.