Click here to Skip to main content
15,894,017 members
Articles / All Topics

Feature Flags

Rate me:
Please Sign up or sign in to vote.
4.50/5 (2 votes)
25 Apr 2017CPOL2 min read 4.2K   2  
Feature flags

I know it's been 2 months since my last post but I've been a busy guy working on a bunch of projects, and I figured I'm long overdue for an update.

First, I've been working on a GitHub repo to solve a problem for a lot of developers out there, and it's a framework around FeatureFlags. You can find it here:

What are Feature Flags?

I'm still working on the documentation around it, but essentially the elevator pitch is that FeatureFlags are a necessary part of Agile deployments, and DevOps. I regularly get told the following:

"We can't deploy every 2 weeks because some of the work we do takes longer than 2 weeks to complete."

Which I always found as a funny statement, because it implies that you are unique in that way. The truth is that EVERY development shop has changes, features, enhancements that take longer than 2 weeks to do. This is not something new, and there is an answer to that problem, FeatureFlags.

FeatureFlags is this concept of building a structure around your features / application code that allows you to turn features On/Off as needed. So if you are working on a feature that is only 50% done at the time of deployment, then you would turn it off and deploy the code to production with it being hidden away from any user. This allows for a great amount of flexibility in how your applications are deployed and developed.

What Did You Build?

What I've created here, is a framework for implementing FeatureFlags internal to an application, and having those flags be controlled by the database. This allows for adding a flags around code to enable one of 3 states:

  • On: The feature is currently turned on and available to everyone.
  • Off: The feature is currently turned off and available to no one.
  • Preview: The feature is currently "in preview" and available to select users for their review.

This enables you to either disable access to elements within your application or even who controllers or action methods.

This code leverages Entity Framework 6.1.3 code first to enable you the ability to generate the necessary table structures on the fly, as well as implements a structure around the Dependency Injection to allow you to implement this into your application along with the necessary request filters.

I would invite you to review the code and encourage implementing this within your application.

Next Steps

For this project, I am working on breaking it up into NuGet packages which will be made available on NuGet.org. And updating the GitHub documentation to guide implementation of this framework.

This article was originally posted at http://Kmack.azurewebsites.net/feature-flags-2

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
United States United States
My name is Kevin Mack, I'm a software developer in the Harrisburg Area. I have been a software developer since 2005, and in that time have worked on a large variety of projects. Everything from small applications, to mobile and Enterprise solutions. I love technology and enjoy my work and am always looking to learn something new. In my spare time I love spending time with my family, and learning new ways to leverage technology to make people's lives better. If you ask me what I do, I'll probably tell you I can paid to solve problems all-day-every-day.

Check out my blog at https://kmack.azurewebsites.net/ and https://totalalm.azurewebsites.net/

Comments and Discussions

 
-- There are no messages in this forum --