Stop 04 · Compute ServicesTopics · 8/10

Choosing Compute: VM vs Container vs Serverless

Part of the Cloud Computing Roadmap

In short

Interviewers love asking 'Would you run this on a VM, containers or Lambda?' There's no single right answer, but there is a sensible way to think it through. Here it is.

Each compute option trades off control, operational overhead, and cost differently — VMs give the most control, containers offer portability and density, serverless minimizes operations at the cost of some flexibility.

The blob character with a suitcase looks at a flat, a guest house and a small hotel.

Think of it like this

Flat, PG or hotel

Moving cities for years? Rent a flat and furnish it your way. Staying a few months? A PG room with meals sorted. Just a two-day interview trip? A hotel by the night. Same need, a roof, but different lengths and effort.

Watch it happen

A quick decision path

Need OS control?
Yes: VM
No: how it runs?
Always on
Containers
Short, on events
Serverless

1/4First question: do you need a custom OS, kernel modules, special software or licence rules tied to a machine?

The big ideas

What you need to know

VMs: most control

Any OS, any software, full access. You also own patching, scaling setup and monitoring.

Containers: portable middle

Same image everywhere, fast deploys, efficient use of servers. You still run an orchestrator or managed service.

Serverless: least ops

No servers, automatic scaling, pay per use. Limited by run time, cold starts and the provider's way of doing things.

Mix them

Real systems combine all three: containers for the API, functions for image processing, a VM for a legacy tool.

Save yourself the pain

Common mistakes

Oops

Picking the trendiest option and making the app fit it.

Do this instead

Start from the workload: how long it runs, how traffic looks, what the team knows. Then choose.

Oops

Ignoring team skills.

Do this instead

A team that knows VMs well may ship faster there than struggling with Kubernetes. Skills are a real constraint.

Your mission

Choose for five apps

~20 min

Quick check

A webhook gets 50 calls on a normal day and 20,000 during a sale, each call taking 200 ms. Best first choice?

Go deeper

  1. 1Match 3 different hypothetical workloads to the most appropriate compute option.
  2. 2Learn why a long-running, stateful service often fits VMs or containers better than serverless.
  3. 3Practice justifying a compute choice with specific reasoning, not just a default preference.

More topics at this stop

Stuck on this topic? Ask an Insider

Get 1:1 guidance from people who've walked this exact path — on the InsideEdge app.

Download
InsideEdge