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.
Table of contents
Floodgate is split into 3 main parts, Applications, Environments and Flags. At the lowest level we have application which in turn has one or more environments and flags. Environments and flags combine to make Environment Flags. It's the Environment Flags which give you the ability to store different values per flag.
The flag is at the core of Floodgate. It's what controls the value of your features in your code. Flags exist at both the application level and environemnt level, more on this is explained below.
TipYou 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 witin your code which will make your testing more difficult.
A feature flag consists of the following properties.
|Name (required)||This is the name you want to give your feature flag. It's good to give your flags descriptive names for example Enable Redis Cache.|
|Key (required)||The 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 _ (uncerscore) only.|
|Description (optional)||You may give your flag a more meaningful description if require.|
|Flag Type (required)||There 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 multivairate flag can be either string, number of object.|
|Initial Environment Value (required)||When 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.|
Floodgate allows you to create multiple applications within your account. You can equate a Floodgate application to the applications and projects which you are working on.
Application FlagsApplications 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.
|Name (required)||This is the name you want to give your application.|
|Environment Name (optional)||Every 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.|
|Description (optional)||You may give your application a more meaningful description if require.|
Every application has one or more environments. You can equate environments in Floodgate to the environments in your infrastructure. 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 environemnt SDK Key which will in turn load the flags for the given environment.
Environment FlagsEvery 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.
An environment consists of the following properties.
|Name (required)||This 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.|
|Description (optional)||You may give your environment a more meaningful description if require.|