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
Related terms
More in Hosting and cloud
The basics