Choosing hosting as a developer

Four levels. Take the lowest one that runs your project, and revisit only when it stops.

Hosting decisions get made by tier and price. The useful question is what has to execute when a request arrives.

Four hosting levels with what each runs and what each requires.
Four hosting levels with what each runs and what each requires.

The four levels

Static files. Nothing executes. The server returns a file. Frequently free, extremely fast, effectively unbreakable, no maintenance.

Static plus functions. Mostly files, with short server-side handlers for the few things that need one. Scales to zero, no machine to manage.

Managed container runtime. Your application runs continuously. You supply the image; the platform handles the machine, the certificates and the scaling.

A machine you administer. Complete control, and you own the operating system, the patching and the monitoring for as long as it exists.

Level Runs You maintain
Static Nothing Nothing
Functions Short handlers Your code
Container An application Image and dependencies
Machine Anything The whole system

Default to the lowest that works

Most projects presented as needing a server do not.

A documentation site, a marketing site, a portfolio, a dashboard over data known at build time, a tool that runs in the browser. All static, all free, all with nothing to patch.

Moving up a level later is straightforward, because the content and the code are unchanged. Moving down after building against a machine effectively never happens, because assumptions about a persistent filesystem and long-running state spread through the code.

Where functions fit

Short, stateless work.

A form handler, a webhook receiver, an endpoint that signs an upload, a small API putting a key in front of a third-party service so it is not in the page.

They start on demand and cost nothing when idle. The constraint is execution time and the absence of local state, which is exactly the constraint that keeps the design clean.

Signals that a project needs to move up a level.
Signals that a project needs to move up a level.

Signals to move up

To functions: you need a secret that cannot be in the page, or a form that must reach something other than a mail service.

To a container: the application has to run continuously, holds connections, or has a startup cost you cannot pay per request.

To a machine: something must run on a schedule at the system level, a process must stay alive holding state, or the software expects to own the system.

Anything short of those signals is a level you are paying for and maintaining without needing it.

The cost that is not on the invoice

Maintenance, and it only grows.

A static site left alone for three years still works. A machine left alone for three years is a liability with known vulnerabilities, and somebody has to care about it every month in between.

Count that before choosing the level that gives you the most control.

Closely related: How to host a website, and Should you host a site yourself? for the adjacent problem.

Put it at an address

Write down what has to execute at request time, default to static, add functions for short stateless work, take a container for a real application, and take a machine only when something genuinely requires one.

Questions people ask

What are the levels?

Static files, static plus functions, a managed container runtime, and a machine you administer. Each adds capability and maintenance.

Which should I default to?

The lowest that runs the project. Moving up later is straightforward; moving down after building against a machine rarely happens.

When are functions enough?

When the server-side work is short and stateless: a form handler, a webhook, a small API in front of a service.

When do I need a real machine?

Long-running processes, scheduled work, anything holding state in memory, or software that expects to own the system.

What is the hidden cost at each level?

Maintenance. A static site needs none. A machine needs patching indefinitely, and that obligation does not pause.

Keep reading