Interview Prep Zoneby CuriouserLabs

Question 5 of 5 · architect level

Config at scale: centralized config, feature flags, and runtime changes — how do you keep 50 services sane?

🎤 Say this first

Separate three concerns that teams conflate: environment config (per-deploy values — platform-injected, changes via redeploy), centralized/shared config (org-wide policies — config server/GitOps repo with review + audit), and feature flags (runtime toggles with targeting — a flag service like OpenFeature-backed tooling, not Spring profiles). Runtime mutability is a liability budget: every hot-reloadable property is a state your running fleet can be in that git doesn't show — keep the hot set tiny, audited, and observable (a config-version gauge in metrics).

The full picture

  • GitOps beats config-server-as-database: config changes as PRs (review, diff, rollback, blame) flowing through the same promotion pipeline as code; Spring Cloud Config or ConfigMap re-render both work as transports — the workflow is the architecture.
  • Refresh mechanics if you need them: @RefreshScope beans re-created on /actuator/refresh or bus events — but each refreshable bean is a mini restart with edge cases (in-flight requests, pool rebuilds). Prefer restart-on-change (rolling, fast) unless SLOs truly demand hot reload.
  • Flags discipline: flags are code-path config with an owner and an expiry — stale flags are dead code with runtime branching cost. Track age; make cleanup a sprint ritual. Targeting/gradual rollout (1% → 100%) is the real value over properties.
  • Schema for config: shared starters export typed @ConfigurationProperties so 'org standard settings' have one definition, validated in every service — the type system as fleet-wide config linting.
  • Observability: log the resolved config fingerprint at startup; alert on staging/prod divergence beyond the allowlist. 'What config is service X actually running?' must be answerable in one query.

🔄 Likely follow-up questions

  • Design the failure mode: config server is down and a pod restarts — what happens?
  • How do you canary a config change that isn't attached to a code deploy?
  • What belongs in a flag vs a property vs a deploy — give your decision table.