---
title: "Deploy Flagr"
description: "Feature flagging, A/B testing, and dynamic configuration microservice in Go"
category: "Other"
url: https://railway.com/deploy/BZOvXb
---

# Deploy Flagr

Feature flagging, A/B testing, and dynamic configuration microservice in Go

**[Deploy Flagr on Railway](https://railway.com/template/BZOvXb)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/BZOvXb/manifest.json

- **Creator:** Vin
- **Category:** Other
- **Total deploys:** 5

## Template content

### Postgres https://devicons.railway.app/i/postgresql.svg

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl

### Flagr

- **Image:** ghcr.io/openflagr/flagr
- **Health check:** /api/v1/health
- **Public domain:** Yes

## Documentation

<p align="center">
    <a href="https://openflagr.github.io/flagr/#/">
        <img alt="flagr logo" src="https://avatars.githubusercontent.com/u/49816112" style="border-radius: 5px; width: 100px;">
    </a>
</p>

Flagr is an open source Go service that delivers the right experience to the right entity and monitors the impact. It provides feature flags, experimentation (A/B testing), and dynamic configuration. It has clear swagger REST APIs for flags management and flag evaluation.

## Flagr Concepts

The definitions of the following concepts are in [API doc](https://openflagr.github.io/flagr/api_docs).

- **Flag**. It can be a feature flag, an experiment, or a configuration.
- **Tag**. This is a descriptive label attached to a flag for easy lookup and evaluation.
- **Variant** represents the possible variation of a flag. For example, control/treatment, green/yellow/red, etc.
- **Variant Attachment** represents the dynamic configuration of a variant. For example, if you have a variant for the `green` button, you can dynamically control what's the hex color of green you want to use (e.g. `{"hex_color": "#42b983"}`).
- **Segment** represents the segmentation, i.e. the set of audience we want to target. Segment is the smallest unit of a component we can analyze in Flagr Metrics.
- **Constraint** represents rules that we can use to define the audience of the segment. In other words, the audience in the segment is defined by a set of constraints. Specifically, in Flagr, the constraints are connected with `AND` in a segment.
- **Distribution** represents the distribution of variants in a segment.
- **Entity** represents the context of what we are going to assign the variant on. Usually, Flagr expects the context coming with the entity, so that one can define constraints based on the context of the entity.
- **Rollout** and deterministic random logic. The goal here is to ensure deterministic and persistent evaluation result for entities. Steps to evaluating a flag given an entity context:
    - Take the unique ID from the entity, hash it using a hash function that has a uniform distribution (e.g. CRC32, MD5).
    - Take the hash value (base 10) and mod 1000. 1000 is the total number of buckets used in Flagr.
    - Consider the distribution. For example, 50/50 split for control and treatment means 0-499 for control and 500-999 for treatment.
    - Consider the rollout percentage. For example, 10% rollout means only the first 10% of the control buckets (again, use the previous step example, 0-49 out of 0-499 will be rolled out to control experience).

For more details, see the full [Flagr Overview](https://openflagr.github.io/flagr/#/flagr_overview)

## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — Self-hosted virtual tabletop for role-playing games (license required)
- [Double Commander in your browser](https://railway.com/deploy/double-commander-in-your-browser) — The Double Commander file manager in the cloud, from any device

Open this page in a browser: https://railway.com/deploy/BZOvXb
