NEVO
All notes
System design

Keep configuration at the edges

3 minute read

A small boundary between configuration and application code makes change easier to understand.

Configuration begins as a convenient escape hatch: a URL here, a timeout there, a feature flag beside a function. Over time, those small decisions can spread throughout a codebase. A deployment change then requires knowing which parts of the application read which values, and when.

Read once, validate early

Load configuration near the entry point. Convert strings into the types the application expects, check required values, and report errors before accepting work. A missing endpoint is easier to diagnose at startup than halfway through a user request.

Pass a small, validated object into the part of the application that needs it. Code that processes an invoice should not also know how an environment variable is named.

Choose a clear owner

Each setting needs an owner and a purpose. A timeout belongs to the boundary where waiting occurs. A limit belongs near the resource it protects. Repeating a setting in several modules creates the possibility that each copy will drift.

Defaults should be intentional. A default that is useful for a local development session may be inappropriate in a deployed service. Make that distinction visible instead of relying on an undocumented naming convention.

Keep secrets out of the view

A configuration summary can help an operator understand a running service. It should describe what is enabled without printing credentials. Log that a credential was loaded, not the credential itself.

Apply the same care to diagnostics, exception messages, test snapshots, and support bundles. Data often escapes through convenience features rather than the code that handles it directly.

Make changes observable

If configuration can reload, document which settings take effect immediately and which require a restart. Expose a non-sensitive version identifier so an operator can tell which configuration is active.

The benefit is a smaller mental model. Application code works with meaningful values; deployment code owns where those values come from. Each can change without quietly changing the responsibilities of the other.


Explore the notebook