Skip to content

docs(research): feature flags system design - #525

Merged
NOX73 merged 1 commit into
developfrom
feature/feature-flags-research
Oct 21, 2026
Merged

NOX73 merged 1 commit into
developfrom
feature/feature-flags-research

Conversation

@aixle-com

@aixle-com aixle-com Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Research report for board task #164: how to add a feature flags system with three sources (ENV, a global admin toggle, a per-company override). This is design only. No production code changes.

  • docs/research/technical-feature-flags-system-design-research-2026-10-21.md: the report
  • docs/index.md: index entry under research/

Recommendation: build a small in-house system.

  • Flags are declared in a YAML registry: config/feature_flags.yml.
  • Runtime values live in two Postgres tables: feature_flags (global) and feature_flag_overrides (per company).
  • Each process holds an in-memory snapshot, invalidated by a Redis version token. A check costs no I/O.
  • ENV goes through Settings, so the NoEnvInApp rule still holds.
  • Admin changes are made on a custom /admin page and write Audit rows.
  • Flags reach the frontend through an Inertia features prop and a typed useFeatureFlag hook.

Precedence: ENV > company override > global admin > declared default (required in the registry).

Rejected:

  • Flipper: its gates only add up, so there is no per-company "off". It has no ENV layer, and audit history is a paid Cloud feature.
  • Unleash, LaunchDarkly and PostHog: each adds a service or a vendor to self-hosted and AWS Marketplace installs.
  • OpenFeature: an API, not a store, and its Ruby SDK is 0.x. The facade keeps a seam so we can adopt it later.

The report also covers:

  • worked precedence examples and what happens when a flag is unknown to one layer;
  • the flag lifecycle and how stale flags are found;
  • Temporal determinism;
  • fallback to the declared default when the store is unavailable;
  • test helpers;
  • targeting (company-only, with a reserved slot for percentage rollout);
  • which current ENV switches should become flags and which should stay settings;
  • a 7-task breakdown (about 8–10 days).

Related issues

Board task #164 (Research: feature flags system design)

Type of change

  • Documentation

How was this tested

Docs-only change. I ran test/docs/documentation_drift_test.rb and test/config/configuration_reference_test.rb on a Coder workspace against this branch (results are in the task comment). CI runs the full pipeline.

Checklist

  • Commits signed off (DCO)
  • Docs indexed in docs/index.md
  • CHANGELOG: not needed, nothing user-visible

Research and recommendation for a feature flags system with ENV, global admin and per-company sources: build vs buy, precedence rules with worked examples, data model, call-site API, admin UX, safety, migration plan and implementation breakdown.

Signed-off-by: Aixle-Developer-Agent <[email protected]>
@NOX73
NOX73 merged commit 0c8792f into develop Oct 21, 2026
16 checks passed
@NOX73
NOX73 deleted the feature/feature-flags-research branch October 21, 2026 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant