Development, staging and production.
WHAT SHOULD DIFFER
Credentials Endpoints Debug and logging settings Scale
WHAT SHOULD NOT
The code Runtime versions Dependency versions
WHY
Differences produce failures that appear only in production.
WHAT COMMONLY DIFFERS UNINTENTIONALLY
Runtime version Filename case sensitivity Available extensions Time zone
WHAT TO DO ABOUT THAT
Pin versions and use the same setup process everywhere.
WHERE TO PUT CONFIGURATION
Environment variables, or a file excluded from version control.
WHAT TO COMMIT
An example listing every required value.
WHAT TO DO AT STARTUP
Validate that required values are present, and fail clearly if not.
WHY
Failing immediately with a clear message beats failing obscurely later.
WHAT TO REMEMBER ABOUT CACHED CONFIGURATION
It does not re-read its source.
WHAT THAT CAUSES
Changes appearing not to take effect.
WHAT TO DO
Rebuild caches as part of every deployment.