VM, container, microVM or function?
| Dimension | Virtual machines | Containers | MicroVMs | Serverless functions (FaaS) |
|---|---|---|---|---|
| You manage | The OS and everything above it | Your image; the host OS is shared | A small kernel and root filesystem, or nothing on a platform built on them | Only the handler code |
| Isolation | Own kernel, hardware virtualisation | Shared host kernel; a kernel bug can cross the boundary | Own kernel, hardware virtualisation | Whatever the platform uses; Lambda uses microVMs |
| Start-up time | Tens of seconds to minutes | Seconds or less | About 125 ms to boot; less from a snapshot | Milliseconds warm; up to seconds cold |
| You pay for | Every second it runs | The machines it runs on, or per task | Usually per second of runtime, through a platform built on them | Each request and millisecond of runtime |
| Longest single run | Unlimited | Unlimited | Unlimited | Capped, e.g. 15 minutes on Lambda |
| Cost when idle | Full price | Depends; some platforms scale to zero | Low; platforms suspend or snapshot idle microVMs and charge only for stored state | Zero |
| Reach for it for | Legacy apps, special OS needs, full control | Services that must run the same everywhere | Running untrusted or multi-tenant code safely | Event-driven glue and spiky, short tasks |
Rule of thumb
These layer on each other more than they compete: containers usually run on VMs, and function platforms run your code inside containers or microVMs. The real questions are how much of the stack you want to own, and whether you trust the code you’re running.
Sources
- Amazon EC2 On-Demand pricing (per-second billing)
- Cloudflare Blog: Introducing Cloudflare Workers (2017), VMs take tens of seconds to boot
- Amazon EC2 Auto Scaling docs: Warm pools for applications with long boot times
- Azure docs: Container Instances overview (containers start in seconds)
- AWS Fargate pricing (per task)
- Cloud Run docs: Instance autoscaling (scale to zero)
- Firecracker website: boot in under 125 ms
- Firecracker docs: Snapshot support
- Fly.io docs: Pricing (Machines billed per second, stopped Machines pay for storage)
- AWS News Blog: AWS Lambda introduces MicroVMs (Jun 2026), idle microVMs suspended
- Lambda docs: Tenant isolation (execution environments use Firecracker)
- Lambda docs: Execution environment lifecycle (cold start duration)
- Lambda docs: Quotas (15-minute timeout)
- AWS Lambda pricing (per request and per millisecond)