What is a Toggle?
A toggle (or toggle switch) is a kind of button that has two positions, like on and off. It’s used in software to change settings or preferences. It can also be used to change views, for example between a stream and map view in an app or between two different cameras as you video chat with friends at the same time. The word toggle comes from the 18th century and originally meant “a pin passed through an eye of a rope to fasten it.” Today, it’s used figuratively in a variety of ways.
In a feature flag system toggles can be flipped dynamically at runtime by a special type of router called a Toggle Router. Toggle Routers are most often used to perform multivariate or A/B testing, however they can also be used to make data-driven optimizations. Toggle routers are great for implementing Champagne Brunch and other types of canary releases since they enable you to test out a new configuration without having to restart your production servers or redeploy an artifact.
When using a Toggle Router for testing it’s important to keep in mind that the toggles are being flipped at runtime so that you’re exercising all of the possible combinations of behavior that will be deployed to your users. Many teams choose to take this a step further and perform some tests with all of the toggles flipped On to ensure they don’t accidentally introduce regressions in a production release.