MentorNode
Start free
Platform & InfrastructureMediumdesign-feature-flag-service

Design a Feature Flag & Config Service

Design runtime configuration that changes behaviour in seconds without a deploy — evaluated locally at nanosecond cost, and safe when the config service is unreachable.

Local EvaluationStreaming Config PushPercentage RolloutFail-Static
Traffic & Capacity Estimates:

10k flag evaluations/second per service instance · 5k instances · propagation under 5s

Functional Requirements

  • •Evaluate boolean, multivariate, and numeric flags against user and request context.
  • •Support targeting rules, percentage rollouts, and sticky bucketing by user ID.
  • •Push rule changes to every running instance within seconds.
  • •Record evaluation exposure for experiment analysis and flag cleanup.

Non-Functional Requirements

  • •Evaluation must be in-process and sub-microsecond — never a network call on the request path.
  • •If the config service is down, instances keep serving the last known ruleset (fail-static).
  • •A bad rule must be revertible in seconds — this is the emergency brake for everything else.

Back-of-the-Envelope Math

  • 10k evals/s * 5k instances = 50M evaluations/second fleet-wide, which only works because it's local.
  • Exposure events at even 1% sampling are 500k events/second into the analytics pipeline.

Key Architectural Trade-offs

  • Local evaluation with a streamed ruleset is fast and means every instance holds a slightly different view for a few seconds; remote evaluation is consistent and puts a network hop on the hot path.
  • Sticky bucketing by a hash of user ID keeps a user's experience stable across sessions without storing per-user assignments.
  • Fail-static is the right default and means a stale ruleset can persist silently — staleness needs its own alert.

Click or drag a component onto the canvas, then connect the handles to draw the data flow.

3 nodes · 2 edges

Components · 35

Client & Edge4
Compute & Gateway7
Storage & Caching11
Messaging & Streaming6
Coordination & Ops5
Intelligence2
Canvas overview