C
CIOPages
InsightsEnterprise Technology Operations
ComparisonEnterprise Technology Operations

Compute Models Explained: VMs, Containers, and Serverless

A structured comparison of virtual machines, containers, and serverless compute models. Covers workload fit, cold start latency, operational overhead, cost profiles, and how to choose the right abstraction for different application patterns.

CIOPages Editorial Team 14 min readApril 1, 2025

AI Advisor · Free Tool

Technology Landscape Advisor

Describe your technology challenge and get an AI-generated landscape analysis: relevant technology categories, key vendors (commercial and open source), recommended architecture patterns, and a curated shortlist — all tailored to your industry, organisation size, and constraints.

Vendor-neutral analysis
Architecture patterns
Downloadable Word report
Confused by technical jargon? Decode it instantly.
Try Tech Stack Decoder

Compute Models Explained: VMs, Containers, and Serverless

73% of new enterprise workloads are now deployed on containers or serverless platforms — up from 45% in 2021, reflecting the structural shift away from VM-first architecture (CNCF, 2024)

The compute model decision — virtual machines, containers, or serverless — is one of the most consequential architectural choices for any workload. It determines operational overhead, startup latency, cost structure, scalability model, and the degree of control the team has over the runtime environment. No single model is universally optimal; each makes sense for specific workload characteristics.

The challenge is that compute model selection is frequently driven by team familiarity or organizational default rather than workload fit — defaulting to containers because "that's what we do now," or keeping VMs because migrating is effort. This guide provides the analytical framework for matching compute model to workload characteristics with the precision that architectural durability requires.

Explore cloud compute and container platforms: Cloud Infrastructure Directory → | DevOps & Platform Engineering →


Virtual Machines: The Established Foundation

Virtual machines abstract physical hardware, enabling multiple isolated operating system instances to run on shared physical servers. The hypervisor (VMware ESXi, Microsoft Hyper-V, KVM) manages resource allocation and isolation between VMs.

When VMs are the right model:

  • Legacy applications: Applications with OS-level dependencies (specific OS versions, kernel modules, proprietary drivers) that cannot be containerized without significant re-engineering
  • Stateful workloads requiring persistent local storage: Databases with specific I/O performance requirements, workloads requiring NVMe direct access
  • Strong isolation requirements: Compliance regimes requiring hypervisor-level isolation between workloads (multi-tenant environments, PCI-DSS cardholder data environments)
  • Windows-specific workloads: Applications requiring Windows Server that are not suitable for Windows containers
  • Hardware-attached workloads: Workloads requiring GPU passthrough, specific network interface access, or hardware security modules

VM operational model characteristics:

  • Boot time: 30–120 seconds (full OS boot)
  • Resource overhead: ~5–10% for hypervisor layer
  • Patching: OS patching required, managed by team
  • Density: 10–50 VMs per physical server (depending on workload size)
  • Portability: VMware VMDK, OVF format portability; cloud-specific formats less portable

Containers: The Modern Standard

Containers package application code and its dependencies into a portable, isolated unit that runs on a shared OS kernel. Unlike VMs, containers do not virtualize hardware — they isolate processes using OS-level namespaces and cgroups.

The container value proposition:

  • Consistency: "Works on my machine" becomes "works everywhere the image runs" — the same container image runs identically in development, CI, staging, and production
  • Density: Containers share the host OS kernel, enabling 3–10x higher workload density than equivalent VMs
  • Startup time: Container startup is seconds rather than minutes — enabling faster scaling and deployment
  • Portability: Container images run on any container runtime — local laptop, on-premises Kubernetes, AWS ECS, Azure ACI, GCP Cloud Run

Container orchestration with Kubernetes: For multi-container applications at scale, Kubernetes has become the de facto orchestration standard. It manages container scheduling, health checking, auto-scaling, service discovery, rolling deployments, and resource allocation across a cluster of nodes. Managed Kubernetes services (EKS, AKS, GKE) reduce the operational burden of cluster management.

When containers are the right model:

  • Microservices: Each service packaged as a container, independently deployable and scalable
  • Stateless applications: API servers, web applications, data processing jobs
  • CI/CD pipelines: Build and test environments that spin up, execute, and terminate
  • Mixed language environments: Teams using Python, Go, Node.js, and Java can all deploy containers through the same platform

Container operational complexity: Container environments introduce operational complexity that VMs do not — image management, registry security, Kubernetes cluster operations, container networking, and persistent storage configuration. This complexity is manageable with platform engineering investment but should be honestly evaluated before adopting containers.


Serverless: Pay-Per-Execution at Scale

Serverless (Function-as-a-Service) abstracts infrastructure management entirely — developers deploy code units (functions) without managing servers, containers, or Kubernetes clusters. The platform provisions infrastructure on demand, executes the function, and releases resources when execution completes. Billing is per invocation and per execution duration, not per running server.

Serverless execution models:

Function-as-a-Service (FaaS): Individual functions triggered by events. AWS Lambda, Azure Functions, Google Cloud Functions. Maximum abstraction; no infrastructure management. Cold start latency (100ms–1s+ for infrequently invoked functions) must be accounted for in latency-sensitive applications.

Serverless containers: Container-based execution with serverless scaling characteristics. AWS Fargate, Azure Container Instances, Google Cloud Run. Eliminates Kubernetes cluster management while retaining container portability. Cold start faster than FaaS for warm containers; no language/runtime constraints.

When serverless is the right model:

  • Event-driven processing: Processing S3 uploads, queue messages, database change streams, API gateway events — triggers that occur sporadically and at variable rates
  • Batch jobs with variable frequency: Nightly data processing, weekly reports, periodic cleanup tasks
  • APIs with variable traffic: Applications with significant traffic variability (100x between peak and off-peak) where serverless auto-scaling eliminates the cost of idle capacity
  • Rapid prototyping: No infrastructure setup required; focus entirely on application logic

When serverless struggles:

  • Long-running processes: Lambda's 15-minute maximum execution time (Azure Functions and GCF have similar limits) excludes long-running batch jobs
  • Constant high-throughput workloads: At very high, constant request rates, serverless compute costs exceed equivalent container/VM costs (pay-per-execution becomes more expensive than reserved capacity)
  • Latency-sensitive applications: Cold start latency (even with mitigation strategies like provisioned concurrency) is not acceptable for sub-100ms latency requirements
  • Complex local state: Functions are stateless by design; applications requiring complex in-memory state between invocations require external state stores

The Decision Framework

Workload Characteristic VMs Containers Serverless
Stateless API / microservice ⚠️ Works but over-provisioned ✅ Optimal ✅ Good (if not latency-critical)
Stateful database ✅ Optimal ⚠️ Possible with care ❌ Not suitable
Event-driven processing ❌ Always running, expensive ⚠️ Over-engineered ✅ Optimal
Legacy OS-dependent app ✅ Optimal ❌ Requires re-engineering ❌ Not suitable
ML training ✅ GPU VM ✅ GPU containers ⚠️ Time limit issue
Batch job (< 15 min) ⚠️ Provision / terminate overhead ✅ Good ✅ Optimal
Long-running batch job ✅ Good ✅ Good ❌ Time limits
High-traffic consistent API ✅ Reserved instances ✅ Reserved nodes ⚠️ Cost at constant load
Bursty traffic (0–1000x) ❌ Over-provision for peak ✅ Auto-scale ✅ Optimal
Developer tooling / CI/CD ⚠️ Slow startup ✅ Good ✅ Good

Cold Start Mitigation for Serverless

Cold start latency — the time required to initialize a new function instance when no warm instance is available — is the primary operational challenge of FaaS. Mitigation strategies:

Provisioned concurrency (AWS Lambda, Azure Functions Premium): Pre-initialize a defined number of function instances, eliminating cold starts for that concurrency level. Adds cost (provisioned concurrency charges apply even when no requests are being served).

Minimize initialization code: Code executed at function startup (outside the handler) runs on every cold start. Move heavy initialization (large library imports, database connection setup) to lazy initialization patterns that execute only when needed.

Runtime selection: Interpreted runtimes (Python, Node.js) have faster cold starts than compiled runtimes (JVM-based Java). GraalVM native image compilation dramatically reduces Java cold start time. Go has inherently fast cold starts.

Keep functions warm: Scheduled pings at regular intervals (every few minutes) prevent functions from being deprovisioned due to inactivity. Works but adds complexity and cost.


WebAssembly: The Emerging Compute Primitive

WebAssembly (Wasm) is an emerging compute primitive that compiles code from multiple languages (Rust, C/C++, Go, Python) to a portable binary format that runs at near-native speed in a sandboxed environment. Originally designed for browser execution, Wasm is increasingly used as a server-side compute model through WASI (WebAssembly System Interface).

Wasm advantages over containers for specific use cases:

  • Startup time in microseconds vs. seconds for containers
  • Stronger security sandbox than containers (no shared OS kernel)
  • True portability — the same Wasm binary runs identically on any WASI-compatible runtime
  • Smaller footprint — Wasm modules are kilobytes vs. megabytes for container images

Current maturity: Wasm for server-side compute is maturing rapidly (Fastly Compute@Edge, Cloudflare Workers, wasmCloud, Fermyon Spin) but not yet at the enterprise adoption level of containers. Organizations evaluating edge compute and plugin architectures should track Wasm's development.


Vendor Ecosystem

Explore cloud compute platforms at the Cloud Infrastructure Directory.

VM Platforms

  • VMware (Broadcom) — Enterprise on-premises virtualization (vSphere, ESXi)
  • AWS EC2, Azure VMs, GCP Compute Engine — Cloud VM services

Container Platforms

  • Kubernetes — Open-source container orchestration (EKS, AKS, GKE for managed)
  • AWS ECS / Fargate — AWS container orchestration and serverless containers
  • Docker — Container build and local development tooling

Serverless

  • AWS Lambda — Market-leading FaaS. 15-minute timeout, 10GB memory, extensive trigger integrations.
  • Azure Functions — Strong Microsoft ecosystem integration. Durable Functions for stateful workflows.
  • Google Cloud Run — Serverless containers. Excellent cold start performance.
  • Cloudflare Workers — Edge-deployed JavaScript/Wasm execution. Sub-millisecond cold starts.

Key Takeaways

The optimal compute model for any workload is determined by its specific characteristics — statefulness, traffic pattern, latency requirements, execution duration, and operational team capability — not by organizational default or technology trend. The shift toward containers and serverless reflects their genuine advantages for the majority of cloud-native workloads, not a mandate to abandon VMs for every use case.

The practical architecture for most enterprises: VMs for legacy and stateful database workloads, Kubernetes containers for microservices and stateless applications, and serverless for event-driven and variable-traffic workloads. The platform engineering team's role is to make each of these options easy to consume through golden paths — so teams make the right compute model choice for their workload, not the most familiar choice.


compute modelsvirtual machinescontainersserverlessKubernetesAWS LambdaAzure FunctionsWebAssemblyworkload placementcloud computeplatform engineering
Share: