Choosing Serverless (and Knowing When Not To)

Serverless has matured from a novelty into a mainstream backend pattern — but that doesn’t mean it’s the right choice for every service. Recent platform improvements (faster cold starts, database proxies, and even serverless inference at the edge) have extended serverless’ reach, but trade-offs around cost, state, and runtime constraints still matter. This short guide walks through when serverless shines today, where it still struggles, and a practical checklist to help you decide.

What’s changed lately that matters

Those improvements widen the list of good fit scenarios — but they don’t erase trade-offs. The rest of this article focuses on practical guidance.

When to use serverless

Example: a notification system that receives sporadic spikes during business hours and is idle overnight — serverless reduces cost, simplifies scaling, and maps neatly to event triggers.

When not to use serverless

Practical checklist (5 questions)

Answer these quickly to narrow the choice.

  1. Are requests short and stateless (sub-second to a few seconds)? If yes, serverless is a strong candidate.
  2. Is traffic highly variable with long idle periods? If yes, serverless usually reduces cost. (dev.to)
  3. Do you need GPUs, long-running compute, or fine-grained control of the runtime? If yes, prefer containers or specialized services. (dev.to)
  4. Does the service require many concurrent DB connections or complex transactions? If yes, investigate database proxies and test at scale — serverless can work but needs careful design. (docs.aws.amazon.com)
  5. Is global, low-latency execution important (personalization, auth, A/B testing)? If yes, consider edge serverless offerings. (cloudflare.com)

Quick patterns and mitigations

Final thought

Serverless is no longer just for tiny one-off functions — platform improvements make it a practical choice for many production backends. Still, the right decision depends on workload shape: short-lived, stateless, bursty, or event-driven services are ideal; long-running compute, heavy state, and predictable high-volume services usually belong elsewhere. Use the checklist above, validate with a small prototype, and choose the pattern that matches your operational and cost constraints.