The Feature in Flagsmith

The Feature in Flagsmith

What a feature really is inside Flagsmith, how it is built, how it behaves in every environment, how applications read it, and how to look after it from the day it is born until the day it is deleted, explained from the very first idea to production-grade practice.

Imagine a large hotel with hundreds of rooms. At the front desk sits a single board holding one key hook for every room. Each hook has a label: the room number and a short description. The label never changes, but the hook may hold a key or may be empty, and a guest in room 304 does not care about room 512. Hotel staff can look at the board and instantly know which rooms are open and which are not.

A feature in Flagsmith works much like one of those labelled hooks. It is the named thing, such as “new checkout” or “dark mode” or “maximum upload size,” that your team wants to control. The name and description stay the same for everyone. What changes is the answer: is it switched on, what is its value, and for whom? Flagsmith stores the name once and keeps the answers in a careful, organised way, so that teams can change behaviour in a live product without writing and releasing new code.

This guide teaches the feature from the ground up. We will learn what a feature is, what it is made of, the different kinds of features, how to create one safely, how it behaves in different environments and for different users, how your application reads it, how to organise hundreds of them, how to protect them, and how to avoid the mistakes that trip up many teams. We assume you know nothing yet. Every new word is explained the first time it appears, and every big idea comes with an everyday comparison.

One name
a feature is defined once for the whole project
Many answers
each environment and each user group can differ
Zero releases
changing a feature needs no new code deployment
i
Tip

Flagsmith is a living product. Screen names, plan limits, and some options change between versions. This guide teaches the lasting ideas. When you need an exact button name, price, or limit, check the official Flagsmith documentation for the version you use.

1Why Teams Need Features They Can Control

Before learning how Flagsmith models a feature, let us feel the problem it solves: the problem of changing a live product without fear.

What do we mean by a software feature?

In everyday speech, a feature is any capability of a product that users can notice. A search box is a feature. A “pay with a saved card” button is a feature. A new recommendation engine is a feature. Even a number, such as the maximum size of a file a user may upload, can be treated as a small feature, because changing it changes what users can do.

The old way: features hidden inside releases

In the traditional way of building software, a feature was tied to a release. The developers wrote the code, tested it, packed it into a new version of the product, and put that version live. The moment the new version reached the servers, every user saw the new feature. If the feature had a hidden bug, every user met it at the same time. If the business wished to change the feature, for example to reduce a limit from fifty files to twenty, a developer had to change the code, test again, and release again.

This meant that three different decisions were glued into one event: when the code is written, when the code is put on servers, and when users see the behaviour. Gluing them together made every release feel like a high-stakes performance.

What teams really want

Want 1

Separate code from exposure

Put new code on servers early, but show it to users only when everyone is ready.

Want 2

Small, careful audiences

Show a new capability to employees first, then a few customers, then everyone.

Want 3

Instant reversal

Turn a faulty capability off in seconds, without waiting for a new release.

Want 4

Tunable behaviour

Change limits, messages, and settings while the product is running.

Want 5

Business control

Let product and support staff change what users see, with proper permissions, without waking an engineer.

Want 6

A clear list

Keep one organised list of everything that can be switched, with owners and history, instead of settings scattered across many files.

Analogy

Think of a theatre. The stage crew can build a new set behind a closed curtain while the current play continues in front. Building the set is like writing and deploying code. Opening the curtain is like releasing the feature. A Flagsmith feature is the curtain rope: a simple, labelled control that lets the right person open or close the curtain at the right moment, without rebuilding the stage.

A short story

Kavya works at an online learning platform. Her team has built a new “live class reminder” that sends a notification fifteen minutes before a class begins. Instead of releasing it to all two million learners at once, the team wraps it in a Flagsmith feature. On Monday it is switched on for the team’s own accounts. On Tuesday it is on for one percent of learners. A dashboard shows that reminders arrive late for people in one region, so the team pauses, fixes a scheduling bug, and continues. By Friday every learner has the reminder, and nobody ever saw a broken version. The code had been on the servers since Monday morning. Only the feature’s state changed.

A feature in Flagsmith is a small, labelled control that turns a risky release into a calm, reversible decision.

2What Is a Feature in Flagsmith?

In Flagsmith, a feature is a named item, defined once inside a project, that can carry an on and off position, a stored value, or both, with a separate answer in every environment.

A quick map of the Flagsmith world

Flagsmith is an open-source platform for feature flags and remote configuration. A feature flag is a switch that turns behaviour on or off without a new release. Remote configuration means storing values, such as numbers and text, that an application reads while running, so that they can be changed without a release. Flagsmith arranges everything in a simple tree.

1

Organisation

The top level, usually a whole company. It contains the people, teams, billing, and all the projects.

2

Project

A group that usually represents one product or application. The list of features, the segments, and the tags live here.

3

Environment

A separate place inside a project, such as Development, Staging, or Production. Each environment has its own answer for every feature.

4

Feature

The named control that belongs to the project and appears in every environment. Its definition is shared, and its state is separate in each environment.

flowchart TB
    PRJ["Project: Learning Platform"] --> FEAT["Feature: live class reminder"]
    FEAT --> DEF["Shared definition: name, description, tags, type"]
    FEAT --> ED["Development state"]
    FEAT --> ES["Staging state"]
    FEAT --> EP["Production state"]
    ED --> ED1["Enabled: yes, Value: 15 minutes"]
    ES --> ES1["Enabled: yes, Value: 15 minutes"]
    EP --> EP1["Enabled: no, Value: 15 minutes"]
    
Figure 1: One feature, defined once in the project, with a separate state in each environment

The simplest definition

If the project is the hotel’s key board, a feature is one labelled hook. Its label (the name, the description, the tags) is shared by everyone. Whether a key hangs on the hook (the feature is enabled), and which key (the stored value), is decided separately in each environment.

The three questions a feature answers

Whenever an application asks Flagsmith about a feature, it is really asking up to three questions.

  • Is it enabled? The on and off position. This is the basic flag.
  • What is its value? An optional piece of stored information, such as a number, a piece of text, or a small block of structured data. This is remote configuration.
  • Which variation applies to this user? For features with several variants, Flagsmith picks one for each user according to the percentages you set. This is a multivariate feature.
i
Tip

Remember this pairing. Definitions are shared, and live in the project. Decisions are private, and live in each environment. This single sentence explains most of how Flagsmith features behave.

Other words you will hear

Different teams call the same idea by different names: feature toggle, feature switch, feature flag, or config flag. In Flagsmith’s own screens and documents, the word feature is used for the item, and the phrases feature flag and remote config describe what you can do with it. A person may say, “Enable the feature in staging,” meaning that the feature’s state in the staging environment should be set to enabled.

3The Anatomy of a Feature

A feature is a small package of information. Let us open the package and look at each part, separating what is shared from what is private to each environment.

flowchart LR
    F["A Flagsmith feature"]
    F --> S["Shared across the project"]
    F --> P["Private in each environment"]
    S --> S1["Name or key"]
    S --> S2["Description"]
    S --> S3["Tags"]
    S --> S4["Type: flag, config, or multivariate"]
    S --> S5["Owners and archived status"]
    P --> P1["Enabled or disabled"]
    P --> P2["Value"]
    P --> P3["Variation percentages"]
    P --> P4["Segment overrides"]
    P --> P5["Identity overrides"]
    P --> P6["Scheduled or pending changes"]
    
Figure 2: The parts of a feature, split into shared definition and per-environment decisions

The shared parts

Shared

Name or key

The identifier your code uses to ask for the feature. It is the single most important part, because changing it later breaks every application that asks for the old name. Choose with care.

Shared

Description

A sentence or two explaining what the feature does, who owns it, and when it should be removed. Future colleagues will thank you.

Shared

Tags

Labels such as “checkout,” “experiment,” “temporary,” or “owner-payments.” Tags let teams filter and manage hundreds of features without confusion.

Shared

Type

Whether the feature is a simple flag, a configuration value, or a multivariate feature with several options. The type decides which settings are shown.

Shared

Owners

The people or groups responsible for the feature. Owners are the ones who should remove it when its job is finished. Availability may depend on your version.

Shared

Archived status

A marker meaning the feature is no longer in active use, which hides it from normal lists without deleting its history. Useful as a safe step before deletion.

The private parts, per environment

Private

Enabled state

Whether the feature is on in this environment. A feature can be on in Development, partly on in Staging, and off in Production.

Private

Value

The stored value for this environment, such as 15, or a message, or a block of structured data. Values may differ across environments for good reasons.

Private

Variation weights

For multivariate features, the percentage of users who get each variation in this environment.

Private

Segment overrides

Special answers for chosen groups, such as “premium customers” or “employees,” specific to this environment.

Private

Identity overrides

A special answer for one named user in this environment, useful for beta testers or support investigations.

Private

Pending changes

Change requests and scheduled changes waiting to take effect in this environment.

Value types

A feature’s stored value can carry different kinds of information. Typically you can store text, whole numbers, true or false values, and, in many versions, structured data in a common text format used to describe objects. Choose the simplest type that fits. A single number is easier to understand, validate, and test than a large block of structured data. If you do store structured data, keep it small and describe its shape in the feature’s description, because mistakes inside a free-form value are not caught until your application tries to use it.

Analogy

Think of a library card in a catalogue drawer. The card names the book, gives a short description, and lists subject tags. Those parts are the same for every reader. Each branch library then pencils in its own notes: how many copies are on the shelf, and who has reserved it. The card is the shared definition, and the pencilled notes are the per-environment states.

!
Warning

The name of a feature is a contract between Flagsmith and every application that reads it. Renaming a feature in the dashboard does not rename it inside your code. Treat the name as permanent, and when a change is truly needed, create a new feature and migrate gradually.

4Three Flavours: Flag, Remote Config, and Multivariate

Features come in a few flavours. Choosing the right flavour keeps your design simple and your code easy to read.

Flavour one: the plain feature flag

A plain feature flag carries one piece of information: enabled or disabled. It answers a yes or no question, such as “Should this user see the new checkout?” It is the simplest and the most common flavour, and it is the right choice whenever the real question is whether something happens at all.

Flavour two: remote configuration

Remote configuration stores a value that your application reads, such as the number of items in a carousel, the text of a banner, or the time allowed for a request. It answers “how much?” or “what text?” instead of “yes or no?” A single Flagsmith feature can carry both: the on and off switch and a value. When the switch is off, many applications ignore the value, and use their built-in default.

Flavour three: multivariate

A multivariate feature has several named variations, such as “layout A,” “layout B,” and “layout C.” Each variation is given a percentage in each environment, and Flagsmith assigns each user to exactly one variation in a stable way. This flavour powers experiments, often called A/B tests, and gradual migrations between several versions of a behaviour.

FlavourQuestion it answersTypical useExample
Plain flagYes or no?Hide unfinished work, release gradually, emergency kill switchNew checkout page on or off
Remote configHow much, or what text?Tune limits, messages, thresholds without a releaseMaximum upload size of fifty files
Flag plus valueOn or off, and with which setting?Switch a feature on and control its detailsRecommendations on, showing ten items
MultivariateWhich of several versions?A/B tests and phased migrationsThree button colours tested with equal shares

How to choose

  • Start with the question. If the answer is yes or no, use a plain flag. If it is a number or text, use a value. If it is “which one of several,” use multivariate.
  • Prefer simple. A plain flag is easier to reason about and test than a multivariate feature with five options.
  • Do not hide a different feature inside a value. If a value changes what the application does in a large way, such as “mode equals A, B, or C,” make it multivariate or split it into separate features.
  • Keep values small. Large blocks of text or data are better stored in a proper content system, with a flag pointing to which one to use.
Analogy

A plain flag is a light switch, which is either on or off. Remote config is a dimmer knob or a thermostat, which has a level. A multivariate feature is a channel selector on a radio, where exactly one station plays at a time and you decide how many listeners are tuned to each.

Use case: tuning without releasing

An online store has a feature called “search suggestions limit” that stores a number. Initially it is eight. During a busy sale the team notices that loading eight suggestions slows the search box. They lower the number to five in Production. Pages speed up within moments, and no developer, build, or release was involved. After the sale they raise it again. This is remote configuration doing exactly what it is meant to do.

i
Tip

When you notice a feature whose value must be changed every few days, that value probably belongs in remote configuration. When you notice a feature whose flag will be on forever, it may not be a flag at all, but a normal product setting or a permission rule.

5Creating a Feature the Safe Way

Creating a feature takes only a minute, but the choices made in that minute shape months of work. Let us walk through the steps with care.

1

Decide the purpose first

Before opening the dashboard, write one sentence: what is this feature for, who owns it, and when will it be removed? Features created without a purpose tend to live forever.

2

Choose a clear name

Use a descriptive, consistent name such as “new_checkout_flow” or “search_suggestions_limit.” Avoid vague names like “test2.” Agree on one naming style across the team, and use it every time.

3

Write the description

Explain what the feature does, its owner, its expected removal date, and the safe, off behaviour. This text is what an engineer will read at three in the morning during an incident.

4

Pick the type

Choose plain flag, value, or multivariate according to the question the feature answers.

5

Set the starting state to off

Create the feature disabled. When you create a feature, you may be offered an initial enabled state and value, which can be applied to every environment. Switching it on at creation could expose unfinished work in Production.

6

Add tags and owners

Label the feature by area, purpose, and team so it can be found, filtered, and cleaned up later.

7

Enable it in Development only

Switch the feature on in the Development environment so the team can build and test with it. Production stays off.

Naming rules that save headaches

  • Describe the capability, not the project. “express_checkout” lasts longer than “q3_launch_thing.”
  • Use one consistent style. Pick lower-case words joined by underscores, or hyphens, and keep it everywhere. Mixed styles make search and automation harder.
  • Avoid negative names. A feature called “disable_cache” leads to confusing double negatives, such as “not disabled.” Prefer positive names like “cache_enabled.”
  • Keep names stable and unique. Never reuse the name of a deleted feature for a different purpose, because old code somewhere may still react to the old meaning.
  • Add a prefix for kind or team when it helps. For example, “ops_” for emergency switches, or “exp_” for experiments.
!
Warning

The famous 2012 trading incident at Knight Capital involved a flag name that was reused for new behaviour while old code on one server still reacted to the old meaning. The firm lost roughly four hundred and forty million dollars in under an hour. Never reuse a feature name, and always delete old code completely.

Defaults and the project-level safety setting

By default, the starting enabled state and value you choose when creating a feature may be copied into all environments. That is handy for harmless settings, but risky for new capabilities. Flagsmith offers project-level options to stop default values from being applied everywhere, and many teams prefer to keep new features off in every environment except Development. Look at your project’s settings to find the exact option and its name in your version.

Use case: a good description

A team writes this description for a feature: “Shows the new one-page checkout. Owner: Payments team. Expected removal: two weeks after full rollout. When off, users see the old three-step checkout, which is the safe fallback.” Months later, a new engineer on call reads this text during an incident and knows in ten seconds what the feature does, who to call, and what happens if she turns it off.

6One Feature, Many Environments

The same feature behaves differently in each environment, and that difference is the main source of its power. Let us see how.

A quick reminder: what is an environment?

An environment is a separate place where your product runs, such as Development, Staging, or Production. In Flagsmith, each environment holds its own set of answers for every feature, and has its own access keys. An application chooses its environment simply by being given that environment’s key.

The ladder of states

Because states are separate, a feature can climb a ladder, one rung at a time, collecting evidence on each rung.

EnvironmentEnabledValueSpecial rulesPurpose
DevelopmentYes5 (small, easy to inspect)NoneBuild and experiment freely
StagingYes10 (realistic)QA testers segment always onRehearse the next release
ProductionNo, then gradually yes10Employees segment on firstCareful, watched rollout

Notice that the name and description are identical in all three rows. Only the decisions differ. A developer who changes the Development state changes nothing in Production.

flowchart LR
    D["Development: on for all, experiment freely"] -->|"Works as intended"| S["Staging: set like next Production state"]
    S -->|"Tests pass and owners agree"| P["Production: employees, then percentage, then all"]
    P -->|"Problem found"| R["Disable in Production only"]
    R --> D
    
Figure 3: A feature climbs from Development to Staging to Production, and a problem sends the team back down

No automatic copying, by design

When you enable a feature in Development, nothing happens in Staging or Production. That separation is intentional, because automatic copying would defeat the safety that environments create. It does mean that someone must repeat the change in the next environment at the right moment. Teams make this step careful with reviewed requests, scheduled changes, and sometimes automatic scripts that apply the same change to the next environment after tests pass.

Why different values are healthy

A feature’s value can differ between environments for good reasons. A small number in Development makes screens easy to inspect. A realistic number in Staging tests layout and load. A cautious number in Production protects real customers. Problems begin only when differences are accidental and unexplained, a situation known as configuration drift. Compare environments before each release and explain every difference.

Analogy

Think of a chef developing a new dish. In the test kitchen, the chef uses tiny portions and tries many versions. In the tasting room, the chef cooks it for a small group exactly as it would be served. In the restaurant, it is added to the menu only after the tasting room is satisfied. The dish has one name everywhere, but each kitchen has its own state.

i
Tip

Before every release, set Staging to match the state Production will have after release, then run your final checks there. If Staging holds different flags from what Production will hold, the rehearsal proves nothing.

7Multivariate Features and Experiments

When one yes or no is not enough, a multivariate feature lets you offer several versions and decide how many people see each.

How a multivariate feature is built

A multivariate feature has a control value, which is the normal, current behaviour, plus two or more additional variations, each with its own value. In each environment, you assign a percentage to every variation. The control value takes whatever percentage remains. For example, you might give variation B ten percent and variation C ten percent, leaving eighty percent with the control.

VariationValueDevelopment shareProduction share
ControlBlue button25 percent80 percent
Variation BGreen button25 percent10 percent
Variation COrange button25 percent10 percent
Variation DRed button25 percent0 percent

How does a person get assigned?

Flagsmith needs to give each person the same variation every time they visit, otherwise a user might see a blue button on one page and a green one on the next. It does this with a technique called consistent hashing. The identity’s identifier is combined with the feature’s own identifier and fed into a mathematical scrambling function called a hash. The hash always gives the same result for the same input, but the results look random and spread evenly. The result is turned into a number from zero to one hundred, and the variations occupy slices of that range according to their percentages. Because the same user and the same feature always give the same number, the user receives a stable experience.

Mixing in the feature’s identifier matters. Without it, the same unlucky users would be in the first slice of every feature in the company, and would become permanent guinea pigs.

Analogy

Imagine giving every person in a stadium a permanent seat number from one to one hundred, decided by a fixed formula based on their name and the name of the game. For a test, you tell the people in seats one to ten to wear green, and seats eleven to twenty to wear orange. If you later widen the green group, you add seats and nobody who was green has to change. Nobody is flipped around randomly from one moment to the next.

Running a sensible experiment

Multivariate features make A/B tests possible, but the feature only chooses the groups. The science of judging results lies elsewhere. A few rules keep the experiment honest.

  • Choose the measurement first. Decide what you will measure, such as sign-ups or purchases, before the test starts.
  • Do not peek and stop early. Stopping the moment one side looks better is a good way to be fooled by chance.
  • Run for whole weekly cycles. People behave differently on weekends and weekdays.
  • Watch guardrails. A change that raises clicks but slows pages or raises support calls may be a bad bargain.
  • Send results to analytics. Flagsmith can pass information about which variation a user saw to analytics tools through integrations, so that the analysis can be done where your business numbers live.

Multivariate for gradual migrations

Multivariate features are not only for experiments. They also help move between versions of behaviour, such as three different recommendation engines. You place old and new on shares of traffic, watch the numbers, and shift the shares slowly until the old engine receives none. Then you remove the old code and the old variation.

!
Warning

Changing a multivariate percentage in the middle of an experiment, or adding a new variation halfway, can move users between groups and spoil the results. Plan the shares in advance, and treat a change of shares as the start of a new experiment.

8Targeting a Feature: Segments, Traits, and Identities

A feature does not have to give everyone the same answer. Flagsmith lets you decide, group by group and person by person, who gets what.

Identities and traits

An identity is a user, device, or account that your application tells Flagsmith about, usually by sending a unique identifier such as a user number. A trait is a fact stored about that identity, such as country, plan, app version, or signup date. Together they let you describe who a user is without Flagsmith knowing anything else about them.

Segments

A segment is a saved group of identities defined by rules about their traits. For example, “Premium users in India” might mean plan equals premium and country equals India. Segment rules can combine several conditions, using words such as “and” and “or,” and can test whether a number is above a limit, whether a text contains a word, or whether a value is one of a list. Segment definitions belong to the project, so they have the same meaning in every environment.

Segment overrides

A segment override says, for one feature in one environment, “people in this segment get this special answer.” For example, in Production you might override the “new checkout” feature so that the “Employees” segment has it enabled, while everyone else still has it disabled. Because the override is stored inside the environment, the same segment can receive a different answer in Staging.

flowchart TB
    Q["Request: feature answer for identity 4821 in Production"] --> I{"Identity override exists?"}
    I -->|"Yes"| A1["Use the identity override"]
    I -->|"No"| G{"Matches a segment override?"}
    G -->|"Yes, highest priority wins"| A2["Use the segment override"]
    G -->|"No"| M{"Multivariate feature?"}
    M -->|"Yes"| A3["Assign variation by percentage using stable hashing"]
    M -->|"No"| A4["Use the environment default state and value"]
    A1 --> OUT["Return enabled state and value to the application"]
    A2 --> OUT
    A3 --> OUT
    A4 --> OUT
    
Figure 4: The layers of decision, from the most specific identity override down to the environment default

The order of decision

Flagsmith decides in layers, from the most specific to the most general. First it checks whether the single identity has a personal override. If not, it looks at the segment overrides that the identity qualifies for. When several segments match, a priority order that you control decides which one wins. If no segment matches, the environment’s normal state applies, with the percentage split if the feature is multivariate.

Analogy

Think of airline boarding rules. A general rule applies to all passengers. A special rule applies to frequent flyers, and an even more specific arrangement applies to one passenger with a personal note on file. The gate agent always checks from the most specific rule to the most general, and the first rule that fits decides the treatment.

Common targeting recipes

Recipe

Employees first

An “Employees” segment, defined by a company email trait or a staff flag, gets the feature before anyone else. Employees forgive mistakes and report problems fast.

Recipe

Beta customers

A “Beta” segment, built from customers who agreed to try new things, gets the feature after employees.

Recipe

Plan-based access

A “Premium” segment gets paid features. Use this for permission style features that live a long time.

Recipe

Region or language

Release a feature country by country, or only in markets where a law or partner allows it.

Recipe

App version gate

A condition such as “app version is at least 5.2” keeps old apps, which lack the new code, from waiting for something that does not exist.

Recipe

Percentage of everyone

After targeted groups, release to a growing percentage, using stable hashing so each person always gets the same answer.

Identity overrides: the personal touch

An identity override gives one specific identity a special answer for a feature in one environment. It is perfect for letting a single important customer try a beta, or for letting a support engineer reproduce a bug as a particular user. Use identity overrides sparingly. If you find yourself creating hundreds of them, a segment rule is almost always a cleaner solution, and the large number of overrides makes the environment data heavier.

i
Tip

A segment silently matching nobody is the most common targeting surprise. Usually a trait is misspelled, or an application in that environment does not send the trait at all. Test each new segment with a known identity before trusting it in Production.

Use case: a staged rollout through segments

A fintech team releases a new “instant transfer” feature. On Monday the Production override enables it for the Employees segment. On Wednesday they add the Beta customers segment. On Friday they enable it for ten percent of everyone. At each step, they watch error rates and transfer success. Because each step is a small change to an override or a percentage, any step can be undone in one click.

9How an Application Reads a Feature

A feature in the dashboard is only half of the story. The other half is the application that asks for it. Let us follow the question from the code to Flagsmith and back.

The SDK

An SDK, short for software development kit, is a small library that you add to your application so that it can talk to Flagsmith in your own programming language. Flagsmith provides SDKs for many languages, covering web pages, mobile apps, and back-end servers. The SDK is given the environment key when it starts, and uses it to find the right environment.

Two basic questions in code

In your code, you normally ask Flagsmith one of two simple questions, using the SDK’s methods. The first is “is this feature enabled?” which returns yes or no. The second is “what is this feature’s value?” which returns the stored value. Often you ask both at once, by requesting all the flags for the current user and then looking up the ones you need. In either case, you also provide a default, which the code uses if Flagsmith cannot answer.

sequenceDiagram
    participant U as User
    participant A as Application
    participant SDK as Flagsmith SDK
    participant FS as Flagsmith
    U->>A: Opens the checkout page
    A->>SDK: Get flags for identity 4821 with traits
    SDK->>FS: Request using the environment key
    FS->>FS: Find environment then apply identity and segment overrides
    FS-->>SDK: Enabled state and value for each feature
    SDK-->>A: Results kept in memory
    A->>A: Is new checkout enabled?
    A-->>U: Show the new or the old checkout
    
Figure 5: The application asks once, keeps the answers, and uses them to choose which behaviour to show

Remote versus local evaluation

There are two ways for the answer to be worked out. In remote evaluation, the SDK sends a request over the network, and Flagsmith’s servers run the rules and send back the answers for that user. This works with the public client-side key and is the normal way for browsers and mobile apps. In local evaluation, a back-end server uses its secret server-side key to download the full set of rules for the environment, called the environment document, and then works out answers itself, from memory, with no network trip for each check. Local evaluation is extremely fast and keeps working during short outages, while changes arrive at the next refresh.

AspectRemote evaluationLocal evaluation
KeyClient-side or server-sideServer-side, secret
Where the rules runFlagsmith’s serversInside your own server
Speed of a checkA network request per fetchAlmost instant, from memory
FreshnessFresh on the next requestAfter the next background refresh
During an outageNeeds cached answers or defaultsKeeps the last known rules
Best forBrowsers and mobile appsBusy back-end services

Defaults: the safety net

A default is the value your code uses when Flagsmith cannot give an answer, for example during a network problem, or if the feature has been deleted by mistake. The best default is almost always the old, proven behaviour, because it protects users when anything fails. Defaults are written in your code next to the feature check, not stored in Flagsmith. Choose each one deliberately, and never let a risky new capability become the fallback.

!
Warning

A default that turns a brand new capability on when the flag service is unreachable means a routine network glitch can silently expose every user to unfinished work. For release features, the default should be off.

Keeping answers fresh

Browsers and phones cannot refresh as casually as servers. A typical approach is to fetch flags at the start of a session, keep them in memory, and refresh at sensible moments, such as when the app returns to the foreground, or on a modest timer. Some SDKs can also receive updates pushed from the server, so that an emergency switch acts within seconds. Teams choose the balance between freshness and traffic, according to how critical each feature is.

Analogy

Think of a traveller carrying a paper timetable. Most of the time the printed timetable is good enough. Occasionally the traveller checks a screen for updates. If the screen is broken, the traveller still has the paper timetable. Flagsmith SDKs behave the same way: answers kept in memory are the paper timetable, and the network is the screen.

10The Life of a Feature

Every feature is born, grows, and should eventually die. Teams that respect this life cycle keep their code clean. Teams that ignore it drown in old switches.

flowchart LR
    A["Plan: purpose, owner, expiry"] --> B["Create feature OFF everywhere"]
    B --> C["Write code for both on and off paths"]
    C --> D["Enable in Development and build"]
    D --> E["Deploy code to all environments with flag OFF"]
    E --> F["Rehearse in Staging"]
    F --> G["Gradual rollout in Production"]
    G --> H["Fully on and stable"]
    H --> I["Remove old code path"]
    I --> J["Archive then delete the feature"]
    G -->|"Problem"| K["Disable in Production and fix"]
    K --> F
    
Figure 6: The life cycle of a release feature, from planning to deletion

The life cycle in words

1

Plan

Decide the kind of feature, its owner, its safe default, and its removal date before creating anything. Writing an expiry date on day one is the best weapon against forgotten flags.

2

Create

Add the feature to the project, switched off, with a name, description, tags, and owner.

3

Build

Developers write the new behaviour next to the old, with the feature check deciding which to use. Both paths exist in the same program.

4

Deploy

The code travels through the delivery pipeline to every environment. Users see nothing new in Production, because the feature is still off there.

5

Rehearse

Staging is set the way Production will be, and the team runs final checks.

6

Release

The Production state is changed in careful steps: employees, a beta group, a small percentage, then everyone, while guardrail numbers are watched.

7

Stabilise

The feature runs on for everyone for a few weeks, with the old path kept as an emergency exit.

8

Clean up

The old code path and the feature check are removed from the code. Then the feature is archived, and finally deleted from Flagsmith, which removes it from every environment.

The cost of two code paths

While a feature lives, your program carries two behaviours. That is the price of flexibility. Every live feature roughly doubles the number of ways the program can run, so ten live features mean over a thousand combinations. Nobody can test them all. This is why short lifetimes matter so much: fewer live features mean fewer combinations and less complexity.

Archive before you delete

Deleting a feature that some forgotten service still reads can cause errors, or force that service to use its default. A gentler step is to archive the feature, which marks it as no longer in use and hides it from normal lists, while keeping it available. After a safe waiting period, with the audit log and evaluation numbers showing nobody reading it, you can delete it for good.

!
Warning

A feature is a loan, not a gift. You borrow safety and speed today, and you repay it by cleaning up later. Features that are never removed become interest that slows down the whole team.

11The Four Purposes of Features

Not every feature is the same kind of thing. They live for different lengths of time, are controlled by different people, and need different care.

Software engineer Pete Hodgson, in a widely read article hosted on Martin Fowler’s website, grouped feature toggles into four families, by how long they live and how dynamic they are. The same grouping fits Flagsmith features very well.

Short lived

Release features

Hide unfinished or newly finished work so code can be merged and deployed early. Created when work starts, deleted soon after the full launch. Owned by engineers and product owners.

Short lived

Experiment features

Use multivariate options to compare versions. Live only as long as the test needs data. Owned by product and data teams.

Long lived

Operational features

Emergency controls such as a kill switch that disables a heavy capability when servers are overloaded, or a remote value that tunes a limit during busy times. Owned by operations and reliability engineers.

Long lived

Permission features

Decide who gets what, such as premium capabilities for paying customers, using segments. Often live as long as the product itself.

Release features in detail

Release features are the workhorse of continuous delivery. A team starts a new search page. On day one a developer creates a feature for it, switched off. Every small piece of the new page is merged into the main line behind this feature. Nobody sees any change. When the page is finished and tested, the feature is turned on gradually. After a few weeks at full strength, the feature and the old page code are deleted.

Experiment features in detail

An experiment feature is usually multivariate. Users are divided randomly into groups, and each group sees a different version. The team measures one agreed number, such as how many people complete a purchase, and compares groups. Because the assignment is stable and random, the team can be fairly confident that differences come from the change and not from luck.

Operational features in detail

An operational feature is like the emergency brake in a train. Suppose a recommendation panel depends on a slow external service. If that service becomes unhealthy, every page that waits for it becomes slow. An on-call engineer can disable the panel with one click, and pages become fast again without recommendations. The product degrades gracefully instead of failing. Such a switch is often called a kill switch. Because it must be dependable, its off state should be tested before an emergency, and its default should protect the system.

Permission features in detail

Permission features answer the question, “Is this person allowed to use this?” A company may give a reporting tool only to customers on its top plan. Because these decisions follow business rules rather than rollout schedules, these features tend to stay for a long time. They may be better expressed as clear product rules in some designs, but Flagsmith segments make them easy to manage when you want quick control.

PurposeTypical lifetimeWho changes itDecision depends onMain goal
ReleaseDays to weeksEngineers and productRollout percentage or groupShip safely and early
ExperimentWeeksProduct and data teamsRandom variation per userLearn what works
OperationalMonths to yearsOperations and on-callSystem healthProtect the platform
PermissionMonths to yearsProduct and supportWho the user isControl access
!
Warning

Do not mix the purposes. A release feature quietly turned into a permission feature because “some customers still depend on it” is a classic road to messy code that nobody dares touch. Decide the purpose at creation, and record it in the description and in a tag.

12Organising Hundreds of Features

A small team may have ten features. A large company may have thousands. Good organisation is what keeps the list useful and not terrifying.

Tags

A tag is a short label attached to a feature. Teams use tags to describe the area (checkout, search), the purpose (release, experiment, ops), the team that owns it, and its status (temporary, stale, do-not-remove). The dashboard can filter the feature list by tag, so a payments engineer can see only payments features, and a release manager can see all temporary ones. A small, agreed set of tags is far more valuable than a huge, messy one.

Owners

Every feature should have an owner. In Flagsmith, features can be given individual owners and group owners in many versions, so that responsibility is visible. When a feature has no owner, nobody feels responsible for turning it off or deleting it, and it quietly lives on. Make owner assignment part of the creation routine.

Descriptions as documentation

The description is the place to write what the feature does, what happens when it is off, who to contact, and when it should be removed. Treat it like a short note you leave for a stranger who will need it urgently.

Spotting stale features

A stale feature is one that has been fully on, or fully off, for a long time, and is no longer providing any safety or choice. It is dead weight. Teams find stale features by looking at how long ago each was last changed, which tags it has, and what its evaluation numbers look like. Some versions of Flagsmith offer help for this, such as marking a feature as stale, and some teams add their own script that lists features not changed for sixty days. Whichever way you do it, schedule a regular review.

1

List the suspects

Filter by “temporary” or “release” tags, and sort by last change. Features untouched for a long time come first.

2

Ask the owner

Check whether the feature is fully launched and whether the old code path is still needed.

3

Remove the code first

Delete the feature check and the old behaviour from the application, deploy, and let it run.

4

Archive, wait, delete

Archive the feature, watch for surprises, then delete it from Flagsmith.

A naming and tagging scheme that works

ElementExampleWhy it helps
Namecheckout_one_pageSays what it controls, stays stable
Purpose tagrelease, experiment, ops, permissionSets expectations about lifetime and care
Team tagteam-paymentsShows whom to ask
Status tagtemporary, staleGuides cleanup
DescriptionOwner, expiry, off behaviourMakes incidents calmer
i
Tip

Treat cleanup as part of the definition of finished work. A ticket for a new feature should include a linked ticket, scheduled for a few weeks later, for removing it.

13Governance: Permissions, Approvals, and History

A feature can change what millions of people see in seconds. That power deserves rules about who may use it and a record of what was done.

Permissions

Least privilege means each person receives only the permissions necessary for their job. Flagsmith lets administrators grant permissions at the organisation, project, and environment levels, to individuals or to groups. At project level, permissions typically cover viewing the project, creating and deleting features, and managing segments and tags. At environment level, permissions typically cover viewing the environment, updating feature states, managing segment overrides and identities, and creating or approving change requests.

Role ideaTypical permissionsWhy
DeveloperCreate features, change Development freely, propose Production changesSpeed where it is safe, review where it is not
TesterChange Staging states and test overridesRehearse realistically
Release managerApprove Production change requests, manage overridesA second pair of eyes before live changes
SupportManage identity overrides in ProductionHelp individual customers without touching global state
Product ownerView everything, schedule changes through requestsControl timing without risking accidents
Platform ownerAdminister keys, settings, and permissionsKeep the system itself healthy

Change requests and scheduling

For environments where mistakes are expensive, a feature change can be made through a change request. Instead of changing the state directly, a person proposes the change, another person reviews and approves it, and only then does it take effect. The number of approvals required can be set per environment, depending on your plan. A scheduled change allows a state change to happen at a chosen future time, which suits coordinated launches that must start at a precise moment, such as the opening of a sale.

Versioning and history

Flagsmith keeps an audit log of changes, recording who changed what, when, and in which environment. In versions that support feature versioning, a feature’s state in an environment can have versions, so that an earlier state can be inspected or restored. When something goes wrong, the first question is always “what changed?” and the history answers it in seconds.

flowchart LR
    A["Developer proposes change in Production"] --> B["Change request created"]
    B --> C{"Reviewer approves?"}
    C -->|"No"| D["Comments and revision"]
    D --> B
    C -->|"Yes"| E["Change applied or scheduled"]
    E --> F["Audit log records who, what, when"]
    E --> G["Webhook posts to team channel"]
    E --> H["Applications receive new state"]
    
Figure 7: A reviewed change flows from proposal to approval, history, announcement, and effect

Webhooks and integrations

A webhook is an automatic message sent to another system when something happens. A common use is posting a line into a shared chat channel whenever a Production feature changes, such as “Production: instant transfer set to ten percent by Anil.” This simple habit means that when something odd happens, everyone sees what changed. Flagsmith also connects to analytics and monitoring tools, so that feature state can be recorded alongside your business and technical numbers.

Use case: protecting the money features

A payments company requires one approval for any Production change. Developers can propose changes, but cannot approve their own. When a developer wants to raise the rollout of a new payment screen from five to twenty-five percent, the release manager checks live error graphs, approves, and the change takes effect. Months later an auditor asks who authorised that change, and the history provides a complete answer in a minute.

14Features and the Continuous Delivery Pipeline

Features and delivery pipelines are made for each other. Together they let teams ship small changes constantly and release them calmly.

A quick reminder about continuous delivery

Continuous Delivery means every change goes through an automatic assembly line, called a pipeline, that builds, tests, and prepares the code so it can be released at any moment. The same package moves from stage to stage. Only settings change, and feature values are some of those settings.

Deploy is not release

The most valuable idea here is that deploy and release are different events. A deploy puts code on servers, and it is a technical event handled by the pipeline. A release shows a capability to users, and it is a business event handled by changing a feature state. Flagsmith features are what make the split practical.

Deploy

Technical event

Code reaches the servers. Measured by whether the pipeline succeeds. Can happen many times a day, even on a Friday, since new code is hidden behind a switched-off feature.

Release

Business event

Users start to see the capability. Measured by customer behaviour. Happens when the business is ready, in careful steps that can be reversed in seconds.

Trunk-based development

In trunk-based development, everyone merges small changes into one shared main line, at least once a day, instead of keeping private copies of the code for weeks. That keeps merging easy. But half-finished work will land in the main line. How can it be safe? The answer is the feature. Unfinished code sits behind a switched-off feature, travels to production in the normal pipeline, and stays invisible until the team decides to reveal it. The feature turns the main line into a safe place for unfinished ideas.

Analogy

Think of a restaurant that is building a new kitchen wing while serving dinner. The builders work behind a closed door, and customers see only a working restaurant. The door is the feature. When the wing is ready and inspected, the owner opens the door. If a pipe leaks, the owner closes the door again. Nobody had to close the restaurant.

Branch by abstraction

When the change is deep inside the system, such as replacing a payment provider, a technique called branch by abstraction works well with features. The team places a thin layer, the abstraction, in front of the old component, then builds the new component behind the same layer. A feature decides which implementation the layer uses. Traffic is moved over gradually, then the old component is deleted, all inside the main line and with no long-lived branch.

Use case: replacing a payment provider

A company wants to move from provider X to provider Y. The team creates a multivariate feature with the control sending payments to X, and a variation sending payments to Y. In Production, the variation starts at one percent. Success rates for both are compared on the same dashboard. Y fails more often for one card type, so the team fixes it while ninety-nine percent of payments continue through X. Weeks later the variation reaches one hundred percent, and the code for X is removed.

15Using Features Well Inside Your Code

A feature in the dashboard is easy to create. A feature inside code can easily become a mess. A few simple design habits keep it tidy.

Decide in one place

The most important habit is to check a feature in one place, near the top of a request, and then pass the decision inward. Imagine a feature check scattered across forty files: when the feature is finally removed, a developer must hunt down all forty places, and will probably miss one. If the check lives in one place, removing it is a small, safe job.

Hide old and new behind one interface

A very clean pattern, often called strategy substitution, is to write the old behaviour and the new behaviour as two interchangeable parts that fit the same shape. The feature decides which part the application uses. The rest of the program does not know that a feature exists. When the feature is retired, you delete one of the two parts and the decision, and nothing else changes.

Wrap the SDK

Add a thin layer of your own around the Flagsmith SDK. This wrapper gives features clear names, supplies safe defaults in one place, and lets tests replace real answers with fixed ones. If you ever change the SDK version, or move to another provider, you change one file instead of thousands of lines. There is also an open standard called OpenFeature, from the Cloud Native Computing Foundation, that defines a common way to ask for flags, and Flagsmith can be used through it.

Pattern

Decide at the edges

Check once at the entrance of a request, store the result, and pass it down. Avoid asking again and again deep in the code.

Pattern

Strategy substitution

Old and new behaviours share one interface, and the feature chooses which one is used.

Pattern

Flag wrapper

One thin layer of your own around the SDK for names, defaults, and test overrides.

Pattern

Shadow mode

Run the new path silently beside the old, compare answers, and log differences without showing the new result to anyone.

Pattern

Kill switch for risky dependencies

Every feature that depends on an outside service gets an operational feature that can disable it instantly.

Pattern

Sticky decisions for long journeys

For multi-step flows, decide once at the start, remember it with the session, and reuse it so users never see the design change halfway through.

Avoid checks inside tight loops

If you process a large list, ask for the feature once before the loop, keep the answer in a variable, and reuse it. Even fast checks add up when repeated a million times, and the code becomes harder to read.

Dark launching and shadow mode

A dark launch means running new code in production for real traffic, without showing its results to users. Facebook famously used this approach when it launched its chat system in 2008, running the new back-end code for real users before anyone could see the chat window, in order to see how the servers coped. A feature in Flagsmith makes dark launches easy: the feature controls whether the new code even runs, and a second feature, or the same one, controls whether its results are shown.

Analogy

Imagine a new engine installed in a car beside the old engine, humming quietly with no connection to the wheels. The mechanic can check that it runs, measure its temperature, and compare it to the old one while the car keeps driving on the old engine. When the mechanic is satisfied, the drive shaft is connected. Shadow mode is that quiet engine.

i
Tip

Keep the off path as the boring, long-tested path. If the on path ever fails, flipping the feature off must return users to something that has worked for months, not to a half-tested alternative.

16Testing Features

Features make releases safer, but they raise new questions for testers. How do you test something that behaves differently for different people?

The explosion of combinations

If a program has one feature, there are two possible behaviours. With two features there are four. With ten features there are one thousand and twenty-four, and with thirty there are over a billion. It is impossible to test every combination, and fortunately it is unnecessary, since most features control things that do not touch one another. The skill lies in testing the combinations that matter.

2
behaviours with one feature
1,024
combinations with ten features
1 billion+
combinations with thirty features

A practical approach

1

Test both sides of every feature

Automatic tests should cover the off path, which is the current behaviour, and the on path, which is the new behaviour. Many failures arise when only the new path is tested and the old one breaks quietly.

2

Test the planned Production state

Run a main suite with features set exactly as Production will have them, since that is what real users will meet.

3

Test the next state

Also run the suite with features set as they will be after the next planned change, so the switch-on holds no surprises.

4

Isolate interacting features

If two features touch the same screen or data, test their four combinations specifically, or better, avoid making features depend on each other.

5

Try it in Production, carefully

Use a segment override to let employees or testers use the real feature on real systems, which reveals things that Staging cannot.

Making tests repeatable

An automatic test must give the same result every time it runs. A test that depends on a live feature whose state people change during the day would be unpredictable. Good setups let the test choose the answers itself, through a wrapper that supports overrides, or through a dedicated test environment with fixed values. The test says, “for this check, pretend the feature is on,” and everything else behaves normally.

Practising the kill switch

A kill switch that has never been tested is a hope, not a safety device. Teams should practise turning important operational features off in a controlled way, in Staging and occasionally in Production during quiet hours, to confirm that the product degrades gracefully. A page that crashes when recommendations vanish is a problem best discovered during practice.

!
Warning

Never point automatic tests at the Production environment’s features and let them change states. A faulty test could switch a live capability on or off for real customers. Tests belong in a test environment or in temporary ones.

17Advantages, Disadvantages, and Trade-offs

Features give great power and also real costs. An honest engineer knows both sides.

Advantages

  • Deploy and release become separate, so deployments become boring and safe.
  • Instant reversal by flipping a switch, often in seconds.
  • Gradual rollouts keep the damage of any bug to a small group.
  • Unfinished work can live in the main line, ending painful merges.
  • Values can be tuned live without a release.
  • Product teams can control launch timing without waiting for engineering.
  • Real experiments replace opinions with evidence.
  • Shared definitions and separate environment states keep teams aligned yet safe.

Disadvantages

  • Extra code paths make programs harder to read.
  • Combinations of features multiply what could be tested.
  • Old features become technical debt if nobody removes them.
  • The flag service becomes a dependency to keep reliable.
  • A wrong change to a feature can cause an outage as easily as bad code.
  • Names, values, and rules need discipline and documentation.
  • Data, such as identities and traits, needs privacy care.
  • Teams may lean on features instead of writing good tests.

Key trade-offs to decide on purpose

DecisionOption AOption BGuidance
One feature or severalOne feature with many optionsSeveral small featuresPrefer small, independent features unless the options truly exclude one another
Flag or valuePlain on and offOn and off plus valueAdd a value only when the setting really needs tuning
LifetimeShort, removed quicklyLong, kept for operationsShort for release, long only for operational and permission features
EvaluationRemote and simpleLocal and fastLocal for busy servers, remote for browsers and apps
Change styleDirect and quickReviewed through requestsReviewed for critical features, direct for low-risk ones
TargetingMany identity overridesA few segment rulesSegments scale better and are easier to understand
The goal is not to have many features. The goal is to have the right features, for the right time, and then none.

When not to use a feature

Not every change deserves one. A tiny text fix, a safe refactoring protected by strong tests, or a change that can easily be undone by redeploying may not need a switch. Changes that cannot be placed behind a switch, such as a database structure change that cannot work in both old and new forms, call for another approach, like making the database compatible with both old and new code first, and cleaning up afterwards.

18Security, Privacy, and Compliance

A feature is a remote control for your product, so it deserves care in who can reach it and what information flows through it.

Protect the keys

Applications connect to Flagsmith using environment keys. The client-side key is meant for web pages and mobile apps, and is treated as public, since it can only ask for the flags of one user. The server-side key is secret, because it can download the full rules of the environment. Keep it in a secrets manager, never in a web page, a mobile app, or a code repository. Separate administrative tokens, used to change features by script, are even more powerful and must be guarded like a production database password.

!
Warning

Anything that reaches a browser or a phone can be inspected by a curious person. Never place secrets, unreleased product names, or private pricing in values that client-side code reads. And never trust a client-side feature to guard something important. Enforce access to paid content or private data on the server.

Do not store secrets in feature values

A feature’s value travels to many systems. It may appear in logs, caches, and analytics tools. Passwords, tokens, and private addresses belong in a proper secrets manager. Use feature values for behaviour and harmless settings.

Privacy of user data

Identities and traits can contain personal information. Send only what the rules really need. Use opaque identifiers rather than names and email addresses, and send traits such as plan or country instead of anything sensitive. If you run Flagsmith on your own servers, personal data stays under your control, which can help with laws such as the European GDPR or India’s data protection law. If you use the hosted service, review the provider’s data handling terms and decide what to share. Local evaluation helps too, because identity details can stay inside your own servers while only rules are downloaded.

Auditing and access reviews

  • Keep the audit log. Many compliance rules require proof of who approved Production changes.
  • Review access regularly. Every few months, check who holds permissions in Production and remove those who no longer need them.
  • Use single sign-on. Connect Flagsmith to your company sign-in so that people lose access when they leave.
  • Separate duties. The person who proposes a critical change should not be the only one who approves it.
  • Plan break-glass access. Define a documented emergency path to turn a feature off quickly, with extra review afterward.

Self-hosting and data location

Teams with strict rules about where data may live sometimes run Flagsmith on their own infrastructure, in a region of their choosing, behind their own network controls. The same feature design applies, but the work of updates, backups, and availability moves to the team. It is a serious decision, and the reward of control must be weighed against the effort of running the service reliably.

19Monitoring, Logging, and Metrics

A rollout without measurement is like driving at night without headlights. Observability tells you whether the new capability is helping or hurting.

Three kinds of signals

Signal

Metrics

Numbers over time, such as error rate, response time, and orders per minute. Cheap to store and perfect for dashboards and alarms.

Signal

Logs

Detailed records of events. When a user reports a problem, logs that include the feature state let engineers see what that user experienced.

Signal

Traces

A map of one request’s journey through many services, showing where time is spent when a feature changes behaviour in one of them.

Tag signals with the feature state

The most useful habit is to record which state of the feature a request ran with. Then any graph can be split into two lines: users with the capability and users without. The question “is the new checkout slower?” becomes a simple comparison of two lines, instead of an argument. Flagsmith can send feature information to analytics and monitoring tools through integrations, and many teams also add the state to their own logs. Flagsmith also offers evaluation counts for features in some plans, which show how often each feature is being read, a useful clue when you are deciding whether a feature is still in use.

Guardrail metrics

When a team begins a rollout, it writes down guardrail metrics, which are numbers that must not get worse no matter how good the new capability looks. Typical examples are error rate, response time at the slowest one percent of requests, payment success, app crashes, and support contacts. If any guardrail crosses its limit, the rollout pauses or reverses.

TypeExamplesWhat it protects
Technical healthError rate, latency, CPU and memory, timeoutsPlatform stability
User experiencePage load time, app crashes, failed loginsCustomer satisfaction
Business outcomesOrders, sign-ups, payment success, revenue per visitorThe company’s goals
Operational loadSupport tickets, pages to on-call, database loadThe people and systems behind the product
flowchart TB
    A["Raise feature to next step in Production"] --> B["Collect metrics for users with and without the feature"]
    B --> C{"Guardrails within limits?"}
    C -->|"Yes"| D{"Enough time and data?"}
    D -->|"No"| B
    D -->|"Yes"| E{"At 100 percent?"}
    E -->|"No"| A
    E -->|"Yes"| F["Finish and schedule cleanup"]
    C -->|"No"| G["Alarm fires"]
    G --> H["Disable feature in Production"]
    H --> I["Investigate with logs and traces"]
    I --> J["Fix and restart at a small step"]
    J --> A
    
Figure 8: A guarded rollout loop with reversal when guardrails fail

Automatic reversal

People cannot stare at dashboards all day. Teams create alarms that notify them when a guardrail is crossed. The more advanced step is to let a script act on its own: when an alarm fires during a rollout, it calls the Flagsmith management interface and returns the feature to its previous state. This cuts the time between a problem starting and the problem ending from tens of minutes to seconds. A human should still review what happened afterwards.

Watch the plumbing too

Monitor how often SDKs fail to reach Flagsmith, how old the rules held in each server are, and how often applications fall back to default values. A rising number of fallbacks is an early warning that something is wrong between your applications and the flag service, long before users complain.

20Performance, Scale, and Reliability

A feature check can happen on almost every request, so at the scale of a large company even a tiny delay or a rare failure matters.

Keep checks cheap

If every check needed a trip across the internet, a page with twenty features would feel slow. The standard approach is to fetch once, keep the answers in memory, and refresh in the background. Back-end servers use local evaluation so each check takes only a tiny slice of time. Browsers and apps fetch at the start of a session and reuse the results.

Designing for failure

1

Cached answers

Applications keep the last known answers in memory, so a short outage of the flag service goes unnoticed.

2

Safe defaults in code

Every check supplies a default, normally the old and proven behaviour.

3

Timeouts

Applications should not wait forever for the flag service at start-up. A short time limit with a fallback keeps start-up fast.

4

Saved environment data

Where supported, a server can keep a saved copy of the environment, so a restart during an outage still has real answers.

5

Lean data

Delete finished features and unused segments so that the data every server downloads and stores stays small.

Eventual consistency between servers

When a feature changes, servers do not all learn about it at the same instant. With local evaluation, each server updates at its next refresh. For a few seconds or minutes, some servers hold the old state and others the new. For most capabilities this is harmless. For multi-step journeys, decide once at the start and carry the decision with the session.

Mobile apps and old versions

Once an app version is installed on a phone, its code cannot change until the person updates. A feature is therefore a remote control for capabilities already inside the installed app. You can switch a faulty capability off on millions of phones without waiting for an app store review. But a feature guarding code that does not exist in older versions needs care, so rules often include a condition on the app version.

i
Tip

Ask one simple question of any design: “If Flagsmith disappeared this minute, what would our users see?” The right answer is “the safe, old behaviour, with no errors.”

21Anti-Patterns to Avoid

An anti-pattern is a tempting solution that causes trouble. Learn these so you can spot them in your own team.

ANTI-PATTERN 01Avoid
The immortal feature

A release feature that stays in the code for years after the launch. Nobody remembers what it does, nobody dares to remove it, and every new developer must read both paths forever.

Better approach

Give every feature an owner and an expiry date at creation. Review old features regularly, and count removal as part of finishing the work.

ANTI-PATTERN 02Avoid
Feature spaghetti

Features nested inside features, with rules such as “if A and not B, unless C.” The number of paths explodes and nobody can say what a user will see.

Better approach

Keep features independent. If one capability needs several switches, combine them into one multivariate feature, or make the dependency explicit and rare.

ANTI-PATTERN 03Avoid
The reused name

Recycling the name of an old feature for a new purpose. Somewhere, old code still reacts to the old meaning. The 2012 Knight Capital incident is the best-known example of how costly this can be.

Better approach

Never reuse a name. Delete old code completely, create new features with new names, and verify that every server runs the same version before a change.

ANTI-PATTERN 04Avoid
The unsafe default

A fallback that turns a risky new capability on when Flagsmith cannot be reached. A routine network glitch then silently exposes everyone to unfinished work.

Better approach

For release features, default to the old, proven behaviour. For kill switches, choose the default that protects the system.

ANTI-PATTERN 05Avoid
Features as a settings dumping ground

Using remote configuration for everything, including large blocks of content and settings that should be proper configuration. The feature list slowly becomes a messy, undocumented settings database.

Better approach

Use the right tool for each job: real configuration management for permanent settings, a content system for large text, and features for behaviour that must change quickly and safely.

ANTI-PATTERN 06Avoid
Hundreds of identity overrides

Using personal overrides to hand-pick users for a rollout. It is slow to maintain, hard to audit, and makes the environment data heavy.

Better approach

Describe the audience with a segment rule built on traits, and keep identity overrides for rare, individual cases.

22Best Practices and Common Mistakes

These habits come from many teams learning the hard way. Following them saves you from most of the pain.

Best practices

  • Create features switched off. Enable them deliberately, starting in Development.
  • Choose clear, positive, stable names. Describe the capability, keep one naming style, and never reuse a name.
  • Write a useful description. Say what it does, who owns it, what happens when it is off, and when it should be removed.
  • Pick the simplest type. Use a plain flag for yes or no, a value for tuning, and multivariate only when several versions are truly needed.
  • Tag and assign owners. Purpose, team, and status tags with a named owner make cleanup possible.
  • Always supply safe defaults in code. The default should be the old, proven behaviour.
  • Decide in one place. Check a feature once, near the entrance of a request, and pass the decision inward.
  • Roll out in stages with guardrails. Employees, then a beta group, then a percentage, then everyone, watching the numbers at each step.
  • Mirror Staging to the next Production state. Make the rehearsal predict the performance.
  • Use segments, not piles of identity overrides. Rules scale and can be explained.
  • Require review for critical Production changes. A second pair of eyes is cheap protection.
  • Announce Production changes in a shared channel. Visibility makes investigations faster.
  • Practise the kill switch. Nobody should see the off state for the first time during an emergency.
  • Treat removal as part of the work. Delete the code first, then archive, then delete the feature.
  • Wrap the SDK. One thin layer gives clear names, defaults, and test overrides.

Common mistakes

Mistake

Skipping cleanup

The most common failure. Months later the code is full of dead branches that nobody understands.

Mistake

Renaming a live feature

The dashboard changes, but the code still asks for the old name and silently gets the default.

Mistake

Creating features enabled

With defaults copied everywhere, an unfinished capability may appear in Production the moment the feature exists.

Mistake

Testing only the new path

The old path breaks quietly, and the kill switch leads nowhere safe.

Mistake

Forgetting traits in lower environments

If Staging does not send the traits a segment needs, the rule matches nobody and the rehearsal misleads.

Mistake

Rolling out too fast

Jumping from zero to everyone in one step removes the safety that a staged release provides.

Mistake

Ignoring overrides

A feature enabled in an environment can still show “off” for a user because of a segment or identity override. Always check every layer.

Mistake

Server key in a mobile app

Anyone can extract it and read the full environment. Use the client-side key on user devices.

A checklist before changing a Production feature

1

Am I in the right environment?

Check the name and colour at the top of the screen. Many mistakes begin with editing the wrong place.

2

Was this rehearsed in Staging?

Confirm that Staging held the same state and that the checks passed.

3

Do I know the safe state?

Be able to say exactly what happens when the feature is off, and be sure it has been tested.

4

Are the dashboards open?

Have the guardrail graphs ready and the alerts working before you click.

5

Does the team know?

Tell support and on-call staff so they can connect any reports to your change quickly.

Adopting features in a team that is just starting

1

Start with one release feature

Pick one upcoming capability, wrap it in a feature, and practise the whole cycle from creation to deletion. One complete cycle teaches more than any plan.

2

Agree on the rules

Write a short team rule: naming style, tags, owner, safe default, and expiry for every feature.

3

Add measurement

Tag logs and metrics with feature states, and prepare a standard dashboard comparing users with and without a capability.

4

Add kill switches

Find the three riskiest dependencies of your product and protect each with an operational feature.

5

Add governance

Create groups, restrict Production, and introduce reviewed changes for the few features that would hurt most.

6

Grow into experiments

When rollouts feel natural, begin proper A/B tests with agreed measurements.

It also helps to talk openly about culture. Features work best in teams where turning something off in Production is seen as a normal, healthy action and not as a failure to be hidden. If people fear blame, they will hesitate to reverse a bad change, and the greatest strength of a feature, its speed, is wasted. Teams that celebrate a quick, calm reversal, and then study it without blame, become safer over time.

23Real-World and Industry Examples

The idea of separating release from deployment, and of controlling exposure in careful steps, is common to the best-known engineering organisations. Here are public lessons, followed by an illustrative story.

Facebook (Meta): dark launches and employees first

Facebook became famous for showing new capabilities to its own employees before the public, and then to growing slices of users. In 2008 it launched its chat system by running the new back-end code for real users without showing the chat window, so engineers could see how servers coped before anyone could use it. A gating system lets engineers pick audiences and turn capabilities off quickly. For a service with billions of users, this is the only sensible way to change anything.

Netflix: safe delivery at global scale

Netflix, together with Google, open-sourced a delivery platform called Spinnaker, which supports strategies such as canary and blue/green releases. They also built an automated canary analysis tool that compares the numbers of a new version against the old before a release continues. Netflix runs a very large number of experiments, so that many viewers see slightly different pages and recommendations at any moment. The lesson for Flagsmith users is to let measurements, not feelings, decide whether to advance.

Amazon: small, frequent, staged deployments

At a conference in 2011, an Amazon engineer reported that the company deployed to production on average roughly every eleven seconds, thanks to heavy automation and teams that own small services. Amazon has also described rolling changes through stages, beginning with early, low-risk stages and moving to larger ones, with automatic checks between stages, and a culture that prefers changes that can be undone. A feature in Flagsmith brings the same shape to individual capabilities.

Google: one main line, careful gating

Google engineers largely work from a single shared main line of code and rely on strong automated tests and switches to keep it healthy. New behaviour is often hidden behind a switch and revealed to a small group before wider release. The shared definition with separate decisions, which Flagsmith expresses through project and environment, is the same pattern at a smaller scale.

Etsy and Flickr: the early pioneers

Flickr’s 2009 talk about releasing more than ten times a day helped start a movement. Etsy, the marketplace for handmade goods, became another famous example, openly sharing its habit of releasing many times a day with small changes, strong monitoring, and configuration switches that let it turn parts of the site on and off. Their public writing taught a generation of teams that frequent release is safer, not more dangerous.

Knight Capital: the cautionary tale

In 2012 a trading firm deployed new software to only some of its servers, while a repurposed flag woke up old code on a server that had not been updated. The firm lost roughly four hundred and forty million dollars in under an hour. The lesson is not that switches are dangerous, but that names must never be reused, deployments must be verified as complete, and the ability to turn things off quickly must be practised.

An illustrative story: a shopping app and its new search

The following story is an invented example, shown to tie the ideas together. A shopping company has a Flagsmith project with Development, Staging, and Production environments. A developer creates a multivariate feature called “search_ranking_engine,” with a control value, “classic,” and a variation, “smart.” It is created switched off everywhere, with a description naming the owner and an expiry date, and tagged “experiment” and “team-search.”

1

Week one: build

In Development, the “smart” variation gets fifty percent, so developers see both engines. The code is merged daily, hidden behind the feature, with both paths covered by automatic tests.

2

Week two: rehearse

The same build reaches Staging. The QA testers segment receives the “smart” variation, and performance tests run against realistic data.

3

Week three: employees

A reviewed change request enables the “smart” variation in Production for the Employees segment. Staff use it on the real site for two days.

4

Week three: experiment

The “smart” variation is given ten percent of customers. The team compares search-to-purchase rates, page speed, and error rates against the classic group over two full weekly cycles.

5

A hiccup and a fast reversal

At twenty-five percent, slow responses appear for long queries. The team sets the variation to zero percent in Production within a minute, fixes the slow lookup, and resumes two days later. No redeployment was needed.

6

Cleanup

After three stable weeks at full strength, the classic engine code and the feature check are removed. The feature is archived, then deleted, and disappears from every environment.

Analogy

Think of a new medicine. It is tested in a laboratory, then in a small, closely watched trial, and then offered to more people, with doctors ready to stop immediately if something looks wrong. Each stage has its own rules and records. Flagsmith features give software teams the same careful, staged, reversible path.

Patterns in all these stories

SourceMain ideaFlagsmith equivalent
FacebookDark launch and employees firstSegment overrides in Production, features that control whether code runs
NetflixAutomated judgement and experimentsMultivariate features and guardrail metrics
AmazonSmall, staged, reversible changesGradual percentage rollout with instant reversal
GoogleShared main line with gatingShared feature list with separate environment states
Etsy and FlickrA culture of frequent releaseDeploy often, release when ready
Knight CapitalReused flag and incomplete deploymentNever reuse names, verify deployments, rehearse the off state

24Frequently Asked Questions

Short, clear answers to questions that beginners and experienced engineers often ask about features in Flagsmith.

Q1What exactly is a feature in Flagsmith?
A feature is a named control defined once in a project. It can carry an enabled or disabled position, a stored value, or several variations, and it has a separate state in every environment. Its definition is shared, and its decisions are private to each environment.
Q2What is the difference between a feature flag and remote config?
A feature flag answers a yes or no question: is this on? Remote configuration stores a value, such as a number or text, that your application reads while running. In Flagsmith, one feature can carry both, so you can switch a capability on and also tune how it behaves.
Q3If I enable a feature in Development, does it change Production?
No. Each environment has its own state for every feature. Enabling it in Development has no effect on Staging or Production, and you must repeat the change in the next environment when you are ready.
Q4When should I use a multivariate feature?
Use it when you need more than yes or no, for example to compare three layouts in an experiment, or to move traffic gradually between several versions of a behaviour. For a simple on and off decision, a plain flag is easier to understand and test.
Q5How does Flagsmith give a user the same variation every time?
It combines the identity’s identifier with the feature’s identifier, runs the result through a hash function, and turns that into a number that falls inside one variation’s slice. The same inputs always give the same number, so a user’s experience stays stable, and widening a variation’s share does not shuffle users who were already in it.
Q6What should my default value in code be?
Almost always the old, proven behaviour. For a new release feature, that means off. For a kill switch, choose whichever default protects the system. The default is used whenever Flagsmith cannot answer, so it is your safety net.
Q7Can I rename a feature?
You can change a name in the dashboard, but your code still asks for the old name and will quietly receive its default. Treat the name as a permanent contract. If it must change, create a new feature, move the code across, and delete the old one after confirming nothing reads it.
Q8How do I decide who sees a feature first?
Use segments built on traits. A common order is employees, then a beta group, then a percentage of all users, then everyone. Each step is a small change to an override or a percentage that can be undone in one click.
Q9What is the difference between a segment override and an identity override?
A segment override gives a special answer to everyone who matches a group rule. An identity override gives a special answer to one named user. Identity overrides win over segment overrides. Both are stored per environment, and segments scale far better than hundreds of personal overrides.
Q10How many features is too many?
There is no magic number. What matters is how many live features interact and how many are overdue for removal. A company may safely hold thousands if each has an owner, an expiry, and independence. Ten tangled features with no owner may already be too many.
Q11Does reading features slow my application?
Not if you use the SDK sensibly. With local evaluation a check takes only a tiny amount of time. For browsers and apps, fetch once at the start of a session and reuse the answers. Slowness appears when every check makes a network request, or sits inside a tight loop.
Q12What happens if Flagsmith is unavailable?
Well-built applications keep going. They use the answers already in memory, a saved copy of the environment where the SDK supports it, or the default written in code. Always supply a safe default, and ask yourself what users would see if the service vanished.
Q13When should I delete a feature?
For a release feature, once it has run fully on for a stable period, often one to four weeks, and the old behaviour is no longer wanted as a fallback. Remove the code first, then archive the feature, wait, and delete it. Experiment features go once the decision is made. Operational and permission features may stay, but need regular review.
Q14Is it safe to put secrets in a feature value?
No. Values travel to many systems and, for client-side use, can be read by anyone who inspects the app. Keep passwords and tokens in a secrets manager, and use feature values only for behaviour and harmless settings.
Q15Can features replace automated testing?
Never. Features limit the damage when something slips through, but they do not find bugs before release. Testing catches problems early and cheaply, and features catch the surprises testing missed, in a way that limits harm. They work best as partners.

25Summary and Key Takeaways

You have travelled from the fear of big releases to the calm of small, reversible, measured changes. Here is everything worth remembering.

A feature in Flagsmith is a named control, defined once, that can carry a switch, a value, or several variations, with a separate and private answer in each environment and for each group of users. It lets teams deploy code early and release it later, change behaviour without releasing again, and reverse a bad decision in seconds. The practical habit to carry away is to treat every feature as a short-lived loan of safety: create it off, give it a clear name, owner, and expiry, roll it out in careful steps while watching the numbers, and then remove it once its job is done.

Key Takeaways

  • Definition shared, decisions separate. A feature’s name, description, tags, and type live in the project, while its enabled state, value, variations, and overrides live in each environment.
  • Pick the right flavour. Plain flags answer yes or no, remote config answers how much or what text, and multivariate features answer which version.
  • Create features off and name them well. Choose clear, stable, never-reused names, write a helpful description, and assign an owner and expiry on day one.
  • Target with layers. Identity overrides beat segment overrides, which beat the environment default. Prefer segments over piles of personal overrides, and test each rule with a known identity.
  • Read features safely. Decide in one place, wrap the SDK, always supply a safe default, and use local evaluation for busy servers so that an outage does not hurt users.
  • Release in careful steps. Move from Development to Staging to Production, then from employees to a beta group to a percentage, watching guardrail metrics, and keep a tested kill switch ready.
  • Govern and clean up. Apply least privilege, review critical Production changes, keep the audit log, never put secrets in values, and remove finished features by deleting code first, then archiving, then deleting.