DEV Community

Cover image for How to Use Feature Flags in DevOps: Four Use Cases for Developers
Pradumna Saraf
Pradumna Saraf

Posted on

How to Use Feature Flags in DevOps: Four Use Cases for Developers

If developers need to go through the typical DevOps process (branching, etc.) each time they want to test in production, it can be painful.

How good would it be if developers could simply toggle a switch on/off in production and test things out, such as a new bubble chat feature or dark mode, without relying on another team? This would free up developers and let the DevOps team focus on what they're good at, too.

Yes, that's where feature flags come in.

So, what are feature flags?

Feature flags empower developers to enable or disable specific features within an application or service without modifying the codebase. It's like turning a switch on and off. With tools like Flagsmith, it becomes much easier to create and manage flags and get features on top of them.

You can also read my recent blog I've written on this topic, where I explain this further and cover how we can test in production with feature flags using Flagsmith.

The tasks that we going to discuss below were never this easy for a developer to
perform—just by toggling a switch. Feature flags revolutionize the process, not by replacing DevOps professionals, but by simplifying once tedious tasks, making optimization much more straightforward. This, in turn, streamlines the overall software development life cycle (SDLC), enabling DevOps professionals to concentrate on their strengths. Additionally, these features align seamlessly with various DevOps practices.

1) Feature Toggles:

Feature flags let you toggle a feature on and off when needed, like showing a signup form for some days every month. You don’t need to redeploy code (or wait for other teams/branches to finish their work), you can just toggle the feature on/off.

In the Flagsmith Dashboard, you can create a Feature flag, and then you can turn it on and off according to your needs. There’s a how-to guide for the process in one of my previous blogs; click here to check it out.

Flagsmith Dashboard

2) Scheduled Releases:

Scheduled releases were always a huge DevOps-centric thing; people had to write cron jobs for this. But with Flagsmith, you can perform a feature release from the UI. For example, if there is a holiday season and you want to enable some offer banner on the homepage at midnight on 25th Dec, this feature is a game-changer. (Scheduled releases also let you meet compliance/regulatory standards. Say you’re an insurance company and you can only release a certain feature during enrollment windows, you can schedule the release to meet those requirements.)

Flagsmith Dashboard

3) Canary Deployment:

Sometimes we want to reduce risk and validate new software by releasing it to a small percentage of users. With feature flags, we can adjust and control the percentage of people who can see the feature.

Here, only 10% of people will be able to see the chat menu, and with time, we keep increasing until it's completely enabled for everyone. This gives us time to gain user feedback and make adjustments before rolling it out to the whole user base.

Flagsmith Dashboard

4) A/B Testing:

Sometimes the team is working on a feature, and before rolling it out in production, they want to test it. We can easily test it with the Dashboard by allowing only 50% of people to see the new UI and 50% to see the old one. If the response and feedback are good, and users like it, we can roll it out for all users.

Flagsmith Dashboard

In a nutshell, using feature flags makes life easier for developers. It lets them control and test their software effortlessly. With the ability to turn features on and off, developers can make their work smoother and better.

And here's the cool part – there are open-source tools like Flagsmith! Check out the repository to see it in action. Don't forget to give it a star to show some love. Join the awesome community for help, questions, and cool discussions.

Top comments (15)

Collapse
 
fernandezbaptiste profile image
Bap

A good lesson on Feature flags :)

Collapse
 
pradumnasaraf profile image
Pradumna Saraf

Thank you, Bap

Collapse
 
matijasos profile image
Matija Sosic

Nice post! Use cases really help to understand when I'd like to use something like this.

Collapse
 
pradumnasaraf profile image
Pradumna Saraf

Thank you, Matija

Collapse
 
eddiejaoude profile image
Eddie Jaoude

Great post Pradumna

Collapse
 
pradumnasaraf profile image
Pradumna Saraf

Thank you, Eddie

Collapse
 
nathan_tarbert profile image
Nathan Tarbert

Thanks for these helpful tips on feature flags Anna!

I would love to collaborate on an integration with Wing Cloud

Collapse
 
pradumnasaraf profile image
Pradumna Saraf

Thank you, Nathan

Collapse
 
annaredbond profile image
annaredbond

Ooh that'd be interesting - let's chat!!

Collapse
 
nathan_tarbert profile image
Nathan Tarbert

Cool :)

Collapse
 
annaredbond profile image
annaredbond

Love this, Pradumna. So good to find ways to free up developers and let teams focus on what they do best.

Also, great write-up, as always. Your content always shines

Collapse
 
pradumnasaraf profile image
Pradumna Saraf

Thank you, Anna, for your kind words!

Collapse
 
agardnerit profile image
Adam Gardner

Any readers using / considering feature flags should investigate OpenFeature. A CNCF project which is a vendor-neutral specification for flagging. Give your future-self flexibility while still using whatever vendor / tool you like.

Collapse
 
annaredbond profile image
annaredbond

Absolutely! Vendor neutrality and open standards are such an important thing in the feature flag space. Love OpenFeature!

Some comments may only be visible to logged-in visitors. Sign in to view all comments. Some comments have been hidden by the post's author - find out more