LIVEยทThe trends shaping tomorrow's world.
Future Tech

Serverless Computing Explained

Serverless runs your code without managing servers and bills by use. How it works, cold starts, Lambda vs Cloud Run vs Azure Functions, and the trade-offs.

Serverless computing is a cloud model where you deploy code (or a container) and the provider runs it on demand, handling servers, scaling and patching for you, and billing you for the resources your code actually uses rather than for machines you reserve. The best-known form is functions as a service, such as AWS Lambda, where a short-lived function runs in response to an event. Serverless platforms can scale down to zero when idle, which saves money for spiky workloads but introduces "cold starts" when new instances spin up.

What "serverless" really means

The name is misleading on purpose. Your code still runs on servers. As a group of UC Berkeley researchers put it in their 2019 paper on the topic, serverless is "arguably an oxymoron," and the name stuck because the user "simply writes the code and leaves all the server provisioning and administration tasks to the cloud provider" [2].

That Berkeley paper offers the most useful definition. It describes serverless as FaaS + BaaS: cloud functions (Function as a Service) plus managed backend services (Backend as a Service) such as databases and storage. For a service to count as serverless, it "must scale automatically with no need for explicit provisioning, and be billed based on usage" [2].

The authors list three critical distinctions from traditional "serverful" cloud computing [2]:

  1. Decoupled computation and storage. Compute is stateless; storage is a separate service, scaled and priced independently.
  2. Executing code without managing resource allocation. You provide code, and the cloud provisions resources to run it.
  3. Paying for resources used, not resources allocated. Billing follows execution (for example, execution time) rather than the size and number of VMs you've reserved.

Where serverless fits in the NIST cloud model

NIST's definition of cloud computing, SP 800-145, dates from 2011 and doesn't mention serverless by name. It does define the traits serverless takes to an extreme. Its "rapid elasticity" characteristic describes capabilities that scale "rapidly outward and inward commensurate with demand," and "measured service" describes metered usage, typically on a pay-per-use basis [1]. Serverless sits closest to NIST's Platform as a Service model, in which the consumer "does not manage or control the underlying cloud infrastructure including network, servers, operating systems, or storage" but controls the deployed applications [1]. For more on the service models, see our cloud computing guide.

How serverless works

Take AWS Lambda, which the Berkeley authors credit with drawing widespread attention to serverless computing after Amazon introduced it in 2015 [2].

  1. You upload code and pick memory and a timeout.
  2. You connect a trigger. AWS says Lambda Event Functions can be triggered by API Gateway, Amazon S3, Amazon SQS, EventBridge and 200+ other AWS services [3].
  3. An event arrives. Lambda finds or creates an execution environment, runs your handler, and returns the result.
  4. Traffic grows. Lambda creates more execution environments in parallel; each invocation runs independently [3].
  5. Traffic stops. Environments are frozen, reused for a while, and eventually shut down. You stop paying for compute.

The execution environment lifecycle

AWS documents three phases [5]:

  • Init. Lambda starts extensions, boots the language runtime and runs your code outside the handler (imports, database connections). This phase is limited to 10 seconds for on-demand functions.
  • Invoke. Lambda runs your handler. The function timeout limits this phase.
  • Shutdown. Lambda cleans up the environment.

After an invocation, Lambda keeps the environment around "for some time in anticipation of another function invocation," but terminates environments every few hours for maintenance, even under continuous traffic [5]. Objects created outside the handler, like database connections, survive between invocations in the same environment, which is a common optimization. The /tmp directory also persists while the environment is frozen [5].

Under the hood: microVMs

Running many customers' code on shared hardware requires strong isolation. AWS built Firecracker, an open source virtual machine monitor, for this purpose. Its NSDI 2020 paper explains that the traditional choice between virtualization (strong security, high overhead) and containers (weaker security, low overhead) was unacceptable to public cloud providers, who need both. Firecracker runs in Lambda and AWS Fargate, supporting "millions of production workloads, and trillions of requests per month" [10]. AWS's Lambda docs list Firecracker virtualization, "VM-level isolation between workloads," as part of Lambda's foundation [3]. Our explainer on containers vs virtual machines covers this trade-off.

Cold starts

A cold start happens when a request arrives and no ready execution environment exists, so the platform must download code, start the environment and run initialization before handling the request. AWS says cold starts "typically occur in under 1% of invocations" and range from under 100 milliseconds to over 1 second, and are more common in development and test functions that run infrequently [5]. You are charged for initialization time [5].

The Berkeley authors identified three components of cold-start latency: starting the function, initializing the software environment (such as loading Python libraries) and application-specific initialization. They noted that the last two "can dwarf the former" [2]. In other words, heavy dependencies often matter more than the platform.

Ways to reduce cold starts, from vendor docs:

  • Pre-warmed capacity. AWS Lambda's provisioned concurrency pre-initializes environments [5]. Azure Functions' Flex Consumption and Premium plans support "always ready" instances [9]. Cloud Run lets you set minimum instances [6].
  • Snapshots. Lambda SnapStart initializes the function when you publish a version and resumes new environments from a saved snapshot [5].
  • Lighter initialization. Import only the libraries you need and lazy-load rarely used objects [5].

Each of these trades some of serverless's "pay nothing when idle" promise for predictable latency.

The major platforms compared

As of November 2026, from official documentation:


AWS Lambda (Event Functions)

Google Cloud Run (services)

Azure Functions (Flex Consumption)

Unit you deploy

Function code or container image

Container (or source code built into one)

Function code (Linux; container support in preview)

Max run time

30 minutes per invocation [4]

Request timeout default 5 min, up to 60 min [8]

Default 30 min, no enforced maximum (HTTP responses capped at 230 seconds) [9]

Memory

128 MB to 10,240 MB [4]

Configurable per service

512 MB, 2,048 MB or 4,096 MB instances [9]

Concurrency per instance

One request per environment by default [3]

Default 80 (console); up to 1,000 [7]

Configurable per-instance concurrency [9]

Scale to zero

Yes

Yes [6]

Yes, with optional always-ready instances [9]

Scale-out ceiling

1,000 concurrent executions default, raisable [4]

1,000 instances or more via quota [6]

Up to 1,000 instances per function group [9]

A few notes on that table:

  • Check limits against current docs. As of November 2026, AWS documentation lists a maximum of 1,800 seconds (30 minutes) per Lambda invocation [4]. Older tutorials may quote different figures.
  • Lambda now has several compute types. AWS describes Lambda Event Functions (the classic model), Lambda Web Functions for HTTP servers with multiple concurrent requests per environment, and Lambda MicroVMs for isolated environments that can last up to 8 hours [3].
  • Cloud Run is container-first. Google describes it as "a fully managed application platform for running your code," with services for HTTP traffic, jobs that run to completion, and worker pools for always-on background work [6]. It offers request-based billing (no charge for idle instances, plus a per-request fee) or instance-based billing [6].
  • Azure's legacy Consumption plan is winding down on Linux. Microsoft says hosting function apps on Linux in the Consumption plan retires on 30 September 2028 and recommends Flex Consumption for new serverless apps [9].

What serverless is good for

The Berkeley paper and vendor docs point to the same sweet spots [2][3][6]:

  • Event-driven glue. Resize an image when it lands in storage, process a queue message, react to a database change.
  • APIs and web backends with variable traffic. Scale out under load, scale to zero overnight.
  • Scheduled jobs. Cloud Run jobs and timer-triggered functions run tasks to completion on a schedule [6].
  • Parallel batch work. Fan out thousands of short tasks.
  • AI inference. Google says Cloud Run services and jobs support GPUs for inference and batch AI work [6].

Benefits

  • No server management. The provider handles capacity, patching and scaling [3].
  • Pay for use. Billing follows execution rather than reserved machines [2].
  • Automatic scaling, including to zero on many platforms [6][9].
  • Faster delivery. Teams ship code without building infrastructure first, which the Berkeley authors compared to the move from assembly to high-level languages [2].

Limitations and risks

  • Cold starts add latency to some requests [5].
  • Time and resource limits. Each platform caps run time, memory and payload size. Lambda's synchronous request and response payloads are capped at 6 MB each [4].
  • Statelessness. AWS says Lambda is designed for short-lived tasks "that do not retain or rely upon state between invocations" [4]. State must live in external services.
  • Coordination and communication. The Berkeley paper flagged inadequate storage for fine-grained operations, lack of fine-grained coordination, poor performance for standard communication patterns and unpredictable performance as limitations of the platforms it studied [2]. Some have improved since, but they shape which workloads fit.
  • Cost at steady high load. Pay-per-use is efficient for spiky traffic. For constant, heavy load, reserved capacity can be cheaper. Model your own numbers with the provider's calculator.
  • Lock-in. Triggers, permissions and event formats are provider-specific. Container-based platforms like Cloud Run reduce, but don't remove, that coupling.
  • Observability. Many short-lived instances make tracing harder; see our upcoming explainer on observability vs monitoring.
  • Security responsibility doesn't disappear. The provider secures the infrastructure; you still own code, dependencies, permissions and data. Least-privilege access fits naturally with zero trust architecture.

Serverless vs containers vs VMs


Virtual machines

Containers on Kubernetes

Serverless

You manage

OS, runtime, scaling

Images, cluster config (or a managed control plane)

Code and configuration

Scaling

Manual or autoscaling groups

Pod autoscaling

Automatic, per request or event

Idle cost

Pay while running

Pay for nodes

Often zero

Best for

Legacy apps, full control

Long-running services, portability

Event-driven, spiky workloads

For the Kubernetes side, see our Kubernetes architecture explainer.

How to decide

Choose serverless when:

  • Traffic is spiky, unpredictable or often idle.
  • Work is naturally event-driven or splits into short tasks.
  • Your team wants to spend time on product code, not infrastructure.

Look elsewhere (or use container platforms with minimum instances) when:

  • You need consistently low latency and can't tolerate cold starts.
  • Jobs run longer than platform limits or need large local state.
  • Load is steady and high enough that reserved capacity costs less.
  • You need specialized OS-level control.

Many organizations end up with a mix: serverless for glue and bursty APIs, containers or VMs for steady core services, all defined in code with infrastructure as code.

Outlook

The Berkeley authors predicted in 2019 that serverless would "grow to dominate the future of cloud computing" once its challenges were addressed [2]. Whether or not that holds, platform documentation as of November 2026 shows the boundaries blurring: Lambda now offers HTTP-server and long-lived microVM options [3], Cloud Run services and jobs can use GPUs [6], and Azure Functions can run on Container Apps [9]. "Serverless" is becoming less a product category and more an operating model: automatic scaling and usage-based billing applied to more kinds of compute.

Frequently asked questions

Does serverless mean there are no servers?

No. Your code runs on the provider's servers. "Serverless" means you don't provision, patch or scale them yourself, and you're billed for usage rather than reserved capacity [2].

What is the difference between serverless and FaaS?

Function as a Service is one part of serverless: running individual functions in response to events. The Berkeley definition treats serverless as FaaS plus Backend as a Service, meaning managed databases, storage and other services that also scale automatically and bill by use [2].

What causes a cold start?

A cold start happens when no ready instance exists, so the platform must create an environment, load your code and run initialization before handling the request. AWS says cold starts occur in under 1% of Lambda invocations and range from under 100 ms to over a second [5].

How long can a serverless function run?

It depends on the platform. As of November 2026, AWS Lambda Event Functions can run up to 30 minutes per invocation [4], Cloud Run service requests can be configured up to 60 minutes [8], and Azure Functions on Flex Consumption has no enforced maximum, though HTTP-triggered functions must respond within 230 seconds [9].

Is serverless cheaper than running servers?

For spiky or low-volume workloads, often yes, because you don't pay for idle capacity. For steady, heavy workloads, reserved VMs or containers can cost less. Run the numbers for your traffic pattern.

Sources

  1. Mell, P. and Grance, T. "The NIST Definition of Cloud Computing." NIST SP 800-145, September 2011. https://csrc.nist.gov/pubs/sp/800/145/final
  2. Jonas, E. et al. "Cloud Programming Simplified: A Berkeley View on Serverless Computing." arXiv:1902.03383, 2019. https://arxiv.org/abs/1902.03383
  3. Amazon Web Services. "What is AWS Lambda?" https://docs.aws.amazon.com/lambda/latest/dg/welcome.html
  4. Amazon Web Services. "Lambda quotas." https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html
  5. Amazon Web Services. "Understanding the Lambda execution environment lifecycle." https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtime-environment.html
  6. Google Cloud. "What is Cloud Run." https://docs.cloud.google.com/run/docs/overview/what-is-cloud-run
  7. Google Cloud. "About concurrency." https://docs.cloud.google.com/run/docs/about-concurrency
  8. Google Cloud. "Configure request timeout for services." https://docs.cloud.google.com/run/docs/configuring/request-timeout
  9. Microsoft Learn. "Azure Functions hosting options." https://learn.microsoft.com/en-us/azure/azure-functions/functions-scale
  10. Agache, A. et al. "Firecracker: Lightweight Virtualization for Serverless Applications." NSDI 2020. https://www.usenix.org/conference/nsdi20/presentation/agache