Skip to content
Floodgate Docs

Basic Concepts

This guide will help you understand the basic concepts of feature flags and the basic functions in Floodgate. There are three main concepts you need to be aware of when using Floodgate which are Applications, Environments and Flags.

Structure Overview - Applications, Environments and Flags

Floodgate is split into 3 main parts, Applications, Environments and Flags. Flags form the core of Floodgate, it’s the flag which allows you to turn your features on and off giving you full control of how your users interact with your application without needing to change your code.

At the top of Floodgate there are Applications, followed by Environments and Flags are created inside an Application. Each Flag can be configured differently per Environment.

Floodgate Anatomy.

Remember

Environments and Flags are not shared between applications.

Applications

Floodgate allows you to create multiple applications within your account. You can think of a Floodgate application like the applications and projects which you are working on in the real-world.

Remember

Applications have flags created within them. Flags at the application level are unique to the application and are not shared across applications. Updating application flag details will update the flag for the entire application.

An application consists of the following properties.

PropertyRequiredDescription
NameYesThis is the name you want to give your application.
EnvironmentNoEvery application must have at least one environment. When you are creating a new application you can give the default environment a name, if you leave it blank an environment with the name Default Environment will be created for you.
DescriptionNoYou may give your flag a more meaningful description if required.

Environments

Every application has one or more environments. Environments in Floodgate represent the environments in your infrastructure/development pipeline. For example, you may have a Test and Production environment for your application. When you integrate the Floodgate SDK into your code you will supply a unique environment SDK Key which will in turn load the flags for the given environment.

Remember

Every flag created in the application is available in each environment within that application. The difference is each flag at the environment level can have its own value. Flag values are not shared across applications or environments.

PropertyRequiredDescription
NameYesThis is the name you want to give your environment. It’s recommended to name your environments after the environments you have in your physical infrastructure/development process.
DescriptionNoYou may give your environment a more meaningful description if require.
ColourNoYou can assign each environment a unique colour, helping with quick identification of what environment you are accessing.
Require Change CommentsNoYou can force team members to require to leave a comment when they make a change to a feature flag in the environment.

Environment SDK Key

Each environment has a unique key called the SDK Key. This key is generated by Floodgate automatically and cannot be changed. You use this SDK Key to integrate with the Floodgate SDK for your given language.

Flags

The flag is at the core of Floodgate. It’s what controls the state of your features in your code and therefore how your applications react when being used by your users. Flags exist at both the application level and environment level. At the application level they are unique throughout the entire applications. The power of flags comes at the environment level were each flag can be configured to deliver a different value for each environment.

This means the same flag can be configured to on in Test and off in Production.

Remember

You can create as many flags as you want in your application though it’s recommended not to have too many flags as it means you will have many code paths within your code which will make your testing more difficult.

A feature flag consists of the following properties.

PropertyRequiredDescription
NameYesThis is the name you want to give your feature flag. It’s good to give your flags descriptive names for example Enable Redis Cache.
KeyYesThe flag key is the value you will use in your application when requesting a flag to be evaluated by the Floodgate SDK. A flag key can contain letters, numbers, . (dot), - (dash) and _ (underscore) only.
DescriptionNoYou may give your flag a more meaningful description if required.
TypeYesThere are 2 types of flags in Floodgate. There is the Boolean flag which can be either true or false and there is the multivariate flag. The multivariate flag can be either string, number of object.
Default ValueYesWhen you create a new flag you must set it’s initial state that you want it to return across all your environments. Later you will see how to go into each environment and set a different value for a flag per environment.