Three Environments

Development is your machine, where things are fast and forgiving.

Staging is as close to production as you can afford, and exists to be the place where a mistake is cheap.

Production is where people are.

The closer staging is to production, the more it is worth. A staging environment with different settings and a tiny database will not catch what production will, and gives a false sense of having checked.

The same artefact should move between them. Build once, deploy that same thing everywhere, with configuration supplied per environment. Building separately per environment means the thing you tested is not the thing you shipped, and that gap is where a whole class of confusing incidents lives.

Configuration comes from the environment, never from a conditional. Not if DEBUG deciding production behavior, and never a settings file committed with production values in it.

A missing variable should fail loudly at startup rather than defaulting to something. A default that silently makes production behave like development is worse than a crash, because a crash you notice.

Mark this lesson complete

Signed in, your progress follows you to every device.

Next: Secrets and Containers →
← Back