Netlify Case Study - A Nearly Painless Migration to DevCycle from LaunchDarkly

Netlify Case Study - A Nearly Painless Migration to DevCycle from LaunchDarkly


Netlify is a leading front-end platform known for its innovative web development solutions that power thousands of websites all around the web. Continuously releasing new features to their developer community quickly and reliably is an integral part of the business where speed and accuracy are of great importance.

In this case study, we’ll showcase how Netlify migrated to DevCycle from LaunchDarkly and how it helped save money and empowered their entire team to create and toggle flags unencumbered by account restrictions.

Jason Berry, Paulo Araújo and Charlie Groll, senior developers involved in the transition to DevCycle, shared their process, strategy and successes with us. We hope they will help demystify the migration project between feature flag management tools for those thinking of making the switch.

Spoiler alert—it was nearly painless thanks to a combination of DevCycle’s importer tools and a well-thought out migration strategy employed by Netlify’s team of engineers.

Background

Netlify uses feature flags extensively across its front-end operations, including the dashboard, client-side applications, collaborative deploy previews, and the CLI. These flags primarily manage feature rollouts, allowing for phased deployment to production in manageable segments. This strategy minimizes merge conflicts and targets feature rollouts to specific users. Feature flags also serve for long-term configuration across services, with the support team collaborating with engineers on customer issues.

Challenges

Before the transition to DevCycle, Netlify faced several challenges with their previous feature flag management system. They were using LaunchDarkly, which, while effective, posed challenges such as high costs due to seat-based pricing, complexity in managing feature flags configurations, and some limitations in feature flag functionality. These issues prompted Netlify to seek out a more flexible, cost-effective solution.

How Netlify tackled the migration to DevCycle 

Jason, Paulo, and Charlie explained that Netlify migrated from LaunchDarkly to DevCycle by evaluating performance, measuring execution times, and gradually deleting feature flags from LaunchDarkly.

“We had a pretty cool migration strategy and you were very helpful too. DevCycle has a tool called ‘feature importer’ that's open source and on your GitHub, we used that and it got us 90% of the way there."
— Jason Barry

Jason broke down their migration strategy step-by-step. You can listen to him cover it in our interview here or read our summary below:

  1. Selected the Project: The first step involved choosing a specific project within LaunchDarkly for migration. Using the DevCycle feature importer tool the Netlify team downloaded, converted, and shaped the feature flags, along with all their targeting rules and configurations, to match the DevCycle's structure and nomenclature.
  2. Created Generic Hooks (in React): To avoid direct dependency on either of the two feature flag providers, a generic hook (useFlag and useFlags) was then created. This approach allowed for a seamless switch between LaunchDarkly and DevCycle, and the ability to tap into DevCycle specific flag functionalities, such as the ability to set default values for each flag (offering a fallback mechanism in case of DevCycle's downtime).
  3. Wrapped App Container in Client: The application container was then wrapped in the DevCycle client, allowing both LaunchDarkly and DevCycle clients to run concurrently. Interestingly, this setup involved the use of the existing LaunchDarkly feature flags to control the rollout to DevCycle, enabling internal testing before a broader release. To support this process, an internal command palette was developed to allow selection between LaunchDarkly and DevCycle for feature flags, providing a dynamic way to test and choose the feature flag provider directly from a UI.
  4. Deprecated Old Conventions: Due to the desire to deprecate the old convention of Netlify’s feature opt-in flags, a custom script was then developed by Jason to migrate these flags to use DevCycle as the source of truth. This script handled the conversion of targeting rules for individual users to point to the Bucketing API, ensuring a seamless transition to this new feature flagging convention.
  5. Customized Opt-in UI: Finally, a more customized UI was implemented that worked across different environments (e.g., local, staging, production). This was achieved through the use of a lambda function to manage user opt-in statuses, ensuring that opting into a feature in one environment did not affect the user's status in another. As part of this process, significant consideration was given for the potential for data drift between LaunchDarkly and DevCycle, especially regarding user preferences. The strategy focused on keeping users on DevCycle once migrated to prevent losing any preferences, rather than syncing opt-in/opt-out statuses across both platforms.

Conclusion

Migration was simpler than expected. 

DevCycle’s open-source  “Flag Importer” tool took care of 90% of feature flag porting. Thanks to Netlify's thoughtful strategy, they were able to reduced risk during the transition. DevCycle’s top tier support team helped them over come any bumps along along the way.

DevCycle’s feature set allowed Netlify to reduce code complexity in some instances. 

Netlify Labs works a lot with DevCycle's feature opt-in, which allows you to give users the ability to “opt-in” to things like beta programs on their own. Netlify now uses DevCycle’s feature opt-in to allow Labs clients to click and subscribe to beta features themselves.

“...Before we kind of frankensteined together a solution using LaunchDarkly where we had feature flags for feature flags. So it was a very meta, and frankly confusing implementation where we had a feature flag that would determine whether or not the labs entry would show up in labs, right?" Jason explained that this was a frequent source of confusion for his team when they were using LaunchDarkly.

Their make-shift naming convention was the only way to differentiate what was and wasn’t a nested flag. With DevCycle, you can group feature flags under a single feature, making it easy to track flag dependencies.

“...Because you have first class citizen support for user feature opt-in, we just flip a switch on an existing feature flag, we toggle this boolean and fill out the title and  the description and then anytime someone opts-in, you have your DB that handles whether or not that user should receive that feature. Migrating to DevCycle, let us delete a lot of code which is really nice."


DevCycle and Netlify’s software development philosophies align. 

Netlify and DevCycle share the same development philosophy: they believe feature flagging is most effective when every team member has the capability to create and manage flags as needed. These values are reflected in DevCycle features, dashboard, and its usage-based pricing model, which supports unlimited seats. This allowed Netlify to provide DevCycle accounts to their entire team at no additional cost. This not only cut down their costs, but also alleviated the frustration of having to share accounts for access to feature flags. 

For more information, be sure to check out our interviews with in our Case Study Series here.