How do you choose between VMs, containers (Kubernetes) and serverless?
Answer
- VMs (EC2, Azure VM): full control, legacy apps, special OS needs; you patch and scale them.
- Containers on Kubernetes (EKS/AKS): many services, portability, fine control over scaling and rollout; operational complexity.
- Simpler container services (ECS/Fargate, Azure Container Apps, App Service): less operations work for typical web APIs.
- Serverless (Lambda, Azure Functions): event-driven, spiky or low traffic, pay per use; limits on runtime, cold starts, harder local testing.
- Decide by: team skills, traffic pattern, state and latency needs, cost model, vendor lock-in tolerance.
- Answer style: start simple, move to more control only when a need appears.
Practice this question in Repaso