Skip to content

Framework: settings are configuration, many-instance things are code

Accepted. The first reading of the ruling went too far and was partly reversed the same day.

2026-10-14 (owner ruling, clarified the same day).

The framework originally configured nearly everything by key: lock stores, secret stores, named HTTP clients with their retry and authentication, and rate limiters, each chosen by a driver: key. That made the set of instances a deployment fact. Two problems followed. A rate limiter or an HTTP client’s retry policy is part of how the code behaves, so changing it in one environment gives code that is untested in that shape. And a driver key meant a registry of drivers, which is indirection the compiler cannot check.

The owner’s rule was: the settings of services and connections are fine as configuration; do not use configuration to define pollers or anything that can have many instances.

An over-reading moved every behavioural key to code, including the shutdown drain, the HTTP server limits and database pool sizes. That produced two ways to set one thing, because deployments still needed to tune those values.

Apply a test: could an application want several of these, with different values?

  • If yes, it is code. Each instance is named and built where it is used, with its policy as a typed value that validates itself. This covers rate limiters, background loops and pollers, lock stores, secret stores and named HTTP clients, including their retry, authentication, caching, timeout and size policies. The choice of driver is the factory (for example memory, database or Redis locks).
  • If it is one setting of the service or of a connection, it is configuration: declared once with a default and a checked range, varied per deployment. This covers the drain time, health policy, metrics driver, HTTP server limits, database and Redis instances with pool sizes, the platform address and secrets.
  • There is no driver: key and no driver registry. Connections that are instances in configuration (database, Redis) are built under <section>.instances with one factory.
  • Start-up checks keep this honest: a key that was removed fails start-up and names where it moved, a misspelt key under a claimed section fails listing the valid keys, and out-of-range values are start-up problems, not silent corrections.

Good:

  • Tuning stays in configuration. The shape of the application (which limiters and clients exist) is the same in every environment.
  • No container or driver registry, so wiring is checked by the compiler.
  • Mistakes in configuration fail at start-up with the key named.

Bad:

  • Changing a retry policy or a limiter needs a code change and a release.
  • Migrating from the earlier keys needed a one-time change in applications.
  • The line is a judgement call; the decision test is the only guide for new capabilities.
Alternative Why not
Everything in configuration The set of instances varies per deployment and is untestable.
Everything in code Every deployment needs to vary pools, timeouts and limits; two ways to set one value. This was tried and reversed.
A declarative wiring container Reflection and run-time failure where the compiler could help.