Serverless
Serverless refers to a class of cloud services that require minimal or zero server management, configuration, patching, provisioning or scaling by the user.
There are still servers, of course, but they’re entirely the provider’s problem. A service is usually described as serverless when:
- there are no servers to manage: no operating systems, patching or capacity planning
- it scales automatically: from zero to very high load, and back again, without intervention
- you pay for use: billing is based on requests, execution time or data processed, not on provisioned capacity, and idle often costs little or nothing
- availability is built in: the service runs across multiple data centres by default
Serverless compute
The best-known examples are serverless functions such as AWS Lambda, Azure Functions and Google Cloud Run functions. You write code that responds to events (an HTTP request, a file landing in storage, a message on a queue, a schedule) and the platform runs it, scaling out as events arrive, without you managing any infrastructure.
Serverless isn’t only about functions. Serverless containers such as AWS Fargate, Azure Container Apps and Google Cloud Run run whole container images on the same pay-per-use, no-servers basis.
Beyond compute
Serverless also applies to:
- Databases: for example Amazon DynamoDB, Azure Cosmos DB, Google Firestore, and serverless options for relational databases such as Aurora Serverless
- Storage: for example Amazon S3, Azure Blob Storage and Google Cloud Storage
- Integration: queues, event buses, workflow and API gateway services, such as Amazon SQS, EventBridge and Step Functions, or Azure Service Bus, Event Grid and Logic Apps
- Other managed services: AI and foundation models, search, analytics, identity, messaging and more
Event-driven architecture
See Event-Driven Architecture for a fuller treatment.
Serverless works best with event-driven architectures, where small, independent components react to events and communicate through managed queues and event buses rather than calling each other directly. This gives low coupling, independent scaling and the ability to change one part of a system without redeploying the rest, all of which help when architecting for change.
Trade-offs
Serverless is a great default (see the mental model), but it has trade-offs to understand:
- Cold starts: a function that hasn’t run recently can take longer to respond to its first request. This matters for latency-sensitive paths and can be mitigated.
- Limits: execution time, memory, payload size and concurrency are all bounded.
- Cost at scale: pay-per-use is very cheap at low or spiky load, but steady, very high throughput can be cheaper on provisioned capacity. Measure it.
- Coupling to the provider: you get the most value by using the provider’s event sources and services, which makes moving harder. Keep business logic separate from provider-specific glue.
- Observability and testing: a distributed, event-driven system needs good tracing, structured logging and automated tests in real cloud environments.