Serverless

Serverless is a cloud execution model in which the provider runs and scales the underlying compute, and the customer is billed only for actual usage (request count, execution time, memory). Despite the name, servers still exist; they are simply invisible to the customer. "Serverless" usually refers to functions-as-a-service (FaaS), but increasingly includes serverless databases, queues, and gateways.

Characteristics

  • Scale to zero. No traffic, no instances, no bill.
  • Event-driven invocation. Triggered by HTTP requests, queue messages, schedule, or object storage events.
  • Fine-grained billing. Usually per request and per millisecond of execution time.
  • No infrastructure management. No patching, capacity planning, or OS choices.

Common platforms

  • FaaS: AWS Lambda, Google Cloud Functions, Azure Functions, Cloudflare Workers, Vercel Functions, Deno Deploy
  • Containerised serverless: AWS Fargate, Google Cloud Run, Azure Container Apps
  • Edge runtimes: Cloudflare Workers, Vercel Edge Functions, AWS Lambda@Edge, Fastly Compute@Edge
  • Serverless databases: DynamoDB on-demand, Aurora Serverless, Neon, PlanetScale, Turso, Upstash

Tradeoffs

  • Cold starts. First request to a scaled-down function pays an initialization penalty. Mitigations: provisioned concurrency, warmer runtimes (V8 isolates).
  • Execution limits. Maximum duration and memory per invocation; some workloads do not fit.
  • Local development complexity. The execution environment is harder to replicate locally than a long-running server.

Subscribe to Sahil's Playbook

Clear thinking on product, engineering, and building at scale. No noise. One email when there's something worth sharing.
[email protected]
Subscribe
Mastodon