InfrastructureLesson 1 of 46 min

Your laptop is already a server

The word means less than you think, which is good news.

When you run a dev command and open localhost, you have started a server. A program is sitting there listening on a port, waiting for requests, and answering them. A production server is the same program with three differences: it runs on a machine that is always on, it is reachable by strangers, and it does not stop when you close your laptop.

A port is how one machine runs several servers at once. The address gets you to the machine; the port gets you to the right program on it. That is all a port is, and it is why you can run a web app on 3000 and a database on 5432 without them colliding.

What to remember

  • A server is a running program, not a piece of hardware.
  • Ports let one machine host many servers.
  • Local and production differ in specific, enumerable ways.

Terms in this lesson

Field notes

Loaded from a deliberately slow source. The lesson above was already readable while this was still travelling. That is streaming, and it is the same trick a chat interface uses.

The digest that stopped for five weeks

A weekly email job silently stopped running after an infrastructure change. Nobody noticed, because a job that does not run produces no error. It was discovered when a customer asked whether they had been unsubscribed.

Why you alert on missing success

Everyone retried at once

A service had a brief wobble. Every client retried immediately, then again, then again. The retries were far more traffic than the original load, and the service never got a quiet moment to recover. The outage lasted forty minutes longer than the fault did.

The thundering herd

resolved in 900ms · region iad1

Hide field notes toggles a search param the loader reads. With it off, the slow promise is never created, so nothing streams.