GO Feature Flag

repository·main·Indexed 24 days ago

https://github.com/thomaspoignant/go-feature-flag

A lightweight, self-hosted, and open-source feature flag solution for cloud-native environments. It supports the OpenFeature standard and provides a CLI for evaluating and linting flags, a Relay Proxy for language-agnostic HTTP access, and an Editor Playground API for testing. It supports multiple configuration retrievers including file, http, github, gitlab, s3, googleStorage, configmap, mongodb, bitbucket, azureBlobStorage, and postgresql.

Tokens
197.6K
Snippets
390
Records
832
Agent score
77%

What's inside go-feature-flag

  1. What is GO Feature Flag?

    main
    GO Feature Flag is a lightweight, open-source, and self-hosted feature flag solution. It was originally designed for the Go language but has expanded to support multiple languages via the OpenFeature standard through a hosted relay proxy. It allows developers to manage feature flags with minimal setup and supports complex targeting and rollout strategies.
  2. Overview of GO Feature Flag (GOFF)

    main

    GO Feature Flag (GOFF) is an OpenFeature-native, self-hosted feature flagging solution designed for simplicity and GitOps workflows. Unlike many alternatives, it does not require a database to operate; instead, it retrieves flag configurations (YAML, JSON, or TOML) and keeps them in memory.

    Key Characteristics

    • Deployment: Extremely simple to install. Run a single Go binary and point it at your configuration source.
    • OpenFeature Native: Built from the ground up for OpenFeature with native providers for Go, Node/JS, Python, Java, .NET, PHP, Ruby, Swift/Android, Kotlin, and Web (React/Angular).
    • Management: There is no runtime admin dashboard for flag management. Instead, management is GitOps-driven, though a web editor is provided for authoring and validating configurations.
    • Evaluation Models:
      • Remote Evaluation: Via a relay proxy.
      • In-process Evaluation: Using a WebAssembly (Wasm) module embedded directly in the SDKs for local-latency reads.
    • Extensibility:
      • Exporters: Supports exporting usage analytics to S3, GCS, Azure, Kafka, Kinesis, Pub/Sub, SQS, BigQuery, OpenTelemetry, webhooks, files, and logs.
      • Notifiers: Supports change notifications via Slack, Discord, Microsoft Teams, and webhooks.
    • License: MIT, fully open with no paywalled enterprise tier.
  3. Overview of GO Feature Flag

    main

    GO Feature Flag is a lightweight, open-source feature flagging solution designed to decouple deployment from release. It eliminates the need for a complex backend system by using a file as its backend.

    Key capabilities include:

    • Multiple Flag Types: Evaluate Bool, String, Int, Double, and JSON flags.
    • Complex Targeting: Define rules to target specific audiences based on evaluation context.
    • Rollout Strategies: Implement progressive rollouts, A/B testing, and scheduled flag updates.
    • Multi-language Support: Use the same flag configuration across different languages via the OpenFeature standard.
    • Flexible Storage: Store configurations in various locations such as K8S ConfigMaps, S3, Azure Blob Storage, GitHub, etc.
    • Observability: Export evaluation data for analysis and receive notifications when flag configurations change.
  4. Compare GO Feature Flag rollout strategies

    main

    GO Feature Flag provides four primary rollout strategies to manage feature releases. Choose the strategy based on whether you need random variation, automatic progression over time, time-bound experimentation, or structured multi-stage deployment.

    Release OptionDescriptionUse Case
    Percentage rolloutControls the percentage of evaluation contexts that receive a specific flag variation.Use for random variations based on evaluation context. Note that if you change the percentage later, a specific customer's variation might change.
    Progressive rolloutThe percentage of customers receiving a variation automatically increases over time.Use for random variations where a customer's variation changes only once as the rollout progresses.
    Experimentation rolloutServes a feature flag for a determined time period and automatically disables it after the end date.Use to test a feature for a specific window and analyze results. Outside this window, users receive the default value.
    Scheduled rolloutA structured, multi-stage approach that automates rollout to specific environments and audiences at specific dates.Use when you need to modify target audiences, add targeting rules, or change percentages at predefined stages.
  5. Key capabilities of GO Feature Flag

    main

    GO Feature Flag provides several core capabilities for managing feature flags:

    • OpenFeature Standard: Use the OpenFeature standard in any supported language.
    • Flexible Storage: Store flag configurations in various locations including HTTP, S3, Kubernetes, and more.
    • Multiple Formats: Configure flags using JSON, TOML, or YAML.
    • Complex Targeting: Add rules to target specific users.
    • Advanced Rollout Strategies:
      • A/B testing experimentation
      • Progressive rollouts
      • Scheduled flag updates
    • Data Export: Export flag usage data to destinations like S3, Google Cloud Storage, file, or Kafka.
    • Notifications: Receive notifications via webhook or slack when flags change.
    • Full-Stack Support: Supports backend, frontend, and mobile applications.
  6. Explore GO Feature Flag usage pathways

    main
    GO Feature Flag provides multiple ways to integrate feature flagging into your applications, including direct module usage, OpenFeature SDK integration, and server-side deployments. You can choose a pathway based on your runtime (Go, Node.js, React, Kotlin, Swift, Python) or your infrastructure (Kubernetes, AWS, GitHub, MongoDB, S3).
  7. Understand the Node.js OpenFeature integration example

    main

    This example demonstrates how to integrate GO Feature Flag into a Node.js application using the OpenFeature SDK and the GO Feature Flag provider.

    Key components of the demo:

    • Relay Proxy Configuration: Managed via the goff-proxy.yaml file.
    • Flag Configuration: Loaded from the config.goff.yaml file.
    • Evaluation Logic: The application iterates through 6 different evaluation contexts to check the state of a flag named my-new-feature.

    You can observe real-time changes by editing the config.goff.yaml file while the application is running; the behavior of the application will update based on the new flag configuration.