Serverless
Definition
Serverless describes running code as individual functions, each attached to a trigger, with provisioning and scaling handled by the provider. AWS Lambda, Google Cloud Functions and Azure Functions are the established examples; Cloudflare Workers belongs to the same family but runs at the network edge, and is closer to an edge function than to a classic Lambda. Billing is per invocation plus execution time, usually measured to the millisecond, with nothing charged while nothing runs. The trade is control: you accept a ceiling on execution time — often 15 minutes, sometimes far less — along with memory limits, package size limits and a delay while a cold instance starts. The name is marketing shorthand and mildly dishonest, since servers are very much involved and somebody still has to reason about concurrency, timeouts and where state lives.
Why It Matters
The genuine case for serverless is uneven load. A form handler taking 200 submissions a month costs pennies as a function and a few pounds a month as the smallest always-on virtual machine, and it absorbs a freak 10,000-submission day without anyone resizing anything. The genuine case against is steady traffic and latency floors: a service under constant load is usually cheaper on a reserved machine, and a cold start of 200 to 800 milliseconds sits badly in the critical path of a page render. Lock-in is a real cost too — triggers, logging and permissions all differ by provider, so moving a function between clouds is rarely a copy and paste.
How It Works
A trigger arrives: an HTTP request, a queue message, a scheduled timer, a file landing in a bucket. The platform looks for a warm instance of your function and passes the event straight in if it finds one. If it does not, it fetches your deployment package, starts a runtime, runs the initialisation code at the top of your file and only then calls the handler — that gap is the cold start. In most runtimes an instance handles one event at a time, so 100 simultaneous requests can mean 100 instances, which is what automatic scaling actually means. Instances stay warm for a few minutes and are then thrown away, so anything written to local disk or held in a module-level variable may or may not still be there next time; durable state belongs in a database or in object storage. Because no process outlives the response, a function cannot hold a connection open or carry on working after it has replied.
Real-World Example
A small team publishes its product documentation as a static site on 99helpers at meridian-docs.99helpers.site, where nothing needs to execute at all — the pages are files and the platform serves them. The one dynamic piece is a feedback box, so they write a 40-line function on a serverless platform that takes the message and posts it to a Slack channel, and the page calls it with fetch. At a few hundred submissions a month the bill for that function is under a pound. The split is the useful pattern: everything that can be a file stays a file, and only the part that genuinely has to run is code.
Common Mistakes
- ✕Using a function to serve static files — it is slower and dearer than a cache doing the same job, and it can fail in ways a file cannot
- ✕Keeping state in a module-level variable — it survives some invocations and not others, producing bugs that only appear under load
- ✕Leaving cold starts until launch week — the first request after a quiet spell is the slow one, and that is the request a new visitor makes
- ✕Reading per-millisecond billing as cheap at any volume — past a certain steady load a reserved machine costs less, often by a lot
Related Terms
Edge Function
A small piece of code that runs on a delivery network's own nodes, near the visitor, rather than at one central server. It suits redirects, headers and routing decisions — not heavy work.
Static Site
A static site is a website made of finished files — HTML, CSS, JavaScript, images — that are sent to the browser exactly as they are stored. Nothing is assembled on the server when a visitor arrives.
Static Hosting
Static hosting is a service that stores a folder of finished web files and serves them over HTTP, without running any application code of yours. You upload the folder; the host answers requests for the files in it.
Jamstack
Jamstack is an approach to building websites where pages are generated ahead of time and served as static files, and anything dynamic is added afterwards by JavaScript calling APIs. The initials stand for JavaScript, APIs and Markup.
Latency
Latency is the delay between sending something and it arriving — usually quoted as round-trip time, the milliseconds for a packet to reach a server and come back. It is a separate thing from bandwidth, which is how much data fits through per second once the first packet lands.
Put a file online in seconds
Drop in a document, an image, a page or a whole static website and share the link — free, with no build step and no server to set up.
Host a file free →