Design a Configuration Management System
Understanding the Problem
⚙️ What is a configuration management system? It's a central service that holds the settings running software reads at runtime: timeouts, connection pool sizes, endpoint URLs, thresholds, kill switches. Engineers change values in one place, and every service instance that uses them picks up the change in seconds, without a redeploy. Open-source examples include Apollo, Consul's KV store and Spring Cloud Config; AWS AppConfig is a managed one.
This is close to a feature flag system (see /system-design/feature-flags), and you can reuse a lot between the two. The difference is the shape of the data and who reads it. Feature flags answer "is this on for this user?" millions of times a second. Configuration answers "what is the value of this setting?" for a service, and the hard part is distributing changes to a large fleet quickly and safely, not evaluating rules.
Functional Requirements
Core Requirements
- Users (engineers) should be able to add, update and delete configuration entries, grouped by service and environment.
- Users should be able to search configuration by key, service, and value text.
- Services should be able to read their configuration at startup and subscribe to changes, receiving updates within seconds.
- Users should be able to see every change to a config (who, when, what) and roll back to an earlier version.
Below the line (out of scope)
- Secrets (passwords, API keys). They need encryption, access audit and rotation, and belong in a dedicated secret store like Vault. Config can hold a reference to a secret.
- Per-user targeting and percentage rollouts of features. That's the feature flag system.
- Infrastructure provisioning (Terraform, Ansible). "Configuration management" sometimes means that; here it means runtime application config.
Non-Functional Requirements
Ask your interviewer about fleet size and how fast changes need to land. We'll assume a large company: 5,000 services, 100,000 running instances across three regions, and about 1 million config entries in total.
Core Requirements
- The system should deliver a change to every subscribed instance within 5 seconds (p99).
- Reads must be highly available. A service must be able to start and keep running even when the config system is down.
- Writes should be strongly consistent: no lost updates when two people edit the same config, and subscribers should never see versions go backwards.
- Related changes should be able to land atomically: if you change a host and a port together, no instance should see the new host with the old port.
Below the line (out of scope)
- Very high write throughput. Humans and deploy pipelines write config, so peak writes are in the tens per second.
- Large values. Config entries are small; blobs like ML models go in object storage.
Do the math.
Data size: 1M entries × about 1 KB average (key, value, metadata) is 1 GB. Even with full history, this fits comfortably in one Postgres database. Storage is not the problem.
Reads at startup: a big deploy restarts thousands of instances in a few minutes. If each fetches its service's config (say 200 entries, 200 KB), that's a burst of a few thousand requests per second. Easy, especially with caching.
Propagation: this is where the design lives. One change to a widely shared config (a common database endpoint, a global rate limit) might be watched by all 100,000 instances. How do they find out?
- If every instance polls every second, that's 100,000 requests per second, nearly all of them returning "nothing changed." Polling every 30 seconds cuts that to about 3,300/s but blows our 5-second target.
- If every instance holds one open connection that the server answers only when something changes, that's 100,000 mostly idle connections. A single server can hold tens of thousands, so a few dozen servers cover it with room for failures.
The question is really about fan-out. Storage is small, writes are rare, and the entire challenge is telling 100,000 processes about a change, fast, without the system becoming a dependency they can't live without.