Table of Contents
Serverless computing is one of those terms that gets stretched so far it starts to lose meaning. The short version: it’s a model where you deploy code and the cloud provider handles everything underneath it. Scaling, patching, load balancing, idle capacity. You never pick a server size or count instances, because you never see a server.
There are servers involved, obviously. Hundreds of them, probably, spread across multiple data centres. What’s missing is you. No operating system patches at 2am, no capacity planning spreadsheet, no frantic rush to spin up extra boxes before a product launch. You write a function, attach a trigger, and the platform runs it when something happens.
How Serverless Computing Actually Works
Most serverless platforms are functions-as-a-service, or FaaS. AWS Lambda, Azure Functions, Google Cloud Functions and Cloudflare Workers all follow the same pattern. You upload a handler written in Node, Python, Go, Java or .NET, and the provider keeps it in storage until it’s needed.
When a request arrives, the platform boots a sandbox, loads your code, runs it, and returns the result. A second request arriving at the same moment gets its own sandbox. Ten thousand simultaneous requests means ten thousand sandboxes running in parallel, and you configured exactly none of it.
Triggers are the whole point
Functions don’t normally sit listening on a port. They react to events, and that wiring is where most of the design work lives:
- An HTTP request arriving at an API Gateway route
- A file landing in an S3 or Cloud Storage bucket
- A message showing up on a queue like SQS or Pub/Sub
- A row changing in a database, such as DynamoDB Streams
- A cron-style schedule firing every five minutes
- Another function calling it directly
Once you start thinking in events rather than endpoints, whole categories of glue code disappear. No polling loop checking whether a file has arrived. The file arrives, the function runs.
What Serverless Costs, and What It Doesn’t
Billing is the part that surprises people. A virtual machine bills by the hour whether or not your code does anything useful. Serverless bills per execution: AWS Lambda charges about $0.20 per million requests plus roughly $0.0000167 per GB-second of compute. The free tier covers a million requests and 400,000 GB-seconds a month, comfortably more than most side projects will ever touch.
Do the arithmetic on a realistic case. A function using 512MB of memory that finishes in 200 milliseconds costs a fraction of a cent per thousand calls. The same workload on a $30-a-month server is a bargain if it runs constantly and a waste if it runs twice a day. Idle time is free on serverless, and that flips the economics for spiky or low-volume traffic.
If the underlying layers still feel hazy, this explainer on cloud and cloud computing covers the virtualisation, regions and shared-responsibility model that serverless sits on top of.
Serverless vs. Containers vs. Virtual Machines
- Virtual machines: you rent an entire operating system. Total control, total responsibility, and the meter runs whether the app is busy or asleep.
- Containers: you package the app plus its dependencies and an orchestrator schedules it. Still needs a cluster somewhere, and clusters cost money when they’re quiet.
- Serverless functions: you package a handler. No cluster, no idle bill, but firm limits on runtime, memory and disk.
Those limits matter. Lambda stops a function at 15 minutes and caps memory at 10GB. Cloudflare Workers measures CPU time in milliseconds, not minutes. Google’s Cloud Run sits in between, letting you run a container that scales to zero but behaves more like a normal app. The constraints aren’t arbitrary; they’re what makes fast, aggressive scaling possible in the first place.
Where Serverless Earns Its Keep
Image pipelines are the textbook example for good reason. Someone uploads a 12MB photo, a bucket event fires, and a function generates three thumbnails in different sizes and writes them back. That workload is bursty, short-lived and completely pointless to run on a dedicated server most of the day.
Other places it fits naturally: Stripe or GitHub webhook handlers that need to verify a signature and push a message onto a queue, scheduled jobs that clean up stale records at 3am, and API backends behind a launch that goes from zero to 50,000 users in an afternoon. A ticketing site selling out a concert in 90 seconds is exactly the shape of traffic serverless was designed for.
Internal tools are an underrated fit too. A script that six people use twice a week costs nothing to host, because between those uses it genuinely doesn’t exist.
The Parts Nobody Warns You About
Cold starts are real
A function that hasn’t run recently needs its sandbox created and its runtime initialised. For a small Node or Python handler that’s tens to a few hundred milliseconds. For a JVM or .NET function with a fat dependency tree, it can stretch into seconds. Provisioned concurrency fixes it and costs money, which somewhat defeats the point.
Lock-in creeps up on you
Lambda itself is fairly portable. The event sources, IAM policies, Step Functions definitions and managed queues around it are not. Teams that go deep on one provider tend to stay there, which is fine as long as it’s a decision rather than an accident. If you’re evaluating AWS specifically, this practical guide to AWS cloud computing walks through the services you’ll end up touching. Keeping business logic in plain libraries and writing thin adapters at the edges buys you most of the optionality back.
Debugging gets harder
There’s no box to SSH into and no process to attach a debugger to. A single user action might touch five functions, two queues and a database stream. Distributed tracing stops being a nice-to-have and becomes the only way to understand what happened. Structured logs with a correlation ID on every invocation will save you an entire weekend at some point.
When Serverless Is the Wrong Tool
Steady, predictable, high-volume load is the clearest case against it. If a function is busy all day every day, you’re paying a healthy premium for elasticity you never use, and a reserved instance or a couple of containers will be dramatically cheaper.
Long-running work doesn’t fit either. Video encoding, model training, big data exports, anything that needs more than fifteen minutes or a warm database connection pool. Stateful services with persistent websockets are another rough patch, though platforms like Durable Objects are steadily eroding that limitation. Latency-critical paths where a 300ms cold start would lose a customer also deserve scepticism.
Starting Without Setting Money on Fire
Pick one platform and learn its limits properly before spreading bets. Google’s offering is worth a look too, and this guide to Google Cloud’s services and pricing covers where Cloud Functions and Cloud Run fit against the rest of GCP. From there, a few habits keep things sane:
- Keep handlers small and single-purpose. A 900-line function is a monolith with extra steps.
- Set a reserved concurrency limit so a runaway loop can’t bill you into next quarter.
- Add budget alerts on day one, not after the first surprise invoice.
- Understand retry behaviour, because queue-triggered functions can and will run twice.
- Define infrastructure as code from the start. Clicking through a console works until it doesn’t.
The mental shift is smaller than it sounds. You stop asking how many servers you need and start asking which events matter, what should happen when they fire, and what happens if that function runs twice. Answer those three questions well and serverless stops being a buzzword and becomes just another tool you reach for when the shape of the problem fits.


