logo

Feature flagging with GrowthBook & Flipt

This article is still being worked on!

Feature flags

Feature flags, also known as feature toggles or feature switches, are simple conditional statements that determine whether a particular feature or code block is active or inactive.

There are many benefits for incorporating feature toggles into your release process. By leveraging feature flags, you can:

  • Control Rollouts: Gradually release features to a subset of users before a full-scale release, minimizing risks and obtaining early feedback.
  • A/B Testing: Conduct experiments with different variations of a feature and analyze their impact on user engagement and behavior.
  • Hotfixes and Rollbacks: Quickly enable or disable features in production to respond to issues or unexpected behavior.
  • Configuration Management: Adjust settings and configurations in real-time without redeploying your application.

Feature flags can be implemented manually using code, but to streamline the process and access advanced features, many development teams turn to enterprise software. Two popular options in this realm are GrowthBook and Flipt. Both tools are open-source and offer self-hosted solutions with premium features.

GrowthBook

GrowthBook has a clean and easy documentation for self-hosting.

# docker-compose.yml
version: "3"
services:
  mongo:
    image: "mongo:4.4.18"
    environment:
      - MONGO_INITDB_ROOT_USERNAME=root
      - MONGO_INITDB_ROOT_PASSWORD=password
    platform: linux/amd64
  growthbook:
    image: "growthbook/growthbook:latest"
    ports:
      - "3000:3000"
      - "3100:3100"
    depends_on:
      - mongo
    environment:
      - MONGODB_URI=mongodb://root:password@mongo:27017/growthbook?authSource=admin
    volumes:
      - uploads:/usr/local/src/app/packages/back-end/uploads
    platform: linux/amd64
volumes:
  uploads:

mongo image version is changed to run on Apple Silicon

Now run docker compose up -d to start GrowthBook & visit http://localhost:3000

Make sure none of frontend & backend is running on port 3000

On first launch you'll have to create account. GrowthBook will guide you to add SDK on the app. The instructions shown are pretty clear & straightforward. Simply do accordingly and you'll be up and running with feature flagging in few mins.

Flipt

Flipt too has an excellent documentation that guides you through the process.

version: "3"
services:
  flipt:
    image: flipt/flipt:latest
    ports:
      - "8080:8080"
      - "9000:9000"
    volumes:
      - ./flipt:/var/opt/flipt
    restart: always

You can pass flipt config file if needed in

version: "3"
services:
  flipt:
    image: flipt/flipt:latest
    ports:
      - "8080:8080"
      - "9000:9000"
    volumes:
      - ./flipt:/var/opt/flipt
      - ./flipt/config.yaml:/etc/flipt/config.yaml
    restart: always

If you encounter CORS error, you'll likely have to allow your origin in the config.yml file

Install necessary SDK tools to get up and going.

Flipt Node SDK is still in beta.

GrowthBook vs. Flipt

Setup

Setting up GrowthBook and Flipt is remarkably similar, and both tools offer a seamless process through Docker.

SDK support

Both GrowthBook and Flipt offers SDK support for major programming languages. The process of setting up these SDKs is straightforward and similar for both tools.

While GrowthBook's SDK offers a mature and polished experience, it's worth noting that Flipt's Official Node.js SDK is still in beta. Some developers may find GrowthBook's SDK to be a more reliable and developer-friendly option at this stage.

Features

GrowthBook excels in providing a wide array of features and exceptional control compared to Flipt. With GrowthBook, you can grant access to specific users based on custom attributes, allowing for more fine-tuned targeting. This level of granularity ensures that features reach the intended audience precisely. Moreover, GrowthBook supports custom environments, enabling you to create distinct environments for development, testing, staging, and production. This flexibility streamlines the management of feature flags across different stages of your software development lifecycle.

Devtools

One of GrowthBook's standout features is its Chrome extension, which functions as a visual editor. This extension opens up the tool's capabilities to non-technical individuals, allowing them to easily manage feature flags without diving into code.

Conclusion

Based on stability, feature set, and community support, GrowthBook offers superior value for most use cases. Its robust feature set, granular control, and extensive community support make it a reliable and feature-rich choice for teams looking to implement sophisticated feature flagging strategies. However, if simplicity and ease of use are your top priorities, Flipt could be an appealing option. It provides a more straightforward and user-friendly experience, making it ideal for teams seeking a quick and easy way to get started with feature flagging. Ultimately, the best choice will depend on your specific project requirements and the level of control and complexity you need in your feature flagging process.