DEV Community

Cover image for ️️Feature Flags 101: 3 Basic Feature Flag Use Cases You Can Implement Today 🏁
Mark Phelps for Flipt

Posted on

️️Feature Flags 101: 3 Basic Feature Flag Use Cases You Can Implement Today 🏁

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.

Join 260+ Developers ▶


Table of Contents


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.

Flipt Boolean Flag Preview


Flipt Boolean Flag Preview

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?

Flipt Variant Flag Preview


Flipt Variant Flag Preview

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.

Flipt Segmentation Preview


Flipt Segmentation Preview

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!

Top comments (2)

Collapse
 
matijasos profile image
Matija Sosic • Edited

This is a really nice and concise article! Btw, I really like that Flipt is open-source - it could be a great fit for Open SaaS - a free, open-source alternative to $300+ SaaS starters like Shipfast and Supastarter. github.com/wasp-lang/open-saas/

How would one go about self-hosting Flipt, what are the requirements?

Collapse
 
markphelps profile image
Mark Phelps

Hey @matijasos ! Open SaaS looks really cool, I can't wait to give it a try!

Would love it if Flipt would be considered to be integrated into OpenSaaS. Per your question about self-hosting, we have a section in our docs dedicated directly to that: flipt.io/docs/self-hosted/overview

But tl;dr: Flipt runs anywhere as it's a single binary with no required dependencies by default. So you can run it directly on a server, via Docker, K8s, or even on your Mac via Homebrew if you want.

Hope that answers your question!