Serverless
Also called serverless computing, functions as a service, FaaS.
A cloud model where the provider runs your code on demand and manages the servers, and you pay for what you use rather than for idle machines.
Last updated
What it is.
With serverless functions, you deploy code and the platform runs it when a request or event arrives, scales it with load and stops it when idle. Serverless also covers managed databases, queues and storage that scale and bill the same way.
There are still servers, but you never see or patch them. The trade-offs are run time and memory limits, cold starts and less control over the runtime.
Why it matters
Serverless removes most server work and makes cost follow usage, which suits new products, spiky traffic and background jobs. At steady high load it can cost more than containers, so the choice should be checked against expected traffic.
In a product build
We often start new products on serverless and managed services to keep ops light, then move steady, heavy workloads to containers when the numbers say so. Database access goes through connection pooling, and functions stay small and stateless.
Common mistakes.
- 01
Ignoring per-request costs at high, steady volume.
- 02
Long-running jobs that hit the platform's time limit.
- 03
Opening a database connection per call and exhausting the database.
Related terms.
- Cold startThe extra delay when a serverless function or a new server instance has to start up before it can handle a request.
- Edge functionA small piece of server code that runs on a CDN's servers around the world, close to the user, instead of in one central region.
- Container (software)A package that holds an application and everything it needs to run, isolated from other software on the same machine.
- AutoscalingAutomatically adding or removing computing capacity, such as servers or containers, as the load on a system goes up or down.
- Connection poolingKeeping a set of open database connections and sharing them across requests, instead of opening a new connection for each one.
Guides and pages
Browse the full glossary or read answers to common questions.