Feature Flags (feature toggles) — mechanism включения/выключения функций в runtime без deploy. Code: if (flags.isEnabled("new-checkout")) { ... }. Позволяет: gradual rollout, A/B testing, kill switch для broken features, targeted release (только beta users, RU segment). Tools: LaunchDarkly ($), GrowthBook (open-source), Unleash, ConfigCat, feature-service build own.
Ниже: подробности, пример, смежные термины, FAQ.
Бесплатный онлайн-инструмент — проверка HTTP-заголовков: результат мгновенно, без регистрации.
// LaunchDarkly example
import { LDClient } from 'launchdarkly-node-server-sdk'
const ld = LDClient.init(sdkKey)
if (await ld.variation('new-checkout', user, false)) {
return renderNewCheckout()
}Feature Flags operate by using a centralised system to manage which features are enabled or disabled. Developers can define flags in their code, which are then managed externally, allowing changes to be made without redeploying the entire application. if (flags.isEnabled("new-checkout")) { ... } is an example of how you might use a Feature Flag in code.
When a flag is toggled, the application can dynamically adjust its behaviour based on the flag's state. This is particularly useful in environments where rapid changes are required, such as in continuous integration and continuous deployment (CI/CD) pipelines.
Several tools can be used to implement Feature Flags, each offering different features and pricing models. Popular choices include LaunchDarkly, GrowthBook, Unleash, and ConfigCat.
When using Feature Flags, it's important to follow best practices to ensure smooth and efficient operation. Here are some key practices:
By following these best practices, you can effectively use Feature Flags to enhance your development process.
Canary — деploy-time gradual. Feature flags — runtime toggle. Flags живут дольше (недели): progressive rollout + experiments + kill switch.
Да. Old flags захламляют code. Лучшая practice: TTL на flag, auto-reminder в PR review через 30 дней.
GrowthBook (free + paid), Unleash (free for 1 project), Flipt. LaunchDarkly — premium SaaS.
Бесплатный тариф — 10 мониторов, проверки каждые 5 мин, без карты. Платные тарифы — интервал от 1 минуты и проверки из нескольких регионов.