Design a service to define boolean and multivariate flags, target segments (percentage rollout, user lists, attributes), and serve evaluations with low latency. SDKs cache rules; server tracks impression events optionally for analytics.
Functional requirements
- CRUD flag definitions and rollout rules
- Evaluate flag for a given user/context with deterministic percentage bucketing
- Instant kill-switch to disable a feature globally
- Audit who changed rules and when
Non-functional requirements
- Very low latency evaluation on hot paths (local cache + streaming updates)
- High availability so flags do not take down apps when degraded
- Safe defaults when the service is unreachable