Feature Flagging: A PMs Best Friend

May 6, 2014 Nic Werner

There are often times when you’re building a feature, and have broken it into smaller user stories. But this new feature won’t be completed for a month, and you’re releasing into production every week. You can’t break the continuous integration build cycle, but you also can’t release an unfinished feature.

What’s a PM to do?

In the old days, you would:

  • Deliver stories that were part of a new feature individually to staging
  • When it was time for your weekly deploy, engineers would pull this code out of HEAD and stash it in a branch.
  • Deploy that stripped code to production.
  • Engineers would remerge this code to HEAD on staging, hopefully with no merge conflicts.
  • Cross your fingers.

This process is dangerous for a couple reasons:

  • You and your team could forget to remove this partially-completed feature, releasing something half-baked
  • A production deploy takes time. If you’re announcing new features at a big conference, you can’t afford to take down the site for a deploy. And what if it fails on something else unrelated?

Introducing feature flagging:

2013-08-29-14

Simple in nature, feature flagging means to wrap logic code around certain pieces of code that aren’t ready for prime time. The code goes out to production, but the code logic ensures that it isn’t shown.

BENEFITS FOR PRODUCT MANAGERS

  • Doesn’t interrupt regular deploy cycle
  • Can turn a feature on immediately without require a deploy
  • Allows breaking a large feature into smaller stories
  • Lightweight in development cost

BENEFITS FOR DEVELOPERS

  • Painless way to test if a specific feature would hammer the server
  • Prevents accidental deployment of unreleased features
  • Avoids merge conflicts

DOWNSIDES:

  • Additional code to maintain
  • Need to remember to spell out this requirement in each story or it will still go live
  • Not always easy to draw lines around features
  • Having too many ongoing flagged features can put the system into bad states

FINAL CAVEAT:

As a PM, your goal is to always be receiving feedback from users. Hiding a feature too long can prevent that feedback. Martin Fowler (of all sorts of fame), writes in a post:

“Your first choice should be to break the feature down so you can safely introduce parts of the feature into the product. The advantages of doing this are the same ones as any strategy based on small, frequent releases. You reduce the risk of things going wrong and you get valuable feedback on how users actually use the feature that will improve the enhancements you make later.”

GOING FURTHER:

Feature flagging isn’t just for half-completed features, you can enable this for beta programs as well. A specific set of users can see your new features, or you can have it set to be enabled randomly for A/B testing. Don’t forget to include metrics tracking or you won’t know which is better. For an example of taking things a bit too far, see Graham Siener’s post on using feature-flipping for tracking user interest. They played around a bit with RollOut, an open-source framework to jumpstart flagging.

Also, see the technical side from the Flickr engineering team

 

 

 

About the Author

Biography

Previous
World's Smallest IaaS, Part 1
World's Smallest IaaS, Part 1

In this blog post, we describe the procedure to deploy VMware ESXi and VMware vCenter on an Apple Mac Mini ...

Next
EMC World 2014: Pivotal and Isilon Take Hadoop Prime Time in the Enterprise
EMC World 2014: Pivotal and Isilon Take Hadoop Prime Time in the Enterprise

This week, Pivotal is headed to EMC World as a premier member of the Federation. Together this week, Pivota...

×

Subscribe to our Newsletter

!
Thank you!
Error - something went wrong!