️️Feature Flags 101: 3 Basic Feature Flag Use Cases You Can Implement Today 🏁
Mark Phelps
Posted on January 29, 2024
High-performing engineering teams ship quality code fast.
For that, they decouple code deployment from its release. This enables them to lower the risk of bugs in production and deploy code more often.
What is the best way to implement this?
Feature Flags.
They may seem complicated, but in this article, I'll show you how you can leverage them for different use cases and how Flipt makes the process easy and seamless.
Developers 👋
If you are looking to make high impact Open Source contributions in 2024, we have a step-by-step roadmap and an awesome community to help you with that.
Table of Contents
- What are Feature Flags?
- Use Case #1: Controlled Rollouts
- Use Case #2: Experimentation & A/B Testing
- Use Case #3: Permissions & Targeting
- Wrap Up
What are Feature Flags?
Have you ever slipped a bug in production that caused:
- App crashes
- Regressions
- Security Vulnerabilities
I have.
If you didn’t use feature flags, it’s likely that you rolled back the breaking change and deployed a new build. Or worse, fixed it forward causing extended downtime for users.
Feature flags enable controlled rollout of software by allowing developers to turn features on or off without deploying new code.
Let’s look at how they are useful in more detail.
Use Case #1: Controlled Rollouts
#1 rule of shipping reliable software?
Never break the build.
That’s how you build trust with your users.
To do this, you should roll out new features gradually to a small percentage of users, and then increase them over time. This gradual rollout helps in monitoring the impact and performance of the feature and reducing the risk.
How can Flipt help?
In Flipt there are two types of flags — variant and boolean.
You can perform rollout for both types of flags, using rules and distributions, for variant flags, and rollouts rules for boolean flags.
Boolean flags are most commonly used when performing code rollout type operations if you want to slowly release functionality over time.
Use Case #2: Experimentation & A/B Testing
Imagine that you’re running an e-commerce platform. And you’re revamping your user interface. Wouldn’t you be interested in knowing its impact on sales and other key metrics?
Chances are you do.
And that’s where feature flags can help. You can experiment with the feature and gauge its impact on KPIs before launching it for all the users. Hence, limiting the negative impact caused by it.
Similarly, feature flags facilitate A/B testing by showing different features to different user groups, helping in understanding user preferences and behavior.
How can Flipt help?
In Flipt, experimentation is mostly accomplished through using variant flags, where you can, for example, return colorscheme: default
to 80% of visitors to your application and then colorscheme: dark
to the remaining 20%.
Use Case #3: Permissions & Targeting
In addition to controlled rollouts and experimentation, feature flags are also useful for targeting groups. It can be a
- Group of users
- Group of machines
- Group of environments
These groups can be created based on any criteria.
E.g. If Uber wants to launch the UberEats feature, it’s less likely they will be doing it for all the cities that they operate in. More likely, they will launch it for a few cities first. Here, they can leverage feature flags which will be enabled only for users of a particular city.
How can Flipt help?
In Flipt you can use our powerful context evaluation along with segmentation to build pretty much any type of logic required for a specific group.
This can be especially useful for developing ad-hoc permissions within your application, without requiring a more heavy-handed access control system or library.
Wrap Up
That’s it!
I hope you’ll use feature flags next time you encounter the above use cases.
And if you need any help with implementing Feature Flags, you can shoot your queries on our discord. We have an awesome community there 💗
If you found this valuable, follow me for more open-source related articles. 🙂
Also please give Flipt a ⭐️ on GitHub, it really helps us out!
Posted on January 29, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
January 29, 2024