What Is Serverless Computing? A Plain-English Explanation

What Is Serverless Computing? A Plain-English Explanation

What is serverless computing? It is a way of running applications in the cloud where the provider manages the servers, and you write code that runs in response to events, paying only for the time it actually executes.

What is serverless computing in practice is simpler than the name suggests: there are still servers, but you never see them, provision them or patch them. The short answer is that serverless trades control for convenience: you give up the server, and in return you get automatic scaling, no idle cost, and no infrastructure to maintain.

The model suits workloads that arrive in bursts or on a schedule: a function that processes an uploaded image, an API that answers occasional requests, or a nightly job that transforms data. It suits them poorly when a workload runs constantly, needs long execution times, or depends on state held in memory between requests.

Understanding where that line falls is the whole skill of using serverless well. Our guide to cloud computing explains the infrastructure serverless builds on.

Key takeaways

  • Serverless computing runs code in response to events, with the provider managing all servers.
  • You pay for execution time, not for idle capacity, and unused functions cost nothing.
  • The two main forms are functions as a service (FaaS) and backend as a service (BaaS).
  • Cold starts, execution limits and statelessness are the constraints to design around.
  • Serverless fits event-driven, bursty and intermittent workloads best, not constant heavy ones.

How serverless actually works

A serverless application is made of functions: small pieces of code, each doing one job, each triggered by an event. An event can be an HTTP request, a file arriving in storage, a message in a queue, a database change, or a timer.

When the event fires, the provider creates an environment, runs the function, and discards the environment when the work is done. If a thousand events arrive at once, the provider runs a thousand copies in parallel; if none arrive, nothing runs and nothing is charged.

That scaling behaviour is the model’s defining feature, and it is called scaling to zero. A traditional server costs money whether it is busy or idle, because it exists around the clock.

A serverless function costs nothing when it is not running, which makes it economical for workloads that are quiet most of the time and busy in bursts. The provider handles the machinery behind this: provisioning, patching, load balancing and fault tolerance are all its job, not yours. Best for: readers who want the mechanics of serverless before the trade-offs.

A short history of serverless

Serverless computing became a mainstream model with the launch of AWS Lambda, announced at the AWS re:Invent conference on 13 November 2014. Lambda let developers run code in response to events without provisioning or managing a single server, and it billed in small increments of compute time. At launch it supported only Node.js, with tight limits on memory, runtime and concurrency, and it was presented as a way to connect other services together rather than as a general platform.

The model grew quickly from that narrow start. Azure Functions and Google Cloud Functions followed, and the ecosystem filled in around them: API gateways to give functions a public front door, managed databases and queues to hold state, and frameworks to deploy and test functions as a project. Today the major providers support many languages, longer runtimes and larger workloads, and serverless has expanded beyond functions into containers and databases that scale to zero as well. Best for: readers who want to know where the model came from and how far it has developed.

Abstract illustration of small code functions being triggered by events and scaling automatically in the cloud
Serverless functions run only when an event triggers them, scaling from zero to thousands of parallel executions and back again without any servers to manage.

FaaS and BaaS: the two halves of serverless

Functions as a service, or FaaS, is the part most people mean by serverless: code that runs in response to events, managed by the provider. AWS Lambda, Azure Functions and Google Cloud Functions are the main examples, and Cloudflare Workers extends the idea to the edge, running code close to users. FaaS is where your custom logic lives, and it is the part you write, test and deploy.

Backend as a service, or BaaS, is the other half: managed services that replace the parts of a backend you would otherwise build yourself. Authentication, databases, file storage, push notifications and search can all be bought as services rather than written as code. A serverless application usually combines the two: BaaS services hold the state and provide the common capabilities, while FaaS functions hold the custom logic that ties them together. Best for: teams deciding how much of their backend to build and how much to buy as a service.

What serverless is good at

Serverless shines for event-driven work. Processing a file when it is uploaded, sending a notification when an order is placed, validating a form when it is submitted, or transforming data when it arrives are all natural fits, because each is a small, self-contained job triggered by something happening. APIs with unpredictable traffic fit well too: a function can handle ten requests on a quiet day and ten thousand on a busy one without anyone reconfiguring capacity.

Scheduled work is another strong fit. Nightly reports, regular data clean-ups, periodic checks and reminders all run as functions on a timer, costing nothing between runs.

Prototypes and side projects benefit as well, because a serverless application can sit idle for weeks at no cost and still be ready instantly. The common thread is intermittence: serverless is at its best when the work comes and goes. Best for: teams with bursty, event-driven or scheduled workloads looking for a simpler platform.

Cold starts, limits and statelessness

Every serverless design must reckon with three constraints. The first is the cold start: when a function has not run recently, the provider must create its environment before the code can run, which adds delay to that first request.

The delay is usually measured in hundreds of milliseconds, but it matters for user-facing work, and it varies by language and by how much the function needs to load. Keeping functions warm, or choosing a runtime with fast startup, reduces it.

The second constraint is limits. Functions have maximum runtimes, memory sizes and package sizes, and they cannot hold state in memory between invocations, because the provider may discard the environment at any time. State must live in a managed store, such as a database or a queue, and any work that needs hours of continuous computation belongs elsewhere.

The third constraint is observability: debugging a function that runs for a second, in an environment you cannot inspect, requires good logging and tracing from the start. Our guide to cloud deployment models puts serverless in context with the alternatives. Best for: developers who want the real constraints before committing to the model.

Aspect Serverless Traditional servers or containers
Provisioning None: provider manages everything You provision and size capacity
Scaling Automatic, including to zero Manual or configured autoscaling
Cost when idle Nothing You pay for running capacity
Cost when busy Per execution and duration Fixed capacity, then extra
Execution limits Time, memory and package caps Limited by the machine
State Stateless: use external stores Can hold state in memory or disk
Best for Event-driven, bursty workloads Constant, long-running workloads

The table makes the cost trade-off visible: serverless is cheaper when workloads are intermittent, because idle capacity costs nothing, but it can be more expensive than a server when a workload runs constantly, because every execution is billed. The right choice follows the workload’s shape, not the fashion of the moment, and many systems use both: serverless for the bursty edges and servers or containers for the steady core. Best for: decision makers comparing serverless with containers and virtual machines.

Serverless costs and vendor lock-in

Serverless pricing is usually based on the number of invocations and the duration and memory of each execution, which makes costs proportional to use. That is attractive, and it is also easy to misjudge: a function that is called millions of times a day, or one that runs slowly because it waits on a database, can produce a larger bill than a small server would have. Model the cost with realistic traffic before committing, and set billing alerts so a surprise is caught early rather than at the end of the month.

Vendor lock-in is the other honest concern. Functions are written against a provider’s event model, its services and its deployment tools, and moving to another provider means rewriting the integration layer, even if the core logic stays the same.

The risk can be reduced by keeping business logic separate from provider-specific code and by using standard interfaces where they exist, but it cannot be removed entirely. Treat lock-in as a cost to weigh, not as a reason to refuse the model outright. Best for: managers weighing the financial and strategic costs of a serverless commitment.

Is serverless right for you? Checklist

  • Is the workload event-driven, bursty or intermittent, rather than constant and heavy?
  • Can the work be split into small, stateless functions with clear triggers?
  • Can state live in a managed database, queue or storage service instead of memory?
  • Does every function finish well within the provider’s runtime limit?
  • Are cold starts acceptable for this workload, or can they be reduced enough?
  • Have you modelled the cost at realistic traffic, with billing alerts in place?
  • Is the team comfortable debugging through logs and traces rather than a live server?
  • Can provider-specific code be isolated, so the core logic stays portable?

Frequently asked questions

What is serverless computing in simple terms?

Serverless computing is running code in the cloud without managing servers. You write small functions that run when something happens, such as a request arriving or a file being uploaded, and the provider handles the servers, scaling and maintenance. You pay only for the time your code actually runs.

Are there really no servers in serverless?

There are servers, but they belong to the provider and you never see them. The name describes the developer’s experience, not the physical reality: no servers to provision, patch, monitor or scale. The provider runs the infrastructure and hides it behind an interface where you deploy code and events.

What is the difference between serverless and containers?

Containers package an application with its dependencies and run on infrastructure you manage, even if that management is automated. Serverless removes the infrastructure management entirely: you deploy a function and the provider runs it. Containers suit long-running services; serverless suits short, event-driven work.

Many systems use both. Our guide to cloud service models compares the layers these options sit on.

What is a cold start?

A cold start is the delay when a serverless function runs for the first time after a period of inactivity, while the provider creates its execution environment. It is usually measured in hundreds of milliseconds and matters most for user-facing requests. Keeping functions warm, using fast-starting runtimes and keeping packages small all reduce it.

When should I not use serverless?

Avoid serverless for workloads that run constantly at high volume, need long execution times, hold state in memory, or need very low, predictable latency on every request. A small server or a container is usually cheaper and simpler for those. Serverless is at its best when work is intermittent, event-driven or scheduled.

Is serverless secure?

Serverless removes some risks, because there is no server operating system for you to patch or misconfigure, but it does not remove security work. Functions still need least-privilege permissions, secrets still need a secrets manager, and the managed services around the functions still need correct configuration. Our guide to cloud workload protection covers the runtime controls that apply here too.

Latest articles

Scroll to Top