Designing Configuration Management
1. Designing Centralized Configuration
| Tool | Detail |
|---|---|
| Spring Cloud Config | Git-backed, refresh endpoints |
| Consul KV / etcd | K/V store |
| AWS AppConfig / Parameter Store | Managed |
| HashiCorp Vault | Secrets + dynamic config |
| K8s ConfigMap | Native |
2. Designing Environment-Specific Configuration
| Practice | Detail |
|---|---|
| Per-env file | dev.yml, stage.yml, prod.yml |
| 12-factor | Config in env vars |
| Same artifact | Build once, configure per env |
| Secrets separation | Never in image / repo |
3. Designing Feature Flag Architecture
| Type | Use |
|---|---|
| Release | Hide unfinished features |
| Experiment | A/B variants |
| Ops kill switch | Disable in incident |
| Permission | Per-tenant entitlements |
| Tools | LaunchDarkly, Unleash, Flagsmith, GrowthBook, OpenFeature |
4. Designing Dynamic Configuration Updates
| Mechanism | Detail |
|---|---|
| Polling | Simple; latency in seconds |
| Long-poll / SSE | Near-real-time |
| Pub/sub push | Lowest latency |
| Local cache | Fail-open with last-known config |
5. Designing Configuration Versioning
| Practice | Detail |
|---|---|
| Git-backed | History, PR review |
| Immutable versions | Tag each release |
| Config diffs in PR | Reviewable |
| Pin per env | Promote between envs |
6. Designing Secret Configuration Separation
| Practice | Detail |
|---|---|
| Vault for secrets | Config store for non-secret |
| Reference, not value | app reads "vault://..." |
| Auto-rotate | Short-lived dynamic secrets |
| Audit access | Who fetched which secret |
7. Designing Configuration Validation
| Approach | Detail |
|---|---|
| Schema check | JSON Schema, Cue, OPA |
| CI gate | Reject malformed PRs |
| App startup check | Fail-fast on bad config |
| Canary deploy | Catch runtime issues |
8. Designing Configuration Rollback
| Strategy | Detail |
|---|---|
| Versioned store | Revert to previous version |
| Auto-rollback | On health check fail post-deploy |
| Kill switch | Flip flag to off |
| Stage gates | Roll out 1% → 10% → 100% |
9. Designing Configuration Auditing
| Field | Detail |
|---|---|
| Who | User / system |
| What | Key, old value, new value |
| When | Timestamp |
| Why | Ticket / PR link |
| Approval | For sensitive changes |
10. Designing Configuration Inheritance
| Layer | Detail |
|---|---|
| Defaults | Baked into app |
| Org / global | Overrides defaults |
| Env | Overrides org |
| Service / instance | Most specific wins |
| User / tenant | For per-tenant overrides |
11. Designing A/B Testing Configuration
| Element | Detail |
|---|---|
| Targeting rules | By user attrs / segments |
| Allocation | % per variant; sticky bucketing |
| Sticky assignment | Same user → same variant |
| Holdout | Excluded from all experiments |
12. Designing Hot Configuration Reloading
| Practice | Detail |
|---|---|
| Atomic swap | Build new config, swap pointer |
| No restart | Avoid connection churn |
| Listener pattern | Subscribers react to changes |
| Validate before apply | Reject bad reload |
| Spring @RefreshScope / Actuator | Built-in support |