Flags are dynamic and targeted; configs are static. Each has a place.
Evaluation Timing
- Build-time
- Startup-time
- Request-time
Risk Surface
- Blast radius
- Rollback time
- Observability
When to Use Flags vs Config
- User‑facing behavior changes → flags
- Static infra values → config
- Emergency toggles → flags
Targeting & Segments
- Internal users
- Beta cohorts
- Regions & plans
- Device classes
Checklist & FAQ
- Typed accessors in code
- Single source of truth for flag definitions
- Owner and removal date tracked
- FAQ: Can flags replace env vars? Use flags for runtime targeting; env vars for static config.
Conclusion
Use flags when behavior must change by user or cohort without redeploys; use config for static settings.
