Ten modules that take you from an empty Git repo to a distributed feature-flag platform — serving rules to thousands of clients, supporting real-time updates, progressive rollouts, A/B testing, and analytics. This track focuses on rule evaluation, SDK design, caching, and the operational challenges of feature control at scale.
← Back to Learning TracksStart with a clear design. Feature flags are simple — wrong rule evaluation is not. Get the model right from the start.
.editorconfig, .gitignore, linter/formatter).flags (metadata), rules (targeting), segments (user groups).git clone + one command spins up the server./docs/design.md with schema sketch.The contract: manage flags and evaluate them. Start simple — a flag has a name, enabled state, and variations.
POST /flags to create a flag: name, type (boolean/string), enabled, variations, description.POST /evaluate to evaluate flags: user context (ID, attributes), flag key. Return the value/variation.GET /flags/:key, PATCH /flags/:key, DELETE /flags/:key.curl -X POST /flags creates a flag; GET /flags/:key returns it.curl -X POST /evaluate with a user context returns a flag value.The core: evaluate complex rules (if-then logic, segments, attributes) to decide flag variations.
SDKs are the interface. Make them simple to use, hard to misuse, and blazingly fast.
client.evaluate(flag_key, user_context) → returns the evaluated variation.is_enabled(flag_key, user_context) for boolean flags and get_variation(flag_key, user_context) for multi-armed.< 100ms.< 1ms (local cache).SDK caches are stale by default. Push new flag definitions to SDKs in real-time so changes are live immediately.
PATCH /flags/:key, push the updated flag config to all connected SDKs.Rule engines are correctness-critical. Off-by-one errors segment users wrong. Test extensively.
Teams need to understand why a flag evaluated to X. Instrument: logs, metrics, traces, evaluation audit logs.
GET /flags/:key/audit to show evaluation results for a user (debugging tool).GET /flags/my-flag/audit?user_id=123 shows why the user got variation A.Roll out features to 1%, 10%, 100% without code changes. Schedule rollouts, monitor metrics, auto-rollback if needed.
rollout_percentage field to flags: 0–100% rollout to users.POST /flags/:key/rollout to manually adjust rollout % with audit logging.Teams rely on flags to ship safely. Secure it: access control, audit logs, secrets, sensitive data handling.
Ship it. Deploy, document SDKs, run operational drills, go live.
docker-compose.yml for local dev (app + Postgres).main deploys to production automatically.