ServerlessDS-05 · theory

Source · Serverless Development on AWS (O'Reilly)

Why this matters

Serverless Development on AWS, Ch. 1

Provisioning and managing servers for bursty or unpredictable workloads is wasteful — you pay for idle capacity and still risk being under-provisioned at peak. Serverless flips this: you write functions, the cloud runs them on demand, scales them automatically, and bills only for actual execution.

For many event-driven and integration workloads, serverless is the fastest path from code to running, elastically scaled service — which is why it caps this path.

The concept

Serverless Development on AWS, Ch. 2–4

Serverless doesn't mean no servers — it means you don't manage them. The core model is FaaS (Functions as a Service), such as AWS Lambda: you deploy a function, and the platform provisions, scales, and runs it per invocation. Alongside FaaS sit managed services (queues, databases, storage, event buses) that are similarly operated by the provider.

Functions are activated by event triggers — an HTTP request, a file upload, a message on a queue, a scheduled timer. Scaling is automatic and per-request: a thousand simultaneous events spin up a thousand function instances. The cost model is pay-per-use — you pay for invocations and execution time, and idle costs nothing. The main trade-off is the cold start: the first invocation of an idle function pays extra latency to initialize the runtime. Serverless shines for event-driven, spiky, or glue workloads; it fits less well for long-running, latency-critical, or steady high-throughput jobs where dedicated capacity is cheaper.

Worked scenario

Serverless Development on AWS, Ch. 6

An image-processing feature must generate thumbnails when users upload photos — traffic is spiky and unpredictable. Rather than run always-on servers, a Lambda function is triggered by an S3 upload event. When ten uploads land, ten function instances run in parallel; when none arrive, nothing runs and nothing is billed.

The first invocation after a quiet period incurs a cold start of a few hundred milliseconds. For this asynchronous, bursty workload that's acceptable, and the team pays only for actual processing — a strong fit for serverless. A steady 24/7 video-transcoding farm at high utilization, by contrast, might be cheaper on reserved compute.

How it connects

Serverless Development on AWS, Ch. 9

Serverless is horizontal scaling (DS-01) made automatic, and its functions are the natural consumers of the events (DS-02), flows (DS-04), and data-product pipelines (DS-03) seen earlier in the path.

It closes the path by showing how the primitives — statelessness, events, streams — compose into an operational model where you ship functions and the platform handles scale.

Common traps
  • Reading 'serverless' as 'no servers' — servers exist; the provider just manages them for you.
  • Ignoring cold starts — the first call to an idle function pays initialization latency.
  • Assuming serverless is always cheapest; steady high-utilization workloads can be cheaper on reserved capacity.
Key takeaways
  • FaaS (e.g. Lambda) runs your functions on demand; managed services handle queues, storage, and databases.
  • Event triggers invoke functions; scaling is automatic and per-request; you pay only for execution.
  • Great for spiky, event-driven glue; weaker for long-running, latency-critical, or steady heavy workloads.