What serverless means
With serverless functions, you upload small units of code and the cloud provider runs them in response to events. There are still servers, but you never provision or manage them. The platform handles scaling, patching, and capacity.
This model is often called Functions as a Service.
Event driven execution
A function runs only when triggered. Common triggers include:
- An HTTP request through an API gateway.
- A message arriving on a queue.
- A file upload to object storage.
- A scheduled timer.
Scaling and billing
The platform creates a new instance for each concurrent request and scales to zero when idle. You pay only for the execution time and memory used, with no charge while nothing is running.
Tradeoffs
- Good for spiky, event driven, or low traffic workloads.
- Watch out for execution time limits, statelessness, and cold start latency on the first request.
Functions should be stateless, storing any persistent data in a database or object store.
Key idea
Serverless functions run stateless code on demand in response to events, scale automatically including to zero, and bill only for actual execution.