๐ Flagsmith
Flagsmith (code) is an open source, fully featured, Feature Flag and Remote Config service. Not sure what a feature flag is or why you'd want a service for managing them? LaunchDarkly has a great post on this:
We'll also steal their awesome intro to feature flags (though this article is about Flagsmith!):
You might see what we're getting at here โ Flagsmith is like fully F/OSS versino of LaunchDarkly (though of course the LD team would probably beg to differ, on feature set basis at least!).
We'll sum it up for the impatient: feature flags let you separate deploying features and enabling features, by standardizing on a means of turning feature integration on and off without redeploying your code.
We love products with Demos, and Flagsmith has one:
๐ Features
Flagsmith has a ton of features (and they're all turned on):
- Fully featured Web GUI for managing flags
- BSD 3-clause license
- Scheduling of flag setting
- Managed change requests for flags
- Segmenting usebase for flagging
- Environment management (ex. Dev/Staging/Production)
- Easy deployment with Docker
- Client SDKs in many programming languages
๐ค As described by AI
Flagsmith offers a comprehensive platform for managing feature flags and remote configurations, enabling teams to implement and control features across various environments seamlessly. It supports A/B testing, segment targeting, and feature rollouts, enhancing the development process by allowing real-time adjustments without code deployments.
Flagsmith emphasizes security and flexibility, offering deployment options that cater to different organizational needs. With its open-source nature, Flagsmith encourages community contributions and development, fostering an ecosystem where developers can share improvements, ensuring the platform remains at the forefront of feature flagging technology.
๐บ Watch this
Flagsmith has a YouTube channel which has some great guides and content on it to check out.
There's a great demo on how to do A/B testing with Flagsmith:
If you're more into live-streamed code and hijinks, you might like this recent video by Eddie Jaoude, with Flagsmith:
๐ Getting started
Flagsmith is easy to get started with for a couple reasons:
- Great
docker
support, so it's easy to experiment without changing your system too much docker-compose
support (you can start Flagsmith and it's dependencies all at once)- Kubernetes support for those who use k8s
๐ณ Deploying Flagsmith with Docker
Rather than reading what we have to say, you might want to check out the Flagsmith Docker deployment docs:
Flagsmith has an official docker image and a docker-compose.yml
file that is easy to read and use in their repository:
We've reproduced the Flagsmith relevant parts below (and removed postgres
for example, the backing datastore):
version: '3'
services:
flagsmith:
image: flagsmith/flagsmith:latest
environment:
# All environments variables are available here:
# API: https://docs.flagsmith.com/deployment/locally-api#environment-variables
# UI: https://docs.flagsmith.com/deployment/locally-frontend#environment-variables
DATABASE_URL: postgresql://postgres:password@postgres:5432/flagsmith
USE_POSTGRES_FOR_ANALYTICS: 'true' # Store API and Flag Analytics data in Postgres
ENVIRONMENT: production # set to 'production' in production.
DJANGO_ALLOWED_HOSTS: '*' # Change this in production
ALLOW_ADMIN_INITIATION_VIA_CLI: 'true' # Change this in production
FLAGSMITH_DOMAIN: localhost:8000 # Change this in production
DJANGO_SECRET_KEY: secret # Change this in production
# PREVENT_SIGNUP: 'true' # Uncomment to prevent additional signups
# ENABLE_ADMIN_ACCESS_USER_PASS: 'true' # Uncomment to enable access to the /admin/ Django backend via your username and password
# ALLOW_REGISTRATION_WITHOUT_INVITE: 'true'
# Enable Task Processor
TASK_RUN_METHOD: TASK_PROCESSOR # other options are: SYNCHRONOUSLY, SEPARATE_THREAD (default)
# For more info on configuring E-Mails - https://docs.flagsmith.com/deployment/locally-api#environment-variables
# Example SMTP:
# EMAIL_BACKEND: django.core.mail.backends.smtp.EmailBackend
# EMAIL_HOST: mail.example.com
# SENDER_EMAIL: flagsmith@example.com
# EMAIL_HOST_USER: flagsmith@example.com
# EMAIL_HOST_PASSWORD: smtp_account_password
# EMAIL_PORT: 587 # optional
# EMAIL_USE_TLS: 'true' # optional
ports:
- 8000:8000
healthcheck:
test: ['CMD-SHELL', 'python /app/scripts/healthcheck.py']
interval: 2s
timeout: 2s
retries: 20
start_period: 20s
depends_on:
postgres:
condition: service_healthy
# The flagsmith_processor service is only needed if TASK_RUN_METHOD set to TASK_PROCESSOR
# in the application environment
flagsmith_processor:
image: flagsmith/flagsmith:latest
environment:
DATABASE_URL: postgresql://postgres:password@postgres:5432/flagsmith
USE_POSTGRES_FOR_ANALYTICS: 'true'
depends_on:
flagsmith:
condition: service_healthy
command: run-task-processor
As you can see there are two main pieces to a Flagsmith installation:
- Flagsmith main (docker image
flagsmith/flagsmith
with the default command) - Flagsmith task processor (docker image
flagsmith/flagsmith
run with the commandrun-task-processor
)
This is a pretty standard setup for software that also has a job processor or some sort of async task queue, and it's quite well put together and easy to follow for Flagsmith.
๐งโ๐ป Want to contribute?
Flagsmith is truly free software (BSD 3-clause license), and accepts contributions and bug reports:
There are over 200 issues outstanding (and over 800 closed!) so jump in and help out if you're so inclined.