Real serverless: when functions are worth it (and when they aren't)
Functions-as-a-Service promise the dream: you write the function, the platform handles the rest, and you pay only for what runs. Like every powerful abstraction, there's a hidden price.
Where serverless shines
- Event-driven, sporadic workloads: webhooks, upload processing, queue messages.
- APIs with irregular traffic — scaling to zero when nobody's using it saves a lot.
- Glue code between services, cron jobs and automations.
The trade-offs that matter
Cold start: the first invocation after idle loads the runtime and code — extra latency that can hurt sensitive APIs. Limits on execution time, memory and payload. And, counter-intuitively, for constant heavy workloads an always-on container is often cheaper than millions of invocations.
A concrete example
exports.handler = async (event) => {
const { a = 0, b = 0 } = event;
return { ok: true, sum: a + b };
};Wrote it, shipped it, invoked it. No server to provision, no OS patching.
The rule of thumb
Serverless is about extreme elasticity and zero ops, not about always being cheapest. Use it for the irregular and event-driven; use containers for the constant and predictable. On Kubmix Cloud you get both — Functions and Containers — and pick by workload.