What is serverless computing?

Serverless computing is a cloud model where the provider runs, scales and patches the servers for you, and you pay only while your code handles requests or events. AWS Lambda is the best-known example.

Also called serverless, function as a service, FaaS, serverless architectureUpdated

Servers still exist in serverless computing. The difference is that you never see them. You hand the cloud provider a function or a container image, and it decides where to run it, starts more copies when traffic rises, stops them when traffic falls and patches the operating system underneath. You pay for the work done, not for machines waiting.

How it works

There are two common forms:

  • Functions as a service (FaaS): AWS Lambda, Azure Functions and Google Cloud Run functions. You write a handler that runs when an event arrives: an HTTP request, a file upload, a queue message or a schedule.
  • Serverless containers: AWS Fargate, Google Cloud Run and Azure Container Apps. You supply a normal container image and the platform handles capacity.

Managed services such as DynamoDB, S3, SQS and Aurora Serverless are often counted as serverless too, because you don't size or patch them.

Three behaviours define the model:

  1. Scale to zero. With no traffic, nothing runs and (for most services) nothing is billed.
  2. Cold starts. The first request after a quiet period waits while a new instance starts. For Node.js, Python and Go this is usually tens to hundreds of milliseconds.
  3. Limits. A standard Lambda function can run for at most 900 seconds (15 minutes) per invocation. Payload size, memory and concurrency are capped too.

Example: processing uploaded KYC documents

A lending app lets users upload a PAN card photo.

  1. The mobile app uploads the image straight to an S3 bucket using a pre-signed URL.
  2. S3 emits an ObjectCreated event, which triggers a Lambda function.
  3. The function compresses the image, calls an OCR service and writes the extracted fields to a database.
  4. It puts a message on a queue so the verification service can pick it up.

On a quiet night the function may run a few times. On the last day of a loan campaign it may run thousands of times an hour. Nobody resized anything in between.

Serverless vs microservices and containers

Serverless is a way of running code. Microservices are a way of splitting an application. You can build microservices on functions, on containers or on plain virtual machines. Serverless fits event-driven glue very well: webhook receivers, file processing, scheduled jobs.

Containers suit steady, busy APIs, long-running work and websockets. At high steady volume, per-request billing can cost more than always-on containers. Our serverless vs containers guide compares the two by workload.

When not to use it

  • Requests that need consistently low latency and can't tolerate cold starts, unless you pay to keep instances warm.
  • Jobs longer than the platform's time limit.
  • Many short-lived functions opening direct connections to a relational database. Use a connection pooler such as RDS Proxy or PgBouncer.
  • Teams that need to run the same stack on several clouds or on premises, since each provider's event model differs.

Common mistakes

  • Splitting one feature into dozens of tiny functions, which makes tracing and local testing hard.
  • No idempotency. Event sources such as S3 and SQS can deliver the same event more than once, so handlers must cope with repeats.
  • Ignoring cost visibility. Tag functions by team and feature, as you would in any FinOps practice.

We design serverless and container platforms on AWS, Azure and GCP through our cloud and infrastructure work.

Any idea in mind? Let's make it real.

Tell us what you're building. You'll hear back from an engineer, not a sales team, usually within one working day.

Book a 30-min call