StackLift
All terms

Glossary

Serverless

A cloud model where the provider runs your code on demand and you pay for use, not for idle servers.

Serverless is a cloud approach in which you deploy code or use managed services without provisioning or managing servers. The provider starts your code when a request or event arrives, scales it automatically and charges for actual use. Servers still exist, but running them is the provider's job.

The best-known form is functions as a service, such as AWS Lambda, Google Cloud Functions or Azure Functions. Serverless also covers managed databases, queues and storage that scale without capacity planning.

It fits spiky or event-driven workloads well. Trade-offs include start-up delay on cold starts, execution time limits and some dependence on one provider's tools.

Start in 60 seconds

Put this to work on your project.

Get an AI-assisted, architect-reviewed scope, cost range, and timeline. Free, no login.

The complete guide

Serverless: the complete guide

Updated November 18, 2026 ยท Published by , Founder, StackLift AI. Written with AI assistance; how we make content.

Short answer

Serverless is a way of running code in the cloud where the provider manages the servers for you. You deploy functions or services, the platform starts and scales them when requests arrive, and you pay for what runs instead of for idle machines. Servers still exist, but you do not provision or patch them.

What is serverless computing?

Serverless computing is a cloud model in which you write the application logic and the provider handles the machines underneath. You do not choose server sizes, install operating systems or plan capacity. The platform runs your code when something triggers it and scales it up or down automatically.

The name is misleading. Servers are still there, run by the provider. "Serverless" describes your experience: no servers to manage. Billing follows usage, such as the number of requests and the time and memory they consume, rather than hours of a reserved machine.

The term covers two related ideas. Functions as a service runs short pieces of code on demand. Serverless backend services, such as managed databases, queues, storage and authentication, are used without running their servers either. Most serverless applications combine both.

Why do teams choose serverless?

  • Less operations work: no servers to patch, scale or monitor at the machine level.
  • Automatic scaling: traffic spikes are handled without capacity planning.
  • Pay for use: quiet periods cost little, which suits new products and uneven traffic.
  • Faster start: a small team can ship a working back end quickly.
  • Built-in resilience: platforms run code across multiple zones by default.

These benefits are real, and so are the trade-offs. Serverless does not remove engineering. It moves effort from running servers to designing for events, limits and observability.

How does serverless work, step by step?

  1. You write a function or a small service and package it with its dependencies.
  2. You deploy it to a platform such as AWS Lambda, Azure Functions, Google Cloud Functions or Vercel Functions.
  3. You connect a trigger: an HTTP request, a file upload, a queue message, a schedule or a database change.
  4. When the trigger fires, the platform starts an execution environment and runs your code.
  5. If many triggers arrive at once, the platform runs many copies in parallel.
  6. When traffic stops, instances are shut down, and you stop paying for them.
  7. Logs, metrics and traces are sent to the platform's monitoring tools.

Because each run is short-lived and may be on a fresh instance, serverless code should not keep important state in memory. State belongs in a database, cache, queue or storage service.

What are the main building blocks of a serverless application?

Typical serverless components
ComponentRoleExamples
ComputeRuns your code on demandAWS Lambda, Azure Functions, Google Cloud Functions, Vercel Functions
API layerRoutes web requests to codeAPI gateway services and framework routes
DataStores state outside the functionManaged PostgreSQL, DynamoDB, serverless databases
MessagingDecouples steps and absorbs spikesQueues, topics, event buses
StorageHolds files and objectsObject storage and blob services
IdentityHandles sign-inManaged auth services. See Auth0 and Clerk
SchedulingRuns jobs on a timetableCron triggers and workflow services

The pieces communicate through events and APIs. A common pattern is an upload that triggers a function, which writes to a database and posts a message for the next step.

Serverless vs. containers and servers: what is the difference?

Comparing common ways to run code
OptionYou manageScalingFits best
Virtual machinesOS, runtime, scaling, patchesManual or scriptedLegacy systems and special software
Containers on a clusterImages, orchestration, cluster settings. See KubernetesConfiguredLong-running services with steady load
Managed containersImages and service settingsMostly automaticA middle path with less operations
Serverless functionsCode and triggersAutomaticSpiky, event-driven or low-traffic workloads

Neither model wins everywhere. Steady, heavy, predictable traffic can cost less on containers, and long-running or specialized workloads fit them better. See the serverless vs. containers comparison for a deeper look.

What are examples of serverless use?

  • A web or mobile app back end that serves API requests and scales with users.
  • Image or document processing triggered by each upload.
  • Scheduled jobs such as nightly reports, data syncs and clean-ups.
  • Webhook receivers that accept events from payment, shipping or CRM systems.
  • Chat and AI features that call a model provider and return the result. See LLM integration.
  • Lightweight data pipelines that react to new data.
  • Workflow automation steps that connect business tools.

Serverless also suits prototypes and early products, where traffic is unknown and a low starting cost matters. Many teams start there and move specific parts elsewhere if they outgrow it.

What are the downsides and limits of serverless?

Common trade-offs and how to handle them
IssueWhat it meansHow to handle it
Cold startsA new instance takes extra time to start after idle periodsKeep functions small, choose lean runtimes, use warm or provisioned options where latency matters
Execution limitsTime, memory and payload sizes are cappedBreak long work into steps; use queues or workflow services
Vendor couplingTriggers and services differ by providerKeep business logic separate from provider glue code
Harder local testingCloud services are hard to reproduce locallyUse emulators, contract tests and a staging environment
Distributed debuggingA request crosses many small piecesAdd tracing and structured logs from the start. See observability
Cost surprisesHeavy, constant load or runaway loops can cost more than expectedSet budgets and alerts; estimate with real traffic
Connection limitsMany instances can overwhelm a databaseUse connection pooling or serverless-friendly databases

These are design topics, not reasons to avoid the model. They are the questions to settle during architecture, before code is written.

When is serverless not the right choice?

  • Long-running or stateful processes, such as streaming connections held open for hours.
  • Steady, high, predictable load where reserved capacity is cheaper.
  • Workloads that need specialized hardware or tight control of the runtime.
  • Systems with strict latency needs that cold starts would break.
  • Teams that must stay portable across clouds and cannot accept provider-specific services.
  • Existing monoliths where a rewrite offers little benefit. See monolith and rebuild vs. refactor.

A mixed design is common: serverless for event-driven edges and bursty work, containers or managed services for the steady core.

What design patterns work well in serverless systems?

Serverless pushes you toward small, event-driven pieces. A few patterns keep those pieces reliable, and most production systems use several of them together.

Common serverless patterns
PatternWhat it doesWhy it helps
Queue in front of workRequests are placed in a queue and processed at a steady paceAbsorbs spikes and protects downstream systems
Fan-out and fan-inOne event starts many parallel tasks and results are gatheredSpeeds up batch work
Idempotent handlersRunning the same event twice gives the same resultMakes retries safe
Dead-letter queueFailed messages are set aside for reviewStops one bad message blocking everything
Workflow orchestrationA managed workflow runs steps in order with retriesHandles work longer than one function may run
Backend for frontendA thin function layer shapes data for one clientKeeps the interface simple

Because events can arrive late, twice or out of order, assume they will and write handlers that cope. This habit prevents most hard-to-reproduce bugs in event-driven systems.

What are common serverless mistakes?

  • Putting a long job into one function and hitting the time limit, instead of splitting it with a queue or workflow.
  • Keeping state in memory and losing it when the instance is replaced.
  • Opening a new database connection for every call and exhausting the database.
  • Giving every function broad permissions rather than only what it needs.
  • Skipping tracing, then trying to follow a request across many functions by guessing.
  • Ignoring retries, so a repeated event charges a customer twice.
  • Leaving no budget alerts, so a loop or an attack runs up a bill unnoticed.
  • Splitting too finely, creating dozens of tiny functions that are hard to understand and deploy.

Most of these come from treating functions like small servers. Treat them as short, replaceable handlers for events, and the design follows.

How does serverless fit AI and automation work?

Serverless fits the glue around AI well: receiving a request, fetching context, calling a model provider, saving the result and notifying a user. Each step is short and triggered by an event. It scales with demand, so a quiet internal assistant costs little and a busy customer feature can still grow.

Watch the limits. Model calls can take longer than a typical function allows, and streaming responses need a platform that supports them. Long-running agent tasks and batch jobs are usually better as queued workers or managed workflows. For model costs, which often exceed compute costs, see the LLM pricing page and the AI cost optimization entry.

Automation tools and custom functions also work together. A no-code tool can handle simple steps while a small function handles logic that needs real code. The Zapier vs. custom integration comparison shows when to move from one to the other.

How do you know a serverless system is healthy?

  • Error rate and retry counts per function and per trigger.
  • Latency, including the share of requests affected by cold starts.
  • Throttling events, which show when limits are being hit.
  • Queue depth and age of the oldest message, which show whether work is keeping up.
  • Cost per request or per business event, tracked over time.
  • Database connection use and slow queries.

Set targets for the signals that matter to users, and alert when they are at risk. A service level objective gives the team a clear line between fine and not fine.

How do you adopt serverless?

  1. List the workloads and their traffic patterns, durations and latency needs.
  2. Pick candidates that are event-driven, short-lived and stateless.
  3. Choose a provider based on your existing cloud, team skills and data location. See AWS vs. Azure.
  4. Design for idempotency, so a retried event does not duplicate work.
  5. Define infrastructure as code so environments are repeatable. See infrastructure as code.
  6. Add logging, tracing, alerts and cost budgets before launch.
  7. Deploy through CI/CD with a rollback path.
  8. Review cost and performance after real traffic, and move parts if needed.

Security work still applies: least-privilege permissions for each function, secrets kept in a secrets manager and input validation on every trigger.

What does serverless mean for cost, timeline and how StackLift works?

Serverless lowers the cost of running quiet systems and shifts effort to architecture, testing and monitoring. The main drivers are the number of functions and integrations, data design, security needs, and the traffic pattern. Estimate it with real usage assumptions rather than a rule of thumb. See the cloud and DevOps cost page, the web application cost page and the free estimate.

StackLift chooses the runtime model during architect-reviewed scoping, based on your workload and not on fashion. CI/CD, observability, security review and rollback are part of the plan from sprint one, and agents work on feature branches without touching production secrets. Clients can follow releases and project state in the client portal.

Questions people ask

Does serverless mean there are no servers?

No. Servers exist, but the cloud provider runs them. You deploy code and the platform handles provisioning, patching and scaling.

Is serverless cheaper than servers?

Often for spiky or low-traffic workloads, since you pay for use. For steady, heavy traffic, containers or reserved capacity can cost less. Estimate with your own traffic.

What is a cold start?

It is the extra delay when a platform starts a new instance of your function after a quiet period. Small packages, lean runtimes and warm or provisioned options reduce it.

Can I build a whole application serverless?

Yes, many applications run on functions plus managed databases, queues and storage. Some parts, such as long-running jobs, may still fit better elsewhere.

What is the difference between serverless and microservices?

Microservices describe how you split an application into services. Serverless describes how those services are run. You can have either without the other, or both together.

Is serverless secure?

The provider secures the underlying platform. You remain responsible for your code, permissions, secrets and data. Give each function the narrowest access it needs.

Will I be locked in to one provider?

Some coupling is unavoidable, because triggers and managed services differ. Keep business logic separate from provider-specific code to make a move less painful.

Is serverless good for AI features?

It suits calling model APIs, handling webhooks and running short pipelines. Long-running jobs, heavy local inference and large batch work usually need other compute.

Sources

Sources and further reading

The standards, rules, research and official documentation this page draws on.