Choosing between functions and serverless containers: when (and when not) to use serverless for your backend

Serverless is no longer a single thing. Today “serverless” can mean tiny edge functions that start in milliseconds, cloud functions that auto-scale to zero, or container-based serverless platforms that accept any container image and run it with autoscaling and longer timeouts. Picking the right flavor for your backend matters: the wrong choice can cost you performance, predictability, or money. This article walks through practical rules-of-thumb—when to choose functions (FaaS), when to prefer serverless containers, and when to avoid serverless entirely.

Quick primer: the important differences

When to use functions (FaaS)

Practical advantage: minimal operational surface—no container build/repo to manage, and instant scaling to zero avoids idle compute charges. But beware runtime constraints and cold starts for heavy runtimes; providers offer mitigations like provisioned concurrency and snapshot-based warm starts for Java. (docs.aws.amazon.com)

When to prefer serverless containers

Serverless containers are a practical middle ground: you still get autoscaling and lower ops, but with the flexibility of regular containers.

When not to use serverless (either flavor)

A simple decision checklist

Mitigations and practical tips

Conclusion Serverless is powerful, but it’s not a one-size-fits-all replacement for containers or VMs. Match the model to workload characteristics—latency sensitivity, runtime length, concurrency needs, and traffic shape. When you choose the right serverless flavor (or mix of flavors), you get much of the operational simplicity and scaling magic without surprising performance or cost.

Sources (selected)