Přeskočit na obsah
_CORE
AI & Agentic Systems Core Informační Systémy Cloud & Platform Engineering Data Platforma & Integrace Security & Compliance QA, Testing & Observability IoT, Automatizace & Robotika Mobile & Digital Banky & Finance Pojišťovnictví Veřejná správa Obrana & Bezpečnost Zdravotnictví Energetika & Utility Telco & Média Průmysl & Výroba Logistika & E-commerce Retail & Loyalty
Reference Technologie Blog Knowledge Base O nás Spolupráce Kariéra
Pojďme to probrat

Feature Flags implementace

01. 01. 2024 1 min čtení intermediate

Architektura Pokročilý

Feature Flags implementace

Feature FlagsDeploymentRelease 3 min čtení

Postupný rollout nových funkcí. Kill switches, percentage rollout a A/B testing.

Typy

  • Release Toggle — postupný rollout (10% → 50% → 100%)
  • Experiment — A/B testing
  • Ops Toggle — kill switch
  • Permission — funkce pro specifické plány

Implementace

class FeatureFlags {
    isEnabled(flag, ctx = {}) {
        const f = this.flags[flag];
        if (!f?.enabled) return false;
        if (f.percentage !== undefined) {
            return (this.hash(ctx.userId) % 100) < f.percentage;
        }
        if (f.allowedUsers?.includes(ctx.userId)) return true;
        return f.enabled;
    }
}
// Konfigurace
const flags = new FeatureFlags({
    newCheckout: { enabled: true, percentage: 25 },
    darkMode: { enabled: true }
});

Nástroje

  • LaunchDarkly — enterprise
  • Unleash — open-source
  • Flagsmith — open-source + cloud

Shrnutí

Must-have pro continuous delivery. Udržujte disciplínu — pravidelně odstraňujte staré flags.

Potřebujete pomoct s implementací?

Náš tým má zkušenosti s návrhem a implementací moderních architektur. Rádi vám pomůžeme.

Nezávazná konzultace