LaunchDarkly Tips and Tricks: Vol. 1
Download EbookAdvancing Your Toggling
In this section, we're going to walk through a few of the most common ways we see people extend their toggling beyond just hitting the switch in the UI. This will give you some visibility into the different ways you can enable or disable features within your environments.
Let's get into it.
The Workflow Builder
The is a favorite at LaunchDarkly, mainly because we’re huge fans of features that allow developers and operators to recapture some of their time. Put simply, the Workflow Builder allows teams to scaffold out process-driven workflows for releasing feature flags in LaunchDarkly.
There are a few key capabilities of the Workflow Builder that are worth highlighting.
Progressive Rollouts
Progressive rollouts are an out-of-the-box capability. With the click of a button, you can automatically plot out a progressive rollout that gradually increases by a configurable percentage over a defined period of time. For example, this enables you to roll out a change to 10% of your users each day over the course of 10 days. If there's a problem along the way, the process can be canceled and the feature can be disabled immediately.
If you want a more customized approach, the Workflow Builder allows you to plot out a custom workflow with the specific steps you'd like to execute. For instance, you can create a workflow that requires approvals from specific people within your organization or a specific date to begin executing.
From there, you can have the Workflow Builder create multiple steps around enabling or disabling a feature, adding targets to a feature flag, changing the default variations for a rule, or even building out specific rollout percentages (more on that below).
When coupled with scheduling out flag changes, these rules give you the ability to plan out feature releases that impact specific teams.
- Other example use cases for flag targeting
- Targeting a mobile-optimized UI for testing by IOS mobile devices
- Ensuring that Internet Explorer browsers receive a more compatible user interface
Allowing developers who have a specific header configuration on their API requests to receive a new version of API for early testing, or bypass a maintenance mode on a development API
Targeting rule-based rollouts and scheduled changes
One of the biggest superpowers of LaunchDarkly is the ability to target users with flag values that are based on rule configurations. These rules allow you to use attributes that can be configured as part of the user connection to influence the flag values received by the application.
Do you want to ensure that "dev users" are receiving the latest and greatest features or testing out a new component while "prod users" are receiving their existing stable configuration? This concept is one of the hallmarks of LaunchDarkly and core to the idea of "dark launching" features.
Automating Percentage Rollouts
If you have a new feature you want to roll out slowly to groups of your users, or simply want to ensure the feature can continue to scale without triggering major incidents as it rolls out , a percentage rollout gives you time to adjust.
With a percentage rollout, you gradually release a new feature to a certain percentage of your user base—10%, 20%, 40%, etc.—before making it available to everyone. The benefits of this approach allow you to reduce risk, gauge reception, and improve quality.
We've made the automation of percentage rollouts simple in LaunchDarkly. Below, we'll explain the easy way to perform a percentage rollout, and also a more manual way for when you really want to get more hands-on with it.
How to automate a percentage rollout in LaunchDarkly
From the LaunchDarkly home interface, navigate to a flag and click on the Workflows tab. When you click "Create workflow," you'll be given the option to either do a progressive rollout or a custom workflow. If you want to do a progressive rollout to all of your users, you just need to select:
- When the rollout should begin
- Which variation you want to roll out
- The percentage increments of the rollout (10%, 20%, etc.)
- The frequency you want the rollout to progress (say 20% every two days)
One key thing to note: this method starts your rollout from zero percent of users having received it.
So, if you already have an existing feature partially rolled out to a certain percentage of users (say maybe 40%), and you select the progressive rollout workflow, it will overwrite any previously defined rollouts. Therefore, it’s best to select this option when you're starting a rollout from scratch.
Want to preserve the experiences for currently targeted users? This next section will show you more about building a custom workflow.
How to perform a percentage rollout manually in LaunchDarkly
Let’s say you want to target a specific set of users (canary release). In that case, we recommend choosing the custom workflow option. This will open the Workflow Builder, where you can create customized, flexible workflows to fit whatever business processes you follow. You can set up one or multiple approvals, target user segments, and use each stage of the feature release to coordinate on a timeline of your choosing.
A custom workflow allows you to automate a rollout to a specific group of users instead of all users. This can be really helpful during major architectural changes, or with high-risk features.
Alternatively, when you click on a flag, you can manually target users you want to receive the rollout and schedule the release for a future date.
One last note: soon, we'll be releasing workflow templates that allow you to build a workflow, save it, and use it again at your discretion, so stay tuned. Until then, feel free to dive deeper into this topic in our Docs section on the LaunchDarkly site.