Design a Feature Flag Service
MediumSystem design · Developer Platform
Design a feature flag platform: product teams define boolean and multivariate flags with targeting rules (user attributes, segments, percentage rollouts, environments), and applications evaluate flags at runtime. About 5K flags, 50M evaluations/s across the fleet, rule changes visible within 10 seconds, and applications must keep working when the flag service is down. Cover SDK evaluation, rule distribution, deterministic bucketing, kill-switch reliability, auditing, and exposure logging.
Requirements
- Evaluation must not require a network call and must fall back safely to a default when rules are unavailable
- Percentage rollouts are deterministic per user and stable as the percentage grows
- Flag changes are audited and high-risk changes can require approval or staged rollout
- Log which variant each user actually saw so experiments can be analysed