Docs / Raw

System Settings vs Feature Flags

Sourced from docs/admin-guide/system-settings-vs-flags.md

Edit on GitHub

System Settings vs Feature Flags

Overview

VoiceAssist uses two mechanisms for runtime configuration:

  • System Settings: Permanent configuration values
  • Feature Flags: Temporary toggles for features in development/testing

When to Use Each

Use System Settings For

ScenarioExample
Configuration valuesAPI_TIMEOUT=30000
Resource limitsMAX_UPLOAD_SIZE=10MB
Integration endpointsOPENAI_API_URL=...
Default behaviorsDEFAULT_LANGUAGE=en
Permanent togglesENABLE_ANALYTICS=true

Use Feature Flags For

ScenarioExample
New features in developmentui.new_voice_panel
A/B experimentsexperiment.pricing_v2
Gradual rolloutsbackend.rag_v2 at 25%
Kill switchesops.disable_heavy_features
Time-limited featuresops.holiday_mode

Key Differences

AspectSystem SettingsFeature Flags
LifespanPermanentTemporary (remove after rollout)
ChangesRequire deploymentRuntime, no deployment
AudienceAll usersCan target segments
RollbackRedeployInstant toggle
StorageEnvironment variablesRedis
UIConfig filesAdmin Panel

Decision Tree

Is this configuration permanent?
├── Yes → System Setting
└── No → Is it a feature toggle?
    ├── Yes → Feature Flag
    └── No → Is it user-specific?
        ├── Yes → User Preferences
        └── No → System Setting

Examples

System Settings (Correct)

# .env DATABASE_URL=postgres://... REDIS_URL=redis://... OPENAI_API_KEY=sk-... MAX_CONVERSATION_LENGTH=100 DEFAULT_TTS_VOICE=alloy

Feature Flags (Correct)

// Using category.feature_name pattern ui: { new_chat_layout: { name: 'ui.new_chat_layout', type: 'boolean', defaultEnabled: false, description: 'New chat layout with sidebar' } }, experiment: { voice_v2: { name: 'experiment.voice_v2', type: 'percentage', percentage: 25, description: 'Testing new voice synthesis' } }

Anti-Patterns

// BAD: Using feature flag for permanent config backend.api_timeout: { default: 30000 } // Should be env var // BAD: Using env var for temporary feature ENABLE_NEW_CHAT=true // Should be feature flag // BAD: Feature flag that will never be removed ui.enable_dark_mode: {} // If always on, remove flag // BAD: Old naming convention ff_ui_dark_mode // Should be: ui.dark_mode

Migration

Feature Flag → System Setting

When a flag reaches 100% and is stable:

  1. Remove flag checks from code
  2. If the feature needs configuration, add system setting
  3. Remove from featureFlags.ts
  4. Clean up Redis state

System Setting → Feature Flag

When you need gradual rollout of a setting change:

  1. Create feature flag
  2. Add code to check flag before using setting
  3. Gradually roll out
  4. Once at 100%, update system setting
  5. Remove flag
Beginning of guide
End of guide