KatInterview

Build a Real-Time Configuration Management System

System DesignModel answer
HardModel answerSystem Designdistributed-systemsreal-timepub-sub

Last updated

Design a service that stores configuration data and notifies subscribed clients when values change, covering APIs, consistency, scaling, and failure handling.

You need to architect a configuration management system that serves application settings and alerts connected clients whenever configurations are modified.

Your system should support:

  • Storing and retrieving configuration key-value pairs
  • Allowing clients to watch specific keys or entire prefixes (e.g., database/*)
  • Sending updates to watchers immediately when values change
  • Handling thousands of concurrent client connections

Design the complete system including:

  1. API surface: What methods do clients use? What about bulk operations?
  2. Update delivery: How do you guarantee subscribers receive changes? What about ordering and duplicates?
  3. Consistency model: How do you handle concurrent writes, versioning, and the ability to revert changes?
  4. Failure scenarios: What happens when connections drop, servers crash, or callbacks fail?
  5. Scalability: How does your design handle 10,000+ clients subscribing to overlapping key prefixes?
  6. Performance analysis: What are the time and space complexities of critical operations?

Be specific about trade-offs, implementation details, and how you'd validate correctness.

Hints

Hint 1

Think about how a monotonically increasing version number can solve multiple problems at once: ordering, deduplication, and resumption after reconnects

Hint 2

Separate the consensus layer (small, strongly consistent) from the notification layer (horizontally scalable, eventually consistent) to handle large fan-out

Hint 3

Client SDKs should cache config locally and persist to disk so applications can start even when the config service is unavailable