Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tools and techniques for effective use of feature toggles in .NET

I have read a lot about feature toggles but have no practical experience of using them. What tools and techniques do people recommend for effective management of feature toggles?

I imagine the simplest way would be to store toggles as true/false values in the web.config file as appSettings but this doesn't sound a particularly good method.

Ideally I would like any method of managing feature toggles to:

  • Flag any uses of the toggle on removal. E.g. A compilation error
  • Highlight any old toggles. I.e. A toggle that is still in place after the feature has been released
like image 240
Phil Hale Avatar asked Aug 12 '11 10:08

Phil Hale


People also ask

How do you implement a feature toggle in C#?

Feature toggles allow you to keep your production-ready code base and your development code base more closely in sync. Depending on the dynamicity and durability of a feature, you can draw on different kinds of toggles such as release toggles, experimental toggles, permissioning toggles, and ops toggles, to name a few.

What are feature toggles used for?

In software development, a feature toggle is a mechanism that allows code to be turned “on” or “off” remotely without the need for a deploy. Feature toggles are commonly used by product, engineering, and DevOps teams for canary releases, A/B testing, and continuous deployment.

How do you test a feature toggle?

When testing the new feature with a feature toggle, the toggle needs to be tested as well as the feature itself. The feature should only be visible to the end-user when it has been switched on. If the new feature is replacing an older version, then both need to be tested in case a change has affected either version.


1 Answers

One suggestion from a colleague is to store them in a .settings file. The advantage of this is that if you delete a toggle you get compiler errors anywhere the toggle has been used so you can be certain it's been completely removed from the code.

It's also possible to use some simple techniques to do feature toggling. It's not big or clever, but it's straight forward and it works.

UPDATE

Since asking this question I've had some more experience using feature toggles. I've looked at a few of the open source tools available and written about another simple database driven toggling mechanism I've used at work.

like image 93
Phil Hale Avatar answered Sep 28 '22 04:09

Phil Hale