Uncategorized

What is a Toggle?

A toggle is a switch that has two states: on or off. It is used in computing to enable/disable features or options on an application, site, or platform.

Feature toggles can be used to roll out and roll back changes during code deployment and are especially useful when working in trunk-based development. Using feature toggles makes it easy to create a new branch for writing a new feature, then merge and reconcile that with the main branch in your source code management tool before pushing it to production to meet delivery targets.

Toggles are also effective at testing a feature in a live environment with real users before deploying it to production. Feature toggles bucket users into two groups: those with the new test feature turned ON and those without it (and thus seeing the old version of your application). Engineering teams can then remotely turn on a feature for a subset of users to get feedback and monitor performance before deploying to all users.

Toggle configuration can be managed in a variety of ways ranging from static files that are modified by hand to more dynamic approaches like a database or an existing application DB. The benefit of the latter is that a central team can manage all feature flags and their configuration from one place. However, there can be a cost to that if you have many toggles which are flipped on and off frequently and large numbers of database calls. For this reason, a common practice is to move toggle configuration into a centralized store for all production and test environments.