The Project in Flagsmith

The Project in Flagsmith

The workspace where one product keeps its features, its segments, its stages and its rules. Learn what a Project holds, how it is wired together, and how to design Projects that stay tidy from the first flag to the ten thousandth.

Imagine a team building a mobile banking app. Over one year they will create hundreds of small switches: show the new transfer screen, limit a heavy chart during busy hours, offer a special rate to a pilot group of customers. If those switches are scattered across files, spreadsheets and people’s memories, nobody can say what is on, what is off, or who decided. Sooner or later, somebody flips the wrong one.

Flagsmith solves this by giving every product a home called a Project. Inside the Project live all of that product’s features, the rules that decide who sees them, and the stages through which changes travel before reaching real customers. If the Organisation is the company’s head office, the Project is the workshop where one team does its daily work. This guide explains that workshop from the ground up, and then shows how experienced architects arrange many of them.

No previous knowledge of Flagsmith is needed. Each new word is explained the first time it appears, and each big idea comes with a picture from everyday life.

1What Is a Project in Flagsmith?

Three short definitions come first: the feature flag, the platform, and then the Project itself.

The feature flag

A feature flag (also called a feature toggle) is an on and off switch placed inside software. The code for a new feature is already deployed, but the flag decides whether users can see it. Flip it on and the feature appears. Flip it off and it disappears, with no new release needed. Teams use flags to release slowly, to test ideas, to hide unfinished work and to switch off a misbehaving feature in seconds.

The platform

Flagsmith is a feature flag and remote configuration service. It offers a dashboard where people manage flags, and small libraries called SDKs that applications install so they can ask, “what should this flag be right now?” It is open source, so companies can host it themselves, and it is also offered as a hosted service.

The Project

A Project is the container for everything that belongs to one application, product or service. It sits directly below the Organisation and directly above Environments. Inside a Project you define your features, create your segments (rules that pick groups of users), label things with tags, and set rules about who on your team may do what. When you open Flagsmith to do real work, you almost always open a Project first.

Everyday analogy

Think of a restaurant chain. The head office is the Organisation. Each restaurant is a Project. Every restaurant has its own menu, its own staff rota and its own habits, but all follow the chain’s rules. The menu is the list of features. The lunch service and dinner service are Environments. You would never put two restaurants’ menus on one sheet of paper, and for the same reason you do not mix two products inside one Project.

Above
Organisation: people, rules, billing
Here
Project: features, segments, tags
Below
Environment: live values per stage
i
Remember this

A Project answers the question “which product is this about?” An Environment answers “which stage is this?” An Organisation answers “which company, and who is allowed in?” Keeping those three questions separate is the secret to a tidy Flagsmith.

2Why Flags Need a Home of Their Own

One flag is easy. A whole product’s worth of flags, changed by many people across many stages, is a different problem entirely.

The problem Projects solve

A growing product collects flags the way a garage collects boxes. Some are brand new, some are half forgotten, and some are so old that nobody dares touch them. Without a clear home, four questions become impossible to answer. What flags does this product have? Who owns each one? What is each one doing in each stage? And what happens to the product if one of them is changed by mistake?

Inventory

What exists?

A Project lists every feature of one product in a single place, so nobody has to search through code to find out.

Ownership

Who is in charge?

The Project belongs to one team, and permissions can be set per Project so the owners have control and others do not.

Stages

What is live where?

Environments inside the Project hold the value of each feature for development, testing and real customers.

Safety

What if it goes wrong?

Changes are recorded in a history, so a bad flip can be found and reversed quickly.

Everyday analogy

A hospital keeps one medical file per patient. Imagine instead that every nurse kept their own notes about everyone, in their own pockets. Nobody could be sure about a patient’s medication. A Project is the single file for a product: one place where every authorised person finds the same truth.

What large companies teach us

Engineering organisations known for rapid releases, such as Amazon, Netflix and Etsy, have all described in public talks and articles the idea of separating deployment from release: code goes out quietly, and a switch decides when users see it. Etsy in particular has written about “config flags” as a way to deploy many times a day with confidence. The same idea scales down. Whether you have five flags or five thousand, the switch is only trustworthy if it lives in a place with clear owners, clear stages and a clear history. That place is the Project.

A feature flag without a Project is a light switch with no wiring diagram.

The cost of having no home

Teams who skip structure often pay in three ways. First, time: engineers spend hours hunting through code to learn what a switch does. Second, risk: a flag with no owner and no history is one that nobody dares touch, and one that someone eventually touches wrongly. Third, trust: when two people disagree about what is on in Production, they lose faith in the whole approach and go back to slow, careful releases. A Project removes all three costs by giving every switch a place, an owner and a history.

3Where the Project Sits in the Flagsmith Hierarchy

Flagsmith is a tree with three main levels. Knowing exactly where the Project sits explains most of its behaviour.

At the top is the Organisation, which holds people, groups, billing and company-wide rules. Below it are Projects. Below each Project are Environments. Inside each Environment are the live values of every feature and the end users, called identities, whose flags are being worked out. The diagram shows a fictional company, Acme Corp, with two Projects.

graph TD
  ORG["Organisation: Acme Corp"] --> P1["Project: Checkout Service"]
  ORG --> P2["Project: Mobile App"]
  P1 --> F["Features defined once"]
  P1 --> SEG["Segments"]
  P1 --> TAG["Tags"]
  P1 --> PERM["Project permissions"]
  P1 --> E1["Environment: Development"]
  P1 --> E2["Environment: Staging"]
  P1 --> E3["Environment: Production"]
  E3 --> FS["Feature states and values"]
  E3 --> ID["Identities and traits"]
  E3 --> KEY["Environment API keys"]
    
Fig 1. One Project holds shared definitions, and its Environments hold the live values.
LevelRepresentsHoldsTypical owner
OrganisationThe company or accountMembers, groups, roles, billing, security rulesPlatform team
ProjectOne product or serviceFeature definitions, segments, tags, project permissions, audit historyThe product team
EnvironmentOne stage of deliveryFeature values, identities, overrides, API keysEngineers and release managers

The key split to remember

A feature is defined once, at the Project level. Its value is stored separately in each Environment. So a feature called “new transfer screen” exists once in the Mobile App Project, but it may be on in Development, on for a small group in Staging, and off in Production. That split is what makes careful, step by step releases possible.

!
Common confusion

Because features are defined at the Project level, creating a feature creates it in every Environment of that Project at the same moment. People are often surprised that they cannot create a feature “only in Production”. The feature exists everywhere, and you control where it is switched on.

4What Lives Inside a Project

Open a Project and you will find a handful of areas. Each has a simple job.

Stages

Environments

The stages your product moves through, such as Development, Staging and Production. Each has its own keys and values.

Switches

Features

The flags and configuration values of the product. Each has a name, a description and a value per Environment.

Targeting

Segments

Reusable rules that pick groups of users, such as everyone on the premium plan or everyone in one country.

Labels

Tags

Colourful labels used to sort and search features, such as “payments”, “experiment” or “temporary”.

Access

Project permissions

Rules about who can view the Project, create features, manage segments and read the history.

History

Audit log

A diary of changes made in the Project: who changed what, and when.

Connections

Integrations

Links to other tools such as chat and monitoring services, so flag changes appear where your team already looks.

Rules

Project settings

Choices that apply to the whole Project, such as how feature names must be written and whether disabled flags are sent to apps.

Notice what is not on this list: people management and billing. Those belong to the Organisation. A Project is about the product’s behaviour, not about the company’s accounts. This separation lets a product team work freely inside its Project while a platform or security team keeps its grip on the account above.

Scenario: a ride-booking product

A ride-booking company of the kind Uber popularised has a Project for its rider app. Inside it, features include “show surge price explanation”, “new payment sheet” and “driver arrival map”. Segments include “new riders” and “riders in pilot cities”. Tags mark which features are temporary release flags and which are permanent safety valves. A completely different Project holds the driver app, so the two teams never trip over each other’s switches.

5Environments Inside a Project

An Environment is one stage of a product’s journey. Every Project has at least one, and most have three or more.

What is an Environment?

An Environment is a separate copy of the live values of your features. The usual three are Development, where engineers experiment freely, Staging, where the product is tested as a whole before release, and Production, where real customers use the product. Flagsmith normally creates starter Environments for a new Project, and you can add more, such as one for a quality assurance team or one per region.

What each Environment owns

Every Environment has its own API keys, so a test build can never accidentally read Production values. It has its own feature values, so a feature can be on in Development and off in Production. It has its own identities, which are the end users the product has told Flagsmith about, and its own overrides, which are special rules for a particular segment or person.

EnvironmentWho uses itPurposeTypical care level
DevelopmentEngineersBuild and try new features safelyRelaxed, anyone on the team may change
StagingTesters and product managersRehearse the release exactly as it will happenModerate, a smaller group changes values
ProductionReal customersRun the live productStrict, a small trained group, changes recorded
Everyday analogy

A theatre has rehearsal rooms, a dress rehearsal on the real stage with no audience, and the opening night. The play is the same, but mistakes in the rehearsal room cost nothing while mistakes on opening night are public. Environments give your software the same three safe steps.

Keeping Environments alike

Environments only help if they behave similarly. A common trap is a Staging Environment whose flag values drifted far from Production, so tests pass in Staging and fail in real life. Flagsmith lets you create a new Environment by cloning an existing one, which is a quick way to start from a known good set of values. Teams often review Staging and Production side by side before big releases to make sure they differ only where intended.

✓
Naming habit

Use the same Environment names in every Project: Development, Staging, Production. A newcomer who learns the pattern once can work in any Project without asking.

How a change travels from stage to stage

Teams that use Environments well follow a steady promotion path. A change is first made in Development, where it is cheap to be wrong. Once it behaves as intended, the same change is applied in Staging, where testers confirm it works together with everything else. Only then is it applied in Production, often with a small audience first. Because the feature definition is shared, the only thing that moves is the state, which makes each step small and easy to reverse.

1

Try it in Development

Engineers switch the feature on and off, check the screen and fix mistakes without any audience.

2

Rehearse it in Staging

Testers run the whole journey. Values are set exactly as planned for Production.

3

Release it in Production

The Release Group enables it for a small segment first, then widens step by step.

When three Environments are not enough

Some products add a few more. A quality assurance Environment gives a dedicated test team a stable place that developers do not disturb. A demo Environment lets a sales team show features to prospects without touching real data. Large companies sometimes add a regional Environment for a country that needs different behaviour. The rule is to add an Environment only when a group of people truly needs a separate set of values, because every extra Environment is one more place that can drift out of step.

6Features: The Heart of a Project

The word “feature” in Flagsmith is broader than a simple on and off switch. It covers three useful kinds of control.

Kind one: the standard flag

A standard flag is the plain switch. It is either enabled or disabled in each Environment. It can also carry an optional value, such as a short piece of text or a number, which lets one feature both switch something on and say how it should behave.

Kind two: remote configuration

Remote configuration means changing settings of a running application without releasing new code. Instead of fixing the number of items shown in a list inside the code, the application asks Flagsmith for the value. If the team decides the list should show twelve items rather than ten, they change the value in the dashboard and the app follows within moments. In Flagsmith, a feature’s value serves this purpose.

Kind three: multivariate features

A multivariate feature offers several possible values and splits users between them by percentage. For example, a button might say “Buy now” for forty percent of users, “Get it today” for thirty percent and “Add to basket” for another thirty. This is the foundation of experiments, where a team measures which version works best. The names of these options are defined in the Project, and the percentage split is chosen per Environment.

Simple

Standard flag

On or off, with an optional value. Best for releasing and hiding features.

Settings

Remote configuration

A value your app reads, such as a limit or a message. Best for tuning behaviour live.

Experiments

Multivariate

Several versions shown to percentages of users. Best for comparing alternatives.

Everyday analogy

A car dashboard has a few kinds of control. A switch turns the headlights on or off. A dial sets the heating temperature. A test track might try three different tyres on three groups of cars. The standard flag is the switch, remote configuration is the dial, and the multivariate feature is the three tyres test.

What a feature carries

Each feature has a name, which is how your code finds it, and a description, which explains in plain words what it controls. It may also have tags, a creation date and an owner. The name is permanent in practice: because code refers to it, renaming a feature carelessly can break an application. Treat names with the same respect you give names in a public interface.

Scenario: tuning during a sales peak

An online retailer expects heavy traffic on a big sale day. Its search page normally shows twenty results with rich previews. As a remote configuration value, the product team lowers the number to twelve and turns off the previews for the day. No release is needed, and engineers sleep better. After the sale, the values return to normal. The same idea is used by large retailers and streaming services to protect their systems at peak moments.

Choosing the right kind of feature

If you are unsure which kind to pick, ask a short series of questions. Is it only a question of showing or hiding something? Use a standard flag. Does the app need a number, a message or a limit that you want to adjust live? Use a value, which is remote configuration. Do you want to compare several versions with different groups of users? Use a multivariate feature. Many real features combine them: a flag that enables a new search page, together with a value saying how many results to show.

A feature’s value can be plain text, a number or a true or false answer. Keep the value simple. If a value starts to look like a whole document, the team is probably using the flag system as a database, which is a different job and best given to a proper data store. Good values are short enough to read at a glance in the dashboard.

7Feature Definition Versus Feature State

This chapter explains the single most important distinction inside a Project, and the one that confuses almost every newcomer.

Two different things with similar names

A feature definition is the existence of the feature: its name, its description, its type and its tags. It lives at the Project level and is shared by all Environments. A feature state is the live condition of that feature in one Environment: whether it is enabled, and what its value is. It lives in the Environment, so each Environment has its own state for every feature.

QuestionDefinitionState
Lives inThe ProjectAn Environment
AnswersDoes this feature exist, and what is it?Is it on here, and with what value?
How many copiesOne per ProjectOne per Environment
Changed byProduct team members with feature permissionsPeople with permission for that Environment
Risk if changedMay break code that uses the nameChanges what users see right now
Everyday analogy

A hotel has one list of room types: single, double, suite. That is the definition. Each night, each hotel branch records which rooms are booked. That is the state. Adding a new room type changes the list for every branch. Booking a room changes only one branch for one night.

Why the design is clever

Because the definition is shared, every Environment agrees on what features exist, so your code can ask for a feature by name and always get an answer in any stage. Because the state is separate, each stage can differ safely. A feature that is still unfinished can be on in Development and off everywhere else, and moving it forward is as simple as changing its state in the next Environment.

What happens when a new feature is created

When you create a feature in the Project, Flagsmith makes it available in every Environment, by default switched off, so that nothing changes for real users until someone deliberately turns it on. This safe default matters. Some Projects also have a setting that controls whether new features start in the on or off position, so it is worth checking which default your Project uses before creating anything important.

!
Watch out

Deleting a feature definition removes it from every Environment at once. If code still asks for that name, the application will fall back to its default value. Always confirm that no live code uses a feature before deleting it.

8Segments, Identities and Traits

A flag that is the same for everybody is useful. A flag that is different for different groups of people is powerful. Segments make that possible.

Identities

An identity is Flagsmith’s name for one end user or account that your application tells it about. It is usually a user ID. When the application asks for flags for an identity, Flagsmith can give an answer tailored to that person rather than a generic one.

Traits

A trait is a fact attached to an identity, such as “plan equals premium”, “country equals India” or “app version equals 4.2”. Applications send traits to Flagsmith, and Flagsmith remembers them for that identity.

Segments

A segment is a named rule that selects identities based on their traits, or on a percentage split. Examples: “premium customers”, “users in Germany on app version 5 or higher”, or “ten percent of all users”. Segments are defined once in the Project and can then be used by any feature in any Environment of that Project, which keeps rules consistent and easy to reuse.

flowchart LR
  APP["Your app sends identity and traits"] --> ID["Identity: user 4821"]
  ID --> T1["Trait: plan = premium"]
  ID --> T2["Trait: country = Germany"]
  T1 --> SEG1["Segment: Premium customers"]
  T2 --> SEG2["Segment: German users"]
  SEG1 --> RES["Feature value chosen for this user"]
  SEG2 --> RES
    
Fig 2. Traits on an identity decide which segments the user belongs to.
Everyday analogy

A cinema sells tickets to everyone, but offers a student discount to anyone who shows a student card and a seniors discount to anyone over sixty-five. The card or age is a trait. “Student” and “senior” are segments. The cashier is the evaluation. You do not need a separate cinema for each group.

Where segments are used

A feature in a particular Environment can have segment overrides, which say, “for this segment, use a different value from the default”. A feature can also have identity overrides, which say the same for one specific person. This is how a team can give a new feature to employees first, then to a pilot group, and finally to everyone.

Scenario: a staged rollout by customer group

A subscription video service is about to ship a redesigned home screen. It defines segments for “company staff”, “beta programme members” and “ten percent of all users”. In Production, the new screen is first enabled for staff, then for the beta group, then for ten percent, then for twenty-five, then for everybody. At every step the team watches error rates. Large streaming companies are known for exactly this style of careful, step by step exposure.

✓
Good habit

Give segments names that describe the people, not the feature. “Beta programme members” can be reused by ten features. “New home screen testers” can be used by one.

Writing good segment rules

A segment is made of one or more rules, and each rule compares a trait with a value. Common comparisons include “is equal to”, “is not equal to”, “contains”, “is in a list”, and, for numbers, “is greater than” or “is less than”. A special kind of rule splits users by percentage, which is how a team gives a feature to exactly ten percent of everyone. Rules can be combined, so that a person must match all of them, or any of them, depending on how the segment is built.

A percentage split is steady for each person: the same user lands in the same bucket every time, so a person in the first ten percent does not drop in and out as the app restarts. When the team widens from ten to twenty-five percent, the original ten percent stay included. This steadiness is what makes slow rollouts feel calm to users and clean to measure.

GoalSegment ideaTrait needed
Give staff early accessEmail domain is the company domainemail or a role trait
Roll out in one country firstCountry is equal to Indiacountry
Require a new enough appApp version is greater than or equal to 5.0app version
Reward loyal customersPlan is in the list of premium plansplan
Slow rollout to anyonePercentage split of ten percentnone, uses the identity itself

9How Flagsmith Decides the Final Value

When several rules could apply to the same person, there must be a clear order for who wins. Understanding this order removes most confusion about “why is my flag showing the wrong value?”

For any one feature, in one Environment, for one identity, Flagsmith works through the possible sources of a value in order, from the most specific to the most general, and stops at the first that applies.

flowchart TD
  START["Request: feature X for identity Y in Environment E"] --> Q1{"Is there an identity override for Y?"}
  Q1 -- Yes --> R1["Use the identity override value"]
  Q1 -- No --> Q2{"Does Y match a segment override?"}
  Q2 -- Yes --> R2["Use the value of the highest priority matching segment"]
  Q2 -- No --> R3["Use the Environment default value"]
    
Fig 3. The most specific rule wins. Identity first, then segment, then the Environment default.
1

Identity override

The most specific rule. It says “for this exact person, use this value”, and nothing beats it.

2

Segment override

If a person belongs to several segments with overrides, the segment placed highest in the priority order wins. That is why the order of segments matters.

3

Environment default

If nothing more specific applies, the feature’s normal value in that Environment is used.

Everyday analogy

A school has a general rule that phones stay in lockers. A class teacher may allow phones during a project, which is more specific. A doctor’s note allowing one student to carry a phone for health reasons is the most specific of all. The most specific rule wins, and the general rule applies only when nothing more specific does.

When the answer surprises you

If a person sees an unexpected value, walk down the ladder. First ask whether they have an identity override. Next ask which segments they belong to, and in what order those segments are ranked. Last, check the Environment default. Most puzzles end at step two, where two segments both match and the higher one wins. Also confirm that the application really is sending the trait the segment needs. A segment that depends on “country” will never match if the app never sends that trait.

!
Common trap

Traits sent as text can differ in small ways. “Premium”, “premium” and “PREMIUM ” with a trailing space may not match each other. Agree on one clean format for each trait, and keep it written down.

A worked example with three shoppers

Take the feature “checkout_new_payment_sheet” in Production. The Environment default is off. There is a segment override for “Staff” that turns it on, ranked first, and a segment override for “Ten percent of all users” that also turns it on, ranked second. There is one identity override that turns it off for a customer whose bank has reported a problem.

ShopperIdentity override?Segments matchedFinal valueReason
Asha, a staff memberNoStaff, maybe the ten percentOnThe Staff segment is highest and says on
Ben, an ordinary customer in the ten percentNoTen percentOnThe ten percent segment says on
Chloe, an ordinary customer outside the ten percentNoNoneOffThe Environment default applies
Dev, a staff member with a bank problemYes, offStaffOffThe identity override beats every segment

Working a few examples like this on paper is one of the best ways to build confidence. When a real report arrives that “the page is wrong for one user”, you can fill in a row like these for that person and find the answer in a minute.

10Tags, Owners and Naming Conventions

The boring habits are the ones that keep a Project healthy for years. Names and labels are the best examples.

Tags

A tag is a small coloured label that you attach to a feature. Tags have no effect on how a feature behaves. They exist purely to help humans sort, search and filter. Useful tags answer questions such as: what kind of flag is this (release, experiment, operational, permission)? Which team owns it? Is it temporary? Is it related to a particular project milestone?

Kind

Release

Hides unfinished work. Expected to be removed soon after the launch.

Kind

Experiment

Splits users for measurement. Lives for weeks, then is concluded and removed.

Kind

Operational

A safety valve engineers can use in incidents. May live for years.

Kind

Permission

Gives chosen customers or staff special access. Can be permanent.

Naming conventions

A good name tells a stranger what the feature does without opening the description. Teams commonly choose a consistent style, such as lower case words separated by underscores, and often begin names with the area of the product, for example “checkout_new_payment_sheet”. Flagsmith can enforce a pattern for feature names at the Project level, so mistakes are caught when the feature is created rather than months later. Check the Project settings to see how your version handles this.

Weak nameWhy it is weakBetter name
test_flag_2Says nothing about purposesearch_show_rich_previews
NewThingInconsistent style, vaguecheckout_new_payment_sheet
johns_featureTied to a person, not a purposeprofile_enable_dark_mode
flag_final_finalShows there was confusion beforemobile_offline_mode_release

Owners and descriptions

Every feature benefits from a short description and a named owner, which is a person or team responsible for it. When a flag has been on for six months and nobody knows why, the owner is the one who answers. Without owners, old flags pile up like unclaimed luggage.

Everyday analogy

A library without labels on its shelves is only a room full of books. Tags and clear names are the shelf labels. They turn a pile of switches into something people can browse, search and trust.

A tag family that works

Teams that keep tidy Projects usually keep their tags to a small family, often two kinds. The first kind describes what the flag is: release, experiment, operational or permission. The second kind describes who owns it: a team name such as payments, search or mobile. Adding a third kind, such as “remove by end of quarter”, can also help. More than three families tends to confuse people, and tags that nobody maintains are worse than none at all.

11Project Settings That Shape Everyday Work

A Project has a settings page. A few choices there quietly change how the whole team works, so they deserve a calm look on day one.

Name and identity

The Project has a name, which should match the product it serves, so that everyone recognises it. Pick a name that will still make sense in three years. “Mobile App” is better than “Q3 Mobile Experiments”, which will confuse people the moment the quarter ends.

Feature name rules

As mentioned earlier, many setups allow a rule for how feature names may be written, such as a required pattern or lower case only. Switching this on early prevents a messy mixture of styles and makes searching easier. Switching it on late can be awkward, because existing names may not match, so decide before the list grows.

What is sent to applications

Some Projects offer a choice to hide disabled flags from applications. If enabled, the application only receives flags that are currently on, which makes the data smaller and keeps unreleased feature names out of public view. This can matter for a website, where a curious visitor could otherwise look at the data and discover the name of an unannounced feature. The trade-off is that your code must handle the absence of a flag sensibly, which a safe default already does.

Defaults for new features

Another useful choice is what state a new feature starts in. The safest approach is for new features to start switched off in every Environment, so that creating a feature never changes what customers see. Check your Project’s behaviour so nobody is surprised.

Everyday analogy

When you move into a new flat, the first thing you do is learn where the fuse box is and decide the house rules, such as which door is locked at night. Project settings are the fuse box and the house rules. They are quick to set up at the start and awkward to change when many people are already living there.

✓
Check current options

Settings are added and renamed as Flagsmith evolves. Treat the ideas in this chapter as lasting principles, and read your own settings page to see exactly what your version offers.

Decisions to make on day one

Before the first real feature is created, a short meeting of fifteen minutes can settle four questions. What style of name will every feature follow? Which tags exist, and who may add new ones? What should happen when a new feature is created, switched off everywhere or not? And who is the named owner of the Project, so that questions have a single address? Writing the answers on one page and pinning it where the team looks daily costs almost nothing, and saves many small arguments in the months ahead.

12Project Permissions: Who Can Do What

The Organisation decides who belongs to the company. The Project decides which of those people may touch this particular product.

Two layers of control

Permissions inside a Project come in two layers. Project-level permissions control the shape of the Project: who may view it, who may create or delete features, who may manage segments, who may create tags, who may read the audit log and who may add Environments. Environment-level permissions control the values: who may change a feature’s state, who may manage identities and, where available, who may create or approve change requests. These can be given to individual people or, better, to groups.

LayerTypical questionExample permissionRisk if too wide
ProjectWho may shape this product’s feature list?Create and delete features, manage segmentsDeleted flags that code still depends on
ProjectWho may see our history?View the audit logExposure of internal activity
EnvironmentWho may change what users see?Update feature stateA wrong flip visible to customers
EnvironmentWho may look up or edit a person?Manage identitiesWrong overrides for real users

The principle of least privilege

Least privilege means giving each person only the power needed for their job. In a Project this usually means wide access in Development, narrower access in Staging and a very small group in Production. Many people can create features, but only a few can switch them on for real customers.

Everyday analogy

In a restaurant kitchen, any cook may adjust a dish while testing a new recipe in the back. Only the head chef signs off the dish that goes on the menu, and only the owner changes the prices. Power narrows as the cost of a mistake rises. Development, Staging and Production are the back kitchen, the tasting table and the dining room.

Groups make it manageable

Instead of listing individual names, give permissions to named groups, such as “Payments Team” or “Release Group”. When someone joins or leaves a team, you change the group, not dozens of separate permissions. Groups are created at the Organisation level and then attached to Projects.

!
Watch out

Exact permission names differ between Flagsmith versions and plans. Treat the layers and the principle as stable, and confirm the specific names in your own dashboard before writing an internal policy document. Some finer controls, such as custom roles and approval flows, are available on higher plans.

A sample permission grid for one Project

The grid below shows how a store team might arrange access. It is an example of a design, not a copy of real permission names, which differ between versions.

GroupProject shapeDevelopmentStagingProduction
Store TeamCreate features and segmentsChange valuesChange valuesView only
Release GroupViewViewChange valuesChange values, approve changes
SupportViewNo accessNo accessView, look up an identity
Platform TeamAdminister the ProjectFullFullEmergency use only

The pattern to copy is the narrowing towards Production, with one small group trusted to change what customers see. When that group is on call, they also carry the responsibility to leave a short note after any emergency change.

13Audit History, Webhooks and Integrations

A Project that nobody can observe is a Project nobody can trust. These tools make changes visible.

The audit log

The audit log is a diary kept by the Project. Every important change, such as a feature being created, switched on or edited, is recorded with the person, the time and what changed. When a customer reports that something vanished at three in the afternoon, the audit log turns guesswork into a quick lookup. How long history is kept can depend on your plan.

Webhooks

A webhook is an automatic message sent from Flagsmith to another system when something happens. A team may connect it to a tool that posts a note in a chat channel each time a Production flag changes, so everyone sees the change at once.

Integrations

Flagsmith also provides ready-made integrations with analytics, monitoring and communication tools, for example Datadog and Slack. When a flag change is lined up on a graph beside error rates, engineers can see within seconds whether a change helped or hurt. This pairing is powerful because most production incidents are caused by a change, and flags are changes.

1

A flag is changed in Production

The audit log records the person, the time and the old and new values.

2

A message is sent

A webhook or integration informs the team channel and the monitoring tool.

3

The graph shows the effect

Error rates and response times appear next to the marker for the change.

4

A quick decision is made

If the graph turns red, the flag is switched back within seconds, with no new deployment.

Everyday analogy

A bank branch has cameras and a signed ledger. Nobody expects theft, yet the records make everyone careful, and make honest investigation possible if something goes wrong. The audit log is the ledger, and the chat notification is the alarm bell.

i
Leave a note

When changing something important in Production, write a short reason in your team channel. “Lowered search results to protect the database during the sale” saves long debates later and teaches new colleagues how the product behaves under stress.

Choosing what to send where

It is tempting to connect every notification to every channel, but a flood of messages teaches people to ignore them all. A sensible approach is to send only Production changes to the main team channel, send Development changes nowhere, and send unusual events, such as a deleted feature, to a smaller channel watched by the owners. Fewer, clearer messages are read. Many messages are muted.

14How It Works Internally: From Project to Your Application

The dashboard is where people decide. A different path carries those decisions to millions of users. Seeing both paths makes the Project’s role clear.

Control plane and data plane

Architects divide systems into a control plane, where humans manage configuration, and a data plane, where high volume requests are served. The Project’s pages, such as creating features and editing segments, are part of the control plane. When an application asks “what is this flag?”, it uses the data plane, through an Environment key.

flowchart LR
  subgraph CP["Control plane"]
    ADM["Dashboard used by your team"] --> API["Management API"]
    API --> DB[("Primary database")]
  end
  subgraph DPL["Data plane"]
    LB["Load balancer"] --> FE["Flag evaluation service"]
    FE --> CACHE[("Cache")]
  end
  DB --> FE
  APP["Your web or mobile app with SDK"] --> LB
  SRV["Your backend with SDK"] --> LB
    
Fig 4. Decisions made in the Project reach applications through the data plane.

Following one lookup

1

The app starts

Its SDK holds an Environment key and a safe default for each flag it uses.

2

The SDK asks for flags

It sends the key, and optionally an identity and traits, to Flagsmith.

3

The rules are applied

Flagsmith finds the feature states of that Environment and applies overrides in the order from Chapter 9.

4

The answer returns

The SDK keeps a copy in memory and gives the value to the app.

5

The user sees the result

The feature appears or hides, with no release at all.

Notice that the Project never appears directly in that story. Its work was done earlier, when the team defined the feature and set the rules. At lookup time, only the Environment and its key matter. This division keeps the part that must be fast away from the part that must be careful.

Local evaluation

Some server SDKs can download the entire set of rules for an Environment once, and then decide flags inside your own server without asking again. This is called local evaluation. It greatly reduces delay and the number of requests, because decisions come from memory in microseconds. The cost is that updates reach the server on a refresh schedule rather than instantly.

Everyday analogy

A television network has an office where executives decide the schedule. That is the control plane. Separately, transmitters send the signal to millions of living rooms. If the executives go home, the broadcast carries on. The Project is where the schedule is planned. The Environment endpoints are the transmitters.

!
Design note

Always define a safe default for every flag in your code. The default is what users see if Flagsmith cannot be reached. Choose the one that causes the least harm, usually the old, proven behaviour.

Client-side and server-side SDKs

Not every SDK lives in the same place. A client-side SDK runs on the user’s own device, in a web browser or a mobile app. It uses the public client-side key and asks for flags for the current user. A server-side SDK runs on your own backend servers. It uses the secret server-side key and may ask for flags for many users, or download the entire rule set and decide locally.

ModeWhere it runsKey typeSpeedBest for
Client-side, remoteBrowser or phonePublic keyOne network call, then cachedShowing or hiding screens for one user
Server-side, remoteYour backendSecret keyA call per lookup or cachedSimple backend decisions
Server-side, local evaluationYour backendSecret keyMicroseconds, no network per decisionHigh traffic services and strict latency

The choice has a real effect on cost and speed. A mobile app asks once at start and caches, which is fine. A backend that makes ten thousand decisions per second should use local evaluation, so those decisions never leave the building.

15The Life of a Project

A Project is born, grows, is reorganised and, eventually, retires. Planning for each stage saves pain later.

1

Creation

A team creates the Project inside the Organisation, names it after the product and checks its settings. Starter Environments appear.

2

Setup

Environments are reviewed, naming rules are set, groups are attached and tags are agreed.

3

Connection

SDKs are added to the application using the Environment keys. Safe defaults are written in code.

4

Active life

Features are created, tested, rolled out and removed. Segments and overrides come and go. Most of the Project’s life is spent here.

5

Reorganisation

Teams split or merge, products change names. Ownership tags and groups are updated to match.

6

Retirement

When the product is switched off, the application stops calling Flagsmith, keys are revoked, and the Project is archived or deleted according to company policy.

Deleting a Project removes everything inside it. Because that is such a large step, many companies make it an administrator-only action and require a short written note first. Before deleting, make sure no application still holds a key to one of its Environments.

Everyday analogy

A shop opens, stocks shelves, trades for years, rearranges its layout and finally closes. A careful owner does not just lock the door. They cancel the supplier accounts, return the keys and clear the shelves. Retiring a Project deserves the same care.

A checklist before retiring a Project

  • Confirm the product itself is switched off, and that no customer can still reach it.
  • Search all code repositories for the Project’s Environment keys and remove them.
  • Export or screenshot anything you need to keep, such as the list of features and segments for the historical record.
  • Tell the groups attached to the Project, so nobody is surprised.
  • Revoke the Environment keys, wait a short while to see whether anything complains, and only then delete the Project.

16The Life of a Single Flag Inside a Project

The Project exists to host flags, and every flag should have a short, planned life.

flowchart LR
  A["Create feature in Project"] --> B["Enable in Development"]
  B --> C["Test in Staging"]
  C --> D["Release gradually in Production"]
  D --> E{"Stable and fully released?"}
  E -- Yes --> F["Remove flag from code"]
  F --> G["Delete or archive the feature"]
  E -- No --> H["Adjust or switch off"]
  H --> D
    
Fig 5. A release flag travels through Environments, then is removed once the work is done.

The stages in words

Create. The feature is defined once in the Project, with a clear name, description and tags. Develop. It is switched on in Development while engineers build. Test. It is switched on in Staging for testers. Release. It is introduced to real customers in Production, usually through segments and percentages. Stabilise. The team watches the product for a while. Remove. Once the feature is fully released and stable, the flag is taken out of the code, and the feature is deleted or archived in the Project.

The last two steps are the ones most often forgotten. A flag that stays forever turns into hidden complexity: every extra flag doubles the possible combinations of behaviour that the code can take, and old code paths grow dangerous because nobody tests them.

The best flag is the one you remembered to delete.

Scenario: a cautionary tale from finance

One of the best known software disasters involved the trading firm Knight Capital in 2012. In widely reported accounts, a release reused an old switch that woke up long-dead code on a server that had not been updated, and the firm lost roughly four hundred million dollars in about forty-five minutes. Details have been debated, but the lessons for any Project are plain: remove old flags, never reuse the meaning of an old flag name, and make sure every server runs the same version of the code.

Plan the ending on the first day

The easiest way to avoid stale flags is to decide how a flag will end at the moment you create it. Add a short note to the description, such as “remove after full release, owner: payments team”. Some teams also create a ticket for the removal at the same time as the flag, and link the two. When the feature reaches everyone and the calm period passes, the ticket is already waiting. Without this habit, removal competes with every new feature for attention, and removal tends to lose.

17How Many Projects? Designing Your Layout

The biggest design choice is what a Project should represent. Here are the common shapes, with their reasons.

Pattern 1

One Project per service

Each microservice has its own Project. Good when teams are independent and each owns one service end to end.

Pattern 2

One Project per product

Several services forming one customer-facing product share a Project, so one flag can span front end and back end.

Pattern 3

One Project per platform

Web, iOS and Android of the same product share a Project, so a feature is switched on everywhere together.

Pattern 4

A shared platform Project

Features used by many teams, such as maintenance switches, live in one Project owned by a platform team.

graph TD
  ORG["Organisation"] --> PA["Project: Web and Mobile Store"]
  ORG --> PB["Project: Payments"]
  ORG --> PC["Project: Platform Shared Switches"]
  PA --> A1["Development"]
  PA --> A2["Staging"]
  PA --> A3["Production"]
  PB --> B1["Development"]
  PB --> B2["Staging"]
  PB --> B3["Production"]
  PC --> C1["Development"]
  PC --> C2["Staging"]
  PC --> C3["Production"]
    
Fig 6. A common layout: product Projects plus one shared platform Project, each with the same three Environments.

How to choose

Ask three questions. First, do two parts of the system need to share the same switch? If yes, they probably belong in the same Project, because a feature belongs to only one Project and cannot be shared across them. Second, do the teams have different owners and different access rules? If yes, separate Projects give a natural wall. Third, how many features will the Project hold? A Project with several thousand features becomes hard to navigate, and that is often a hint to split by product area.

Everyday analogy

Think of how a city divides services. A neighbourhood has its own library, but the whole city shares one water supply. Switches that matter to one neighbourhood live in that neighbourhood’s Project. Switches that matter to the whole city, such as a global maintenance mode, live in a shared one.

✓
Rule of thumb

Mirror the way your teams actually own code. Amazon’s famous small teams each owning a service from end to end is a good model: a team that owns it, owns its Project. The tree then reflects reality, and people find things where they expect.

Three layouts for three kinds of company

A small startup with one product. One Project holds everything. Three Environments are enough. The team avoids splitting early, because splitting adds ceremony without adding clarity.

A mid-sized company with a handful of products. One Project per product, each owned by its team, plus a small shared Project for global switches such as a maintenance banner. Groups attach to Projects. This is the most common shape.

A large company with many microservices. A Project per team or per cluster of closely related services, so that ownership matches the organisation chart. Cross-service switches live in a shared Project that a platform team owns. A naming rule begins every Project with its team name so the long list stays readable.

A frequent question: one Project per customer?

If you run a business-to-business product with hundreds of customers, do not create a Project for each. A Project represents a product, not a customer. Different behaviour per customer is the job of identities, traits and segments, which let one feature behave differently for many customers inside a single Project. Creating a Project per customer multiplies setup, drifts definitions apart and makes cleanup nearly impossible.

18Worked Example: Setting Up a Project for an Online Store

Ideas become clear when applied. Let us build a Project for a fictional company called Northwind Retail.

The situation

Northwind sells goods through a website and a mobile app. A team of about twenty engineers, designers and product managers works on both. They want to launch a new checkout page, tune their search page during sales and offer early access to loyal customers.

Step by step

1

Create the Project

Name it “Store”. The website and the app are one customer-facing product with shared features, so one Project serves both.

2

Check the Environments

Keep Development, Staging and Production. Add no more until a real need appears.

3

Set naming rules

Lower case words with underscores, starting with the area: checkout, search, profile.

4

Create tags

Release, experiment, operational and permission, plus one tag per team.

5

Create features

checkout_new_payment_sheet (release), search_result_limit (remote configuration), search_rich_previews (operational), loyalty_early_access (permission).

6

Create segments

“Staff”, “Loyalty members” and “Ten percent of all users”.

7

Set permissions through groups

Store Team may edit Development and Staging. Release Group may edit Production. Support may view Production.

8

Connect and rehearse

Add SDKs with Environment keys, write safe defaults and connect a chat notification for Production changes.

FeatureKindDevelopmentStagingProduction
checkout_new_payment_sheetRelease flagOn for everyoneOn for testersOff at first, then staff, then ten percent, then everyone
search_result_limitRemote configurationTwentyTwentyTwenty normally, twelve in sale peaks
search_rich_previewsOperational flagOnOnOn, switched off if the database is stressed
loyalty_early_accessPermission flagOnOnOn only for the loyalty segment

A day in the life

On Monday, a developer creates a new feature in the Project and enables it in Development. On Wednesday, a tester sees it in Staging. On Friday, the Release Group enables it in Production for staff only. The next week it moves to ten percent of users, and the team watches error rates on a graph connected to the Project. When all is calm, it goes to everyone. A month later, the developer removes the flag from the code and deletes the feature. The audit log holds the whole story.

Everyday analogy

It is like opening a new shop counter. First you rehearse behind a curtain with staff. Then you invite friends. Then you open the door to a few shoppers, watch how it goes, and finally take down the curtain for good. The flag is the curtain, and good practice means you do take it down eventually.

19Advantages, Disadvantages and Trade-offs

Every design has strengths and costs. Knowing both lets you decide with open eyes.

Advantages

  • One clear home for every feature of a product, with a single list to search.
  • Definitions shared across stages, so code can rely on a feature existing everywhere.
  • Separate Environments keep experiments away from real customers.
  • Reusable segments keep targeting rules consistent across many features.
  • Project-level permissions let a team own its product without opening up the whole company.
  • A built-in history makes changes traceable and reversible.

Disadvantages and trade-offs

  • A feature belongs to only one Project, so sharing one switch across Projects needs a plan.
  • Creating a feature creates it in every Environment, which adds clutter if overused.
  • Too many features in one Project make the list hard to navigate without tags and names.
  • Too many Projects fragment ownership and multiply permission setup.
  • Flags create hidden code paths that must be cleaned up with discipline.
  • Teams must agree on conventions, because the tool will not invent them.

The central trade-off: big Projects or small Projects

A big Project gives a single view of the whole product and makes it easy to share features between parts. It also gives everyone in it the same list, which can become crowded and risky when many teams touch it. Small Projects give clean walls and clear owners, but a switch that spans two services needs to be duplicated or coordinated. Most mature companies land in the middle: one Project per product or per team, with a small shared Project for truly global switches.

Build or buy

Many teams begin with a homemade solution such as a configuration file or a database table. For a handful of switches that is perfectly reasonable. As the product grows, someone must add a dashboard, permissions, history, fast delivery and security. Each is a small project, and together they become a product that does not earn money for the company. The Project model, with its definitions, Environments, segments, permissions and history, is the set of features that homemade systems tend to lack and later regret. If you expect more than a few dozen flags, or more than a few people changing them, a managed structure usually repays its cost.

When a flag is not the right tool

Flags are wonderful for behaviour that changes often, but they are not for everything. If a value is a true business rule that needs a proper audit and legal review, such as a tax rate, it belongs in a controlled data store. If something needs complex relationships and queries, it belongs in a database. And if a change is truly permanent and risk free, it is simpler to put it straight into the code. A healthy Project holds switches and settings, not the whole configuration of the company.

20Anti-patterns and Common Mistakes

These traps appear in almost every company that adopts feature flags. Learn them now, and avoid paying for them later.

ANTI-PATTERN 01Avoid
The mistake

One giant Project for the whole company.

Why it hurts

Thousands of features from dozens of teams share one list. Nobody knows which are theirs, permissions become coarse and a mistaken deletion can hurt unrelated products.

Do this instead

Create a Project per product or per team, and keep a small shared Project for truly global switches.

ANTI-PATTERN 02Avoid
The mistake

A new Project for every Environment, such as one for testing and one for live.

Why it hurts

Feature definitions drift apart, and the clean path from Development to Production is broken. People start copying values by hand.

Do this instead

Keep all stages as Environments inside one Project, so definitions are shared and only states differ.

ANTI-PATTERN 03Avoid
The mistake

Flags that live forever.

Why it hurts

Old flags leave dead code paths that nobody tests. Combinations of flags multiply, and a future change may wake something dangerous.

Do this instead

Give every release flag an owner and an expected end date, and review them regularly.

ANTI-PATTERN 04Avoid
The mistake

Vague, personal or inconsistent names.

Why it hurts

Months later nobody can tell what “test_flag_2” does, so nobody dares delete it.

Do this instead

Agree on one naming style and enforce it through the Project settings where possible.

ANTI-PATTERN 05Avoid
The mistake

Reusing an old flag name for a new purpose.

Why it hurts

Old code anywhere may still read that name and behave in a surprising way. This is the lesson of the Knight Capital story.

Do this instead

Always create a fresh name for a fresh purpose. Names are cheap, and surprises are expensive.

More small mistakes worth naming

  • Forgetting a safe default in code, so a flag outage becomes a product outage.
  • Letting Production permissions widen over time, because “just this once” was never undone.
  • Sending traits in inconsistent formats, so segments silently stop matching.
  • Changing a feature’s value in Production before testing it in Staging.
  • Using a Production key in a test build, which is exactly what separate Environment keys are there to prevent.

Spotting the warning signs early

Anti-patterns rarely arrive suddenly. They grow quietly, and a few simple signs tell you when to act. If new team members ask “what does this flag do?” more than once a week, your names and descriptions are failing. If the list of features is longer than anyone can scroll comfortably, it is time to split or clean. If Staging and Production disagree on many values, drift has begun. And if nobody can name the owner of a Production flag within a minute, ownership has been lost.

21Failure Scenarios and Recovery

Things will go wrong. Calm teams are the ones that already know what to do.

Scenario one: the wrong flag was flipped in Production

The first move is to put it back to its previous value. The audit log shows what that was. Only after customers are safe should you ask how it happened. Teams that rehearse this typically recover in a minute or two.

Scenario two: a feature was deleted but code still uses it

The application falls back to its coded default for that flag. If the default was chosen sensibly, users see the old behaviour and little is lost. If the default was careless, the feature misbehaves. Recreate the feature with the same name, restore its states from what the history shows, and then plan the proper removal from code before deleting again.

Scenario three: a segment matches the wrong people

A typing slip in a rule, such as “equals” where “contains” was meant, can include or exclude thousands of users. Check the rule, check the trait values the app actually sends, and use the segment override order to confirm which rule was applied. Testing a segment in Staging with real examples before Production avoids most of these.

Scenario four: Staging and Production drifted apart

Tests pass but real customers see problems. Compare the two Environments side by side, align them where they should match, and add a regular comparison to your release checklist.

Scenario five: an Environment key is leaked

1

Judge the kind of key

A client-side key is meant to be public. A server-side key is secret, and a leak is serious.

2

Create a replacement

Make a new key first, so real systems can be updated without downtime.

3

Roll it out and revoke the old one

Update applications and secrets stores, then delete the leaked key.

4

Review the audit log

Look for unfamiliar changes during the exposure, and reverse anything suspicious.

Scenario six: Flagsmith is unreachable

Applications should be designed so that the worst case is boring. SDKs can keep serving the last known values, and your code supplies defaults for anything missing. For a flag that protects something essential, such as the ability to log in, decide the default carefully and test that path on purpose.

RUNBOOK NOTEKeep handy
Write these down

Who owns the Project, who may change Production, how to find a flag’s previous value, how to rotate a key, and who to tell. If any answer is “I would have to search for it”, write it down today.

Everyday analogy

Aircraft crews rehearse engine failures long before one happens. The checklist is on a card and they follow it without trying to be clever under stress. A runbook for your Project is that card.

Scenario seven: a scheduled change goes out at the wrong time

On plans that support scheduling, a team can set a flag to change at a chosen moment, such as nine in the morning on launch day. The risk is a time zone mix-up. Always confirm the time zone shown on screen, rehearse the schedule in Staging, and name a person to watch the launch moment instead of trusting the schedule blindly.

Scenario eight: the plan limits are reached

If applications ask for flags far more often than expected, the account can approach the request allowance of its plan. What happens next depends on the plan, so learn it in advance. Set up a usage alert at a comfortable margin below the limit, and look for the application behaviour that causes the surge, such as asking for flags on every scroll.

22Security Inside a Project

A flag platform can change what every customer sees. Treat it with the same care as a deployment system.

The three kinds of key

Public

Client-side key

Belongs to an Environment, is safe to place in websites and mobile apps, and can only read flag values.

Secret

Server-side key

Belongs to an Environment and must stay on your own servers. It unlocks richer reading, such as local evaluation.

Master

Organisation key

Lives above the Project and can manage Flagsmith itself. Treat it like a master key and never place it in an application.

Everyday analogy

A hotel gives guests a room card for one door, cleaners a floor card for many doors, and keeps one master key in a safe. The client-side key is the guest card, the server-side key is the floor card, and the Organisation key is the master key. You never hand the master key to a guest.

Practical protections

  • Separate keys per Environment. A test build should never hold a Production key.
  • Store secrets in a vault. Never in chat messages, documents or code files.
  • Rotate on a schedule. Replace keys every few months and after any staff change that could have exposed them.
  • Hide unreleased names. Where the option exists, hide disabled flags from client applications so unannounced features are not visible in public data.
  • Limit Production changes. Give that power to a small, named group, and consider approval flows on plans that offer them.
!
Danger

Automated scanners crawl public code sites around the clock, looking for leaked secrets, and they find them within minutes. If a server-side or Organisation key is ever pasted into a public repository, assume it is compromised, even if you delete the file seconds later.

Scenario: a leaked credential in a repository

Public reporting has repeatedly shown how often secrets end up in code repositories. A widely reported 2016 breach at a major ride-hailing company is often cited, because attackers reportedly found credentials stored in a repository. The lesson applies directly to flag platforms: a secret key that has ever touched a repository should be treated as exposed the moment more people can read that repository than should hold the key.

A short security conversation for every new team

When a new team joins a Project, hold a ten minute conversation that covers four things. Which keys will you use, and where will they be stored? Who on the team may change Production, and how will others ask for a change? What is the safe default for each flag, and has it been tested? And how will you notice if something goes wrong, and who will you tell? These four questions turn abstract security rules into habits that a team can recall at three in the morning.

23Monitoring, Hygiene and Stale Flags

A Project, like a garden, needs regular weeding. The good news is that the weeding is simple and the tools help.

What is a stale flag?

A stale flag is a flag that has served its purpose but is still in the Project and in the code. Typically it has been fully on, or fully off, in every Environment for months. It no longer protects anything, and yet it adds complexity. Newer versions of Flagsmith offer help in spotting such features, and you can also find them by looking at tags and last-changed dates.

A monthly hygiene routine

  • List old release flags. Filter by the “release” tag and sort by how long they have been unchanged.
  • Ask the owners. A short message in the team channel is usually enough to confirm which can go.
  • Remove from code first. Delete the flag check, release the code, and only then delete the feature from the Project.
  • Review segments. Remove those no feature uses and tidy names.
  • Review permissions. Compare who can change Production with your policy page.
  • Read a sample of the audit log. Confirm that changes match expectations.

What to measure

Age
How long each release flag has lived
Count
How many flags the Project holds, and the trend
Reversal
How fast a bad change is undone
Everyday analogy

A kitchen cupboard that nobody ever cleans fills up with expired tins and forgotten jars. One day you need a specific spice and cannot find it among the clutter. A monthly tidy takes ten minutes and keeps the cupboard trustworthy. Flag hygiene is the same habit applied to software.

Who is responsible for what?

A simple table called a RACI says who is Responsible (does the work), Accountable (owns the result), Consulted (gives input before) and Informed (told afterwards). Here is a sample for activities inside one Project.

ActivityProduct teamRelease groupPlatform teamSecurity team
Create a feature in DevelopmentAccountableInformedNot involvedNot involved
Change a flag in ProductionConsultedResponsibleInformedInformed
Retire an old flagAccountableInformedConsultedNot involved
Rotate server-side keysInformedInformedResponsibleAccountable
Delete the ProjectConsultedInformedResponsibleAccountable

The table is short on purpose. A one page agreement that people actually read beats a fifty page policy that is signed once and forgotten. Where a rule can be enforced by a setting, enforce it with the setting rather than a reminder email.

Two lanes of change

Not every change deserves the same care. The standard lane covers routine changes, such as moving a rollout from ten to twenty-five percent, and needs only the normal permission. The emergency lane covers urgent actions, such as switching off a failing feature, and is intentionally fast. The emergency lane must still leave a trail: a note in the incident channel, and a short review the next working day.

24Scaling to Thousands of Flags and Millions of Requests

What changes when a Project grows from a dozen flags to thousands, and from a few users to millions?

Scaling the list

The Project scales through structure. At twelve flags anyone can remember them all. At twelve hundred nothing works without tags, naming rules, owners and regular cleanup. A common step is to split by product area once a Project becomes too large for one team to understand, while moving truly shared switches into a small platform Project.

Scaling the traffic

Volume is handled in the data plane. Applications serving millions of users should not ask Flagsmith a fresh question for each page view. Instead they use the caching and local evaluation behaviours of the SDKs, so only a small trickle of requests ever leaves their own network. Some deployments also place a lightweight proxy close to their applications, which answers most questions from a local copy.

flowchart LR
  U["Millions of users"] --> APPS["Your application servers"]
  APPS --> SDK["SDK with local cache"]
  SDK -- "periodic refresh" --> PROXY["Optional local proxy"]
  PROXY -- "occasional sync" --> FS["Flagsmith platform"]
  FS --> PRJ["Project and Environment rules"]
    
Fig 7. Layers of caching keep millions of user requests away from the central platform.

A small capacity thought experiment

Suppose an application serves one hundred thousand requests per second at its busiest moment. If every request caused a fresh flag lookup, the platform would need to answer one hundred thousand questions per second, which is wasteful. With caching inside each application server, perhaps only one lookup per server every thirty seconds is needed. With two hundred servers, that is about seven requests per second, a reduction of over ten thousand times, and the user still gets a decision in microseconds from memory.

This is why architects who build for scale talk about moving decisions closer to where they are used. The same idea appears in content delivery networks, in database read replicas and in the local caches of large retailers and streaming companies.

Resilience

High availability means the system stays usable even when parts fail. Flagsmith’s design helps in three ways. Delivery of flags is separate from the dashboard, so a dashboard outage does not stop evaluation. SDKs can keep serving the last known values if the network is down. And your own code can define defaults, so the worst case is a safe and familiar experience rather than an error page.

Everyday analogy

A city does not ask the central water plant every time someone turns a tap. Water is stored in local towers, which keep houses supplied even if the plant has a short problem. SDK caches and local proxies are those towers.

Three habits that keep large Projects fast

Ask once, decide many times. Fetch flags at the start of a session or on a timer, and let the app make hundreds of decisions from memory. Fetch only what you need. Where the option exists, hide disabled flags or fetch a single flag, rather than downloading everything for every call. Keep defaults close to the code. A well chosen default means a slow or missing answer from Flagsmith is only a small inconvenience, never an outage.

Companies that handle very large traffic, such as Netflix and Google, speak often about designing for failure and for cost. A flag lookup is a network call like any other, and good architects treat each call as something worth designing, not something to discover on an invoice.

25Moving Existing Switches into a Project

Few teams start from nothing. Most already have switches hidden in configuration files, environment settings and database tables. Adoption is about bringing order to what exists.

The four kinds of flag

Practitioners often sort flags into four groups, a classification popularised by engineers writing on well known software design sites. Release flags hide unfinished work and are short lived. Experiment flags split users to measure which version performs better, and live for weeks. Operational flags let engineers reduce load or disable heavy features in incidents, and may live for years. Permission flags give certain customers or staff special access and may be permanent. Knowing the kind tells you how long a flag should live and who should be allowed to change it.

1

Take inventory

Search code and configuration for existing toggles. List what each does, who owns it and whether it is still needed.

2

Set up the Project shape first

Create the Project, Environments, naming rules, tags and groups before anyone moves in.

3

Pilot with one friendly feature

Pick a real, low risk feature. Let the team find the rough edges while stakes are small.

4

Write down what you learned

Update the naming rules and the one page policy based on the pilot.

5

Migrate in waves

Move switches a few at a time. Retire the old mechanism as each is moved, so two systems never run side by side for long.

6

Measure the outcome

Track how long a release takes, how often a rollback is needed and how quickly a bad change is reversed.

Training the people

A tool alone changes little. People need to learn three habits: always release behind a flag, always define a safe default, and always remove the flag when the work is done. A short workshop and a one page cheat sheet beat a long manual. It also helps to appoint a flag champion in each team, someone who answers questions and keeps naming consistent.

Scenario: an e-commerce company before and after

Before adoption, a retailer changed behaviour by redeploying code, which took an hour and needed engineers on call. After adoption, a product manager with the right permission can reduce a heavy recommendation feature during a sales peak in seconds, while the history records exactly what happened. The change was not only the tool, but the clear Project structure that made it safe to hand that power to the right people.

✓
Success signal

You know adoption is working when nobody is afraid of releasing on a busy afternoon, because everyone knows a switch exists to go back.

How to tell it is working

After a few months, look at four simple measures. Release frequency: are teams shipping more often? Reversal time: how long does it take to undo a bad change? Flag age: are release flags being removed on schedule? Surprise count: how many times did someone say “I did not know that flag was on”? Falling surprise counts are the clearest sign that the Project has become the single source of truth.

26Best Practices Checklist

A short list to keep nearby. If you do these ten things, you will avoid most of the pain described in this guide.

01

One Project per owner

Mirror how your teams own code, so each product has one clear home.

02

Same Environments everywhere

Use Development, Staging and Production in every Project, with the same names.

03

Name with care

Agree on a style, enforce it in settings and make names describe purpose.

04

Tag every feature

Mark the kind and the owning team so searching and cleanup are easy.

05

Always code a default

Choose the safest behaviour for when the flag service is unreachable.

06

Grant through groups

Wide in Development, narrow in Production, and never directly to individuals.

07

Keep secrets secret

Separate keys per Environment, stored in a vault and rotated on a schedule.

08

Make changes visible

Send Production changes to chat and monitoring, and leave short notes.

09

Reuse segments

Name segments after people, not features, so they serve many features.

10

Remove old flags

Take the flag out of the code first, then delete the feature from the Project.

27Glossary: Every Term in One Place

Keep this table nearby while reading the documentation or talking with your team.

TermPlain meaning
Feature flagAn on and off switch inside software that decides whether a feature is visible.
Remote configurationChanging settings of a running application without releasing new code.
OrganisationThe top-level container holding people, Projects, rules, keys and billing.
ProjectThe home of one product’s features, segments, tags and project rules.
EnvironmentOne stage, such as Development or Production, holding the live values of features.
Feature (definition)The existence of a flag, shared across all Environments of a Project.
Feature stateThe current on or off value of a feature in one Environment.
Multivariate featureA feature with several possible values split between users by percentage.
IdentityAn end user or account whose flags are being worked out.
TraitA fact attached to an identity, such as country or plan name.
SegmentA rule that selects a group of identities, such as everyone on the premium plan.
Segment overrideA different value of a feature for a particular segment in one Environment.
Identity overrideA different value of a feature for one specific identity.
TagA label used to organise and search features.
GroupA named collection of members sharing permissions, created in the Organisation.
Least privilegeGiving each person only the power needed for their job.
API keyA secret string that proves a request is allowed.
Client-side keyAn Environment key that is safe to place in public apps and only reads flags.
Server-side keyA secret Environment key used only on your own servers.
SDKA ready made library that lets your application talk to Flagsmith.
Local evaluationDownloading rules once and deciding flags inside your own server.
Control planeThe part of a system where humans manage configuration.
Data planeThe part that serves high volume requests from applications.
Audit logA diary of who changed what and when.
WebhookAn automatic message sent from one system to another when something happens.
Stale flagA flag that has served its purpose but still remains in code and in the Project.
RotationReplacing a secret key with a new one and deleting the old one.
Safe defaultThe value your code uses when it cannot reach Flagsmith.

28Frequently Asked Questions

Quick answers to the questions that come up most often when people first meet the Project.

Q1What is the difference between a Project and an Environment?
A Project is the home of one product and holds its feature definitions, segments and tags. An Environment is one stage inside that Project, such as Development or Production, and holds the live values and keys for that stage.
Q2Can I create a feature in only one Environment?
No. A feature is defined at the Project level and therefore exists in every Environment. You control where it is switched on, not where it exists.
Q3Can two Projects share one feature?
Not directly. A feature belongs to one Project. If two parts of a system need to share one switch, put them in the same Project, or keep a small shared Project and have both parts read from it.
Q4How many Projects should I create?
There is no magic number. A good rule is one Project per product or per owning team, plus a small shared Project for global switches. If one Project becomes too large for a team to understand, consider splitting by product area.
Q5Are segments shared across Projects?
Segments are defined in a Project and are used by the features of that Project. If two Projects need the same rule, you recreate it in each, so keep rule definitions written down.
Q6Which rule wins when several apply to one user?
The most specific. An identity override beats a segment override, and a segment override beats the Environment default. If several segments match, the one ranked highest in priority wins.
Q7What happens to flags if the Flagsmith dashboard is down?
Flag delivery is designed to be separate from the dashboard, and SDKs can keep serving cached values. Always include safe defaults in your code as a final safety net.
Q8Is it safe to put a client-side key in a mobile app?
Yes, that is its purpose. It only reads flag values for one Environment. Never place a server-side or Organisation key in an app or web page.
Q9Should I create a separate Project for testing?
Usually not. Use a Development or Staging Environment inside the same Project, so feature definitions stay shared. A separate Project is for a separate product.
Q10When should I delete a feature?
After the flag check has been removed from all code and that code has been released everywhere. Deleting a feature that code still asks for makes the application fall back to its coded default.
Q11How do I stop people changing Production by mistake?
Give Production permissions to a small named group, use clear and identical Environment names, send changes to a team channel, and on plans that offer it, require approval for changes.
Q12Why do some features differ by plan?
Advanced governance features, such as custom roles, approval flows and longer history, are typically aimed at larger organisations and sit on higher plans. Check the current plan comparison in your account.

29Summary and Key Takeaways

Remember these seven ideas

  • A Project is the home of one product. It holds the feature definitions, segments, tags, permissions and history, and sits between the Organisation above and the Environments below.
  • Definition and state are different. A feature is defined once per Project, but its value is stored separately in each Environment, which is what makes careful staged releases possible.
  • The most specific rule wins. Identity overrides beat segment overrides, which beat the Environment default, so always walk that ladder when a value surprises you.
  • Structure keeps flags healthy. Consistent names, clear tags, named owners and identical Environments turn thousands of switches into something people can trust.
  • Least privilege protects Production. Wide access in Development, narrow and recorded access in Production, granted through groups.
  • Always code a safe default. If Flagsmith is unreachable, your product should behave in the old, proven way rather than fail.
  • Every flag should have a planned ending. Remove the flag from the code first, then delete the feature, and review for stale flags on a regular schedule.