Hosting and cloud · Concept

Serverless

A way to run server code without renting or managing a server: you upload functions, the provider runs them only when requests arrive, and you pay for what is used.

The basics · updated

How it works

There are still servers; you just never see them. You write small functions (handle this form, return these products) and the platform starts copies on demand, runs as many at once as traffic needs, and shuts them down when things go quiet, which is called scaling to zero. Billing is per request and per unit of compute time rather than per month.

AWS Lambda popularised the model, and Vercel Functions, Netlify Functions, Google Cloud Run functions, Azure Functions and Cloudflare Workers follow it. The catches: a function that has been idle can take a moment to start (a cold start), each run has a time limit, nothing stays in memory between requests, and many functions opening their own database connections can overwhelm a database unless a connection pooler sits in between.

Serverless pros and cons

Pros

  • No servers to patch, update or keep running
  • Scales from zero to heavy traffic automatically
  • Costs nothing, or close to it, while nobody is using it
  • Deploys straight from Git on most frontend clouds

Cons

  • Cold starts can add a noticeable delay after quiet periods
  • Time and memory limits rule out long-running jobs
  • Bills are harder to predict and can spike with traffic or abuse
  • Each provider has its own runtime, limits and pricing, which makes moving harder

When to use Serverless

Pick it when

  • APIs, form handlers and webhooks with uneven traffic
  • Sites on Vercel, Netlify or Cloudflare that need a little server code
  • Early products whose traffic is small or unknown

Skip it when

  • Long jobs, connections held open for hours, or heavy steady workloads
  • You want a flat, predictable monthly bill at high traffic

Serverless vs the alternatives

More in Hosting and cloud

The basics

All 26 Hosting and cloud terms

Crafted in the dark. Shipped to the world.

Tell us what you are building. You get a private project space with a proposal and a line-by-line quote within a day.