We stopped doing big-bang releases two years ago. Not because we adopted a new deployment tool, but because we finally separated the act of deploying code from the act of releasing functionality. That shift came down to one primitive: feature flags. In my experience, teams that treat flags as a developer convenience miss the real value. When implemented correctly, they become the control plane for Deployment Strategies: Blue-Green, Canary and Rolling Updates Compared at the application layer — letting you progressively deliver to 1%, 10%, and then 100% of users without a new build, a new container image, or a Kubernetes rollout. This article covers how I evaluate and operate the three options that matter right now: LaunchDarkly for teams that want a managed platform, Unleash for teams that need self-hosted control, and OpenFeature as the abstraction that keeps you from getting locked into either.
Decoupling Deployment from Release: Why Feature Flags Belong in Your Delivery Pipeline
The core idea is simple: you merge code to main behind a flag defaulting to off, your CI pipeline builds and deploys that artifact through all environments, and you enable the flag for specific users or segments at runtime. That decoupling fundamentally changes your risk profile. A bad deploy becomes a bad flag evaluation you can turn off in milliseconds, not a rollback that takes 10 minutes and requires rebuilding an image.
I've found that the teams who struggle with flags are the ones who implement them only in application code. For progressive delivery to work, flags need to be integrated with your CI/CD system, your observability stack, and your incident response runbooks. A flag without metrics and without an owner is just conditional logic that will be forgotten. We now require every flag to have four fields in its creation request: owner (team + Slack channel), expiry date, intended rollout strategy, and the monitoring dashboard that will validate it.
Where Flags Sit in a Modern CI/CD Architecture
Your pipeline should produce a single immutable artifact. I've seen teams build separate images for "feature on" and "feature off" — that defeats the purpose. The artifact contains both code paths. The flag provider — whether it's LaunchDarkly's SaaS or your own Unleash instance — is queried at runtime by the SDK running in your service. That means your delivery pipeline stays focused on building, testing, and deploying, while your release orchestration moves to flag targeting rules.
This separation also improves security posture. Your CI system no longer needs production credentials to perform a release. Developers with flag-targeting permissions can gradually expose functionality without triggering a full deployment. We pair this with OIDC-based identity for our workflows, similar to the pattern described in GitHub Actions Advanced Workflows: Matrix Builds, Reusable Actions and OIDC, so the deployment job and the release decision have distinct identities and audit trails.
One practical consequence: your Kubernetes Deployments should not need to change when you release. If you are coupling flag configuration with ConfigMaps that trigger pod restarts, you are reintroducing coupling. Use a streaming SDK connection, not a config file reload. The Kubernetes Documentation makes it clear that Deployments are for declarative state of pods; feature state is dynamic application state and belongs in a dedicated evaluation service.
Evaluating LaunchDarkly's Managed Platform Against Operational Cost
LaunchDarkly is the most mature managed option, and in my experience, you pay for two things: reliability at scale and sophisticated targeting. Their architecture uses a streaming-first approach. The SDK maintains a persistent SSE connection to LaunchDarkly's edge, holds all flag rules in memory, and evaluates locally without a network hop. That gives you sub-millisecond evaluation with no added latency to the request path, which matters when you put a flag in a hot path like an API gateway or checkout flow.
What justifies the cost for larger organizations is the targeting and experimentation layer. You can target on user attributes, custom segments synchronized from your data warehouse, percentage rollouts with sticky bucketing, and prerequisite flags. For example, you can require that payment-v2-migration is only evaluated if user-on-new-tax-engine is true. That dependency management becomes critical when you have 150+ active flags. I've seen teams try to replicate this with homegrown targeting and regret it within six months.
The operational tradeoff is offloading availability. If LaunchDarkly is down, SDKs serve from their last known in-memory flag set and continue evaluating. That fallback is well-designed, but you are still dependent on an external SaaS for flag updates. We mitigate this by caching flag configurations in our own Redis as a bootstrap source and monitoring the SDK's ready and failed events. For regulated environments, data privacy is the other concern: user context attributes sent for evaluation need to be classified. LaunchDarkly offers private attributes and a Relay Proxy you can run inside your VPC so user keys never leave your network.
When LaunchDarkly Makes Financial Sense
For a team of 40 engineers running 15 microservices, I typically calculate the build-vs-buy threshold around 9-12 months of engineering time. If you need advanced experimentation, audit logs, SOC 2 attestation, and role-based access out of the box, LaunchDarkly saves you that build time immediately. If you only need boolean flags for trunk-based development, it is overkill. My rule of thumb: if you plan to do statistically rigorous A/B tests tied to flags, start with LaunchDarkly. If you just need on/off for safe deployments, start elsewhere.
Running Unleash Self-Hosted on Kubernetes Without Shooting Yourself in the Foot
Unleash is my default recommendation when a team needs full data control, on-prem requirements, or wants to avoid per-seat pricing. It is open source, Postgres-backed, and the SDKs are well-maintained. But self-hosting does not mean free. You are now operating a critical piece of infrastructure that sits in the request path.
We run Unleash on Kubernetes as a Deployment with three replicas behind an internal ingress. It needs Postgres and, for high availability, Redis for caching. The most common failure mode I've seen is people running Unleash without proper resource limits and with strategy: RollingUpdate that causes all SDKs to reconnect at once during an upgrade. Follow the guidance in the Terraform Documentation if you are provisioning it with IaC — make the database managed, not a pod.
# terraform/unleash.tf - provisioning Unleash with managed Postgres
resource "helm_release" "unleash" {
name = "unleash"
repository = "https://docs.getunleash.io/helm-charts"
chart = "unleash"
namespace = "feature-flags"
version = "4.8.0"
values = [yamlencode({
replicaCount = 3
database = {
host = aws_db_instance.unleash.address
ssl = true
poolSize = 20
}
redis = {
enabled = true
host = aws_elasticache_cluster.unleash.cache_nodes[0].address
}
extraEnv = {
ENABLE_UNLEASH_EDGE = "true" # Run edge for SDKs close to workloads
}
})]
}
resource "kubernetes_hpa_v2" "unleash" {
metadata { name = "unleash" namespace = "feature-flags" }
spec {
scale_target_ref { api_version = "apps/v1" kind = "Deployment" name = "unleash" }
min_replicas = 3
max_replicas = 10
metric {
type = "Resource"
resource { name = "cpu" target { type = "Utilization" average_utilization = 70 } }
}
}
}
The SDK setup for Unleash is slightly different from LaunchDarkly. Evaluation can be client-side (SDK fetches toggles and evaluates locally) or server-side via Unleash Edge or the Frontend API. For backend services, use the server-side SDK. The pattern below shows a Node.js service evaluating a progressive rollout flag with Unleash and enforcing graceful degradation if the provider is unreachable.
// server/unleash-provider.js
import { Unleash } from 'unleash-client';
const unleash = new Unleash({
url: 'https://unleash-edge.internal.company.com/api',
appName: 'checkout-service',
customHeaders: { Authorization: process.env.UNLEASH_API_TOKEN },
refreshInterval: 5000, // polling fallback if SSE drops
disableMetrics: false,
});
unleash.on('error', (err) => {
// Metrics: increment unleash.client.error, alert if sustained
console.error('Unleash client error', err);
});
await unleash.start();
export function isCheckoutV2Enabled(context) {
// context: { userId, tenantId, region }
// Unleash evaluates locally using strategy constraints + segments
return unleash.isEnabled('checkout-v2', context, false); // false = default
}
Operational Hardening for Self-Hosted Flags
Three things I enforce for any Unleash production install. First, run Unleash Edge as a sidecar or per-AZ edge cache so SDKs don't all hit the central API. Second, back up flag configuration to Git daily — Unleash has an export API; cron it and commit to a private repo. Third, monitor flag evaluation latency as a first-class SLI. The SDK's evaluation is local, but SDK startup time and polling interval directly affect how fast a kill-switch propagates. We alert if time-from-flag-update-to-SDK-sync exceeds 30 seconds.
Adopting OpenFeature as a Vendor-Neutral Abstraction Layer
OpenFeature solves a problem I ran into a year ago: we wanted to migrate from a homegrown flag system to LaunchDarkly for one team and Unleash for another, and every service had provider-specific SDK imports scattered across the codebase. OpenFeature provides a vendor-neutral API and SDK with pluggable providers. Your application code imports OpenFeature, not LaunchDarkly or Unleash.
This is not another wrapper. It is a CNCF incubating project with a spec for flag evaluation, context propagation, and hooks. The benefit is portability. You can start with the in-memory provider for local development, switch to the Unleash provider in your self-hosted clusters, and use the LaunchDarkly provider for your SaaS product — all without changing application logic. In practice, this has saved us significant refactoring when procurement decisions changed.
// openfeature-setup.js - one-time provider registration at boot
import { OpenFeature } from '@openfeature/server-sdk';
import { LaunchDarklyProvider } from '@openfeature/launchdarkly-provider';
// Register the provider once at application startup
await OpenFeature.setProviderAndWait(
new LaunchDarklyProvider('sdk-1234567890abcdef', {
// Provider options are isolated here
logger: pinoLogger,
})
);
// Application code stays vendor-agnostic
import { OpenFeature } from '@openfeature/server-sdk';
const client = OpenFeature.getClient('checkout-service');
async function handleRequest(req, res) {
const context = {
targetingKey: req.user.id,
tenant: req.user.tenantId,
region: req.headers['x-region'],
};
// Same call regardless of underlying provider
const useNewFlow = await client.getBooleanValue('checkout-v2', false, context);
if (useNewFlow) {
return handleCheckoutV2(req, res);
}
return handleCheckoutV1(req, res);
}
We also use OpenFeature hooks to enforce consistency. A logging hook records every flag evaluation with flag key, variant, and context hash — essential for debugging why a user saw a different experience. A metrics hook increments a Prometheus counter feature_flag_evaluation_total{flag="checkout-v2", variant="true"} so we can correlate flag exposure with latency and error budgets.
Migration Path with OpenFeature
If you are already on LaunchDarkly or Unleash, you don't have to migrate everything at once. I've had success wrapping the existing provider with OpenFeature in one service, validating parity in staging by dual-evaluating (call both native SDK and OpenFeature and compare), then rolling out service by service. The abstraction has a small performance cost — an extra function call — but evaluation remains local. The real cost is learning: developers need to understand OpenFeature's context model, which is more explicit than passing a plain user object.
Wiring Feature Flags into Progressive Delivery and Automated Rollbacks
Progressive delivery is where flags deliver their ROI. Instead of a canary deployment that shifts 5% of traffic at the infrastructure layer, you shift 5% of users at the application layer while running a single deployment. That lets you progressive-deliver per feature, not per service. I can canary search-ranking-v3 to internal users while checkout-v2 is at 50% — both flags living in the same deployed artifact.
The workflow we use combines flag targeting with automated analysis. A flag starts at 0% with a targeting rule: email ends with @company.com. After smoke tests pass, we bump to 5% of production traffic. Our monitoring watches error rate, p95 latency, and business metrics (conversion rate) for the cohort with the flag on versus off. If any metric breaches, the flag is automatically disabled via the provider API. This is more granular than rolling back a deployment, which would revert all changes shipped together.
Here's a simplified GitHub Actions workflow that automates that progression using the LaunchDarkly API and metric checks. It reflects patterns from GitHub Actions Advanced Workflows: Matrix Builds, Reusable Actions and OIDC and keeps delivery logic in Git where it can be reviewed.
# .github/workflows/progressive-release.yml
name: progressive-release
on:
workflow_dispatch:
inputs:
flag: { required: true, type: string } # e.g., checkout-v2
jobs:
rollout-5-percent:
runs-on: ubuntu-latest
permissions:
id-token: write # OIDC to LaunchDarkly, no static secret
steps:
- name: Enable flag for 5% rollout
run: |
curl -X PATCH "https://app.launchdarkly.com/api/v2/flags/default/${{ inputs.flag }}" \
-H "Authorization: ${{ secrets.LD_API_TOKEN }}" \
-H "Content-Type: application/json" \
--data '{
"instructions": [{
"kind": "addRule",
"variationId": "variation-true",
"rolloutWeights": [5000, 95000]
}]
}'
- name: Wait and validate metrics (Datadog)
run: |
sleep 600
ERROR_RATE=$(curl -s "https://api.datadoghq.com/api/v1/query?query=avg:checkout.error_rate{flag:${{ inputs.flag }}.on}" \
-H "DD-API-KEY: ${{ secrets.DD_API_KEY }}" | jq '.series[0].pointlist[-1][1]')
if (( $(echo "$ERROR_RATE > 0.01" | bc -l) )); then
echo "Error budget breached, disabling flag"
curl -X PATCH "https://app.launchdarkly.com/api/v2/flags/default/${{ inputs.flag }}" \
-H "Authorization: ${{ secrets.LD_API_TOKEN }}" \
-d '{"instructions": [{"kind": "turnFlagOff"}]}'
exit 1
fi
- name: Promote to 50% on success
if: success()
run: echo "Proceed to next stage: 50% rollout gate requires manual approval"
This approach complements, not replaces, infrastructure-level strategies. We still use canary Deployments for risky infrastructure changes like DB migrations. For reference on when to choose which, see Deployment Strategies: Blue-Green, Canary and Rolling Updates Compared. But for application features, flag-based progressive delivery is faster and cheaper because it does not require duplicate capacity.
Linking Flags to Observability
Every flag evaluation should emit a hook that adds the flag state to your trace and logs. In OpenTelemetry, we add a span attribute feature_flag.checkout-v2=true. That lets you filter traces in Grafana Tempo and see that requests with the flag on have a 40ms higher p99 because they hit a new service path. Without that context, you will chase phantom latency regressions. Also, version your flag rules: treat flag configuration changes with the same PR review discipline as Terraform. Unleash supports this natively with change requests; for LaunchDarkly we enforce it via Terraform provider for flags.
Keeping Flag Hygiene: Lifecycle Management, Technical Debt and Auditing
Flags are technical debt if you let them accumulate. I've audited codebases with 300+ flags where half were for features shipped two years ago. The codebase becomes unreadable — nested if (flag.enabled) blocks that nobody dares to remove. We treat flag removal as part of definition-of-done.
Our lifecycle is: create (with expiry), rollout (0% → 100% with gates), measure (7 days at 100%), cleanup (remove flag and dead code within 14 days). We automate enforcement. A nightly job queries the LaunchDarkly and Unleash APIs for flags that have been at 100% or 0% for more than 30 days and opens a Jira ticket assigned to the owner. If the flag is temporary — and most should be — the ticket is a blocker for the next sprint. Permanent flags (e.g., premium-tier-access) are explicitly labeled as permanent and excluded, but they require architecture review.
Auditing matters for both security and compliance. Every flag change should be attributable to an identity, timestamped, and linked to a change ticket. For supply-chain concerns, review CI/CD Security: Pipeline Hardening, SLSA and Software Supply Chain — flag systems are part of your supply chain because they control runtime behavior without a build. We stream LaunchDarkly audit logs to SIEM and restrict flag write permissions to a small group via SSO. For Unleash, we enable OIDC SSO and store audit logs in Postgres with WAL archiving.
One more practice I recommend: use typed flags and prohibit plain stringly-typed booleans for anything beyond simple on/off. OpenFeature supports boolean, string, integer, and object variants with JSON Schema validation. A flag search.ranking.algorithm with variants v1, v2, v3 and a schema prevents someone from accidentally setting it to banana.
| Dimension | LaunchDarkly (Managed SaaS) | Unleash (Self-Hosted) | OpenFeature (Abstraction) |
|---|---|---|---|
| Hosting & Operations | Fully managed, global edge, 99.9% SLA; zero infra to run | You operate Postgres, Redis, and app tier; edge scales with you | Not a provider; SDK shim that delegates to LaunchDarkly, Unleash, etc. |
| Evaluation Latency | Local SDK evaluation via SSE streaming; ~0.5ms | Local evaluation via polling/SSE; 1-5ms plus Edge hop if used | Depends on underlying provider; adds negligible overhead |
| Targeting & Experimentation | Advanced: segments, prerequisites, percentage rollouts, A/B stats | Core targeting + segments; experimentation via Unleash Enterprise | Defines hooks for tracking; experimentation handled by provider |
| Pricing Model | Per-seat + MAU; predictable but scales with usage | OSS free; Enterprise license for SSO, change requests, support | Open source (CNCF); no direct cost, reduces migration cost |
| Best Fit | Product teams needing experimentation and managed scale | Platform teams requiring data residency and VPC isolation | Any team wanting to avoid lock-in across multiple providers |
Frequently Asked Questions
Should feature flags replace canary deployments or work alongside them?
They work alongside. Use infrastructure canaries for changes that affect the whole service — like runtime upgrades, base image changes, or schema migrations — where you need traffic shifting at the load balancer. Use feature flags for application-level progressive delivery where you want per-feature control without duplicate capacity. In my stacks, the Kubernetes canary validates the deployment is healthy, and the flag validates the feature is safe for users. The Docker Documentation model of immutable images still applies; flags just control which code path inside that image executes.
How do you handle flag evaluation when the provider is unreachable?
Design for graceful degradation. Both LaunchDarkly and Unleash SDKs cache the last flag set in memory and on disk and continue local evaluation if they lose connection. Always provide a sensible default in code — usually false for new features — and instrument the SDK's initialized and error events. For critical kill-switches, I bootstrap the SDK from a cached JSON file in the container image so even a cold start with no network can evaluate a safe default.
Can OpenFeature run without LaunchDarkly or Unleash?
Yes. OpenFeature itself does not store flags; it needs a provider. For local development you can use the In-Memory Provider or the Env Var Provider. For production you would pair it with the LaunchDarkly provider, the Unleash provider, Flagd (the OpenFeature daemon), or another compliant provider. Flagd is useful if you want an OpenFeature-native, lightweight flag service backed by a Git-synced JSON file.
How long should a temporary feature flag stay in the codebase?
No longer than one or two releases after it hits 100% rollout. My team's rule is 30 days maximum after full rollout, enforced by an expiry date at creation and a nightly audit job. Leaving flags longer increases branch complexity, test matrix size, and the risk of conflicting rules. When you remove the flag, remove both the targeting rule in the provider and the conditional code — don't just leave dead if (true) blocks.