Skip to content

Lesson 9 of 9 · 20m

When Not to Go Serverless

The boundary conditions: sustained high throughput, strict low latency, heavy compute, stateful systems, data locality, and organizational cost.

Serverless is a strong default for spiky, event-driven, operationally small workloads. It is not a moral position. The senior move is knowing when Lambda and managed services are the wrong abstraction before building yourself into an expensive corner.

Sustained utilization changes the economics

Lambda shines when demand is uneven or sparse. At high utilization all day, containers or VMs often become cheaper and more predictable:

spiky API:        2 busy hours, 22 idle       -> serverless often wins
worker fleet:     92% CPU utilization all day -> containers often win
nightly batch:    15 minutes, then nothing    -> serverless often wins
constant streams: millions of records/minute  -> measure carefully

Include operations labor, scaling behavior, logging, networking, and deployment friction — not just list-price compute.

Hard latency constraints may not fit

Provisioned concurrency reduces cold starts, but it does not turn Lambda into bare metal. If you need consistent single-digit millisecond responses, CPU pinning, kernel tuning, specialized networking, or deterministic memory locality, the platform is usually the wrong substrate.

Some workloads are stateful at their core

Serverless compute assumes externalized state. Game simulation loops, in-memory indexes, order books, large mutable caches, and specialized media pipelines fight that assumption. You can force them into Lambda, but you end up shipping state in and out on every invocation or paying external services until the benefit disappears.

Platform limits are real architecture

Lambda has bounded execution time, memory, disk, and CPU, and GPU compute is not the model. Video transcoding, model training, large scientific computation, and multi-hour jobs generally belong on batch compute, containers, or specialized services. Lambda can orchestrate those jobs effectively without performing the work itself.

Data gravity and team maturity matter

If data and users live in another cloud or on-premises, egress cost and latency may dominate. Pulling large objects through Lambda just to transform them can also be a poor fit when storage-native or edge-native processing exists.

Team maturity is equally real. Queues, retries, idempotency, distributed tracing, event contracts, and infrastructure-as-code are not optional in production. A boring container monolith can be safer than an event-driven diagram the team cannot yet operate.

A sane decision framework

Choose serverless when traffic is spiky or event-driven, work decomposes into short stateless units, managed services remove real operational burden, asynchronous failure semantics are acceptable, and cost has been modeled at realistic scale.

Choose conventional compute when sustained utilization, strict latency, specialized hardware, heavy local state, long-running computation, or simpler operational complexity dominates.

Field notes

  • Hybrid architecture is normal: serverless edges, conventional hot cores, managed queues between them.
  • Keep domain logic portable and isolate platform-specific adapters; reversible decisions beat ideology.
  • Benchmark and cost-model at 10x expected load, not demo load.
  • A managed service does not make failure disappear; it changes who gets paged first.

Was this lesson helpful?

Sign in to rate