DevOps Zone is brought to you in partnership with:

Mark is a graph advocate and field engineer for Neo Technology, the company behind the Neo4j graph database. As a field engineer, Mark helps customers embrace graph data and Neo4j building sophisticated solutions to challenging data problems. When he's not with customers Mark is a developer on Neo4j and writes his experiences of being a graphista on a popular blog at He tweets at @markhneedham. Mark is a DZone MVB and is not an employee of DZone and has posted 553 posts at DZone. You can read more from them at their website. View Full User Profile

Web Operations: Feature Flags to Turn Off Failing Parts of Infrastructure

  • submit to reddit

On most of the projects I’ve worked on over the last couple of years we’ve made use of feature toggles that we used to turn pending features on and off while they were still being built but while reading Web Operations I came across another usage.

In the chapter titled ‘Dev and Ops Collaboration and Cooperation’ Paul Hammond suggests the following:

Eventually some of your infrastructure will fail in an unexpected way. When that happens, you’ll want the ability to disable just the features that rely on it, and keep the rest of the site running. Feature flags make this possible.

We’d mainly use this approach to disable peripheral functionality such as the ability to comment on a site whose main purpose is to deliver news.

From what I understand this means we’d permanently have if statements (or some equivalent) in the appropriate places in our code base which could be dynamically toggled if we start experiencing problems.

This differs slightly from the feature toggle approach we’ve used because those toggles would eventually be removed when the feature was running successfully in production.

Hammond goes on to suggest using feature flags for any external services that we rely on e.g. Flickr relies on the Yahoo address book, and but can gracefully disable that functionality if needs be.

He also points out that it’s useful to think hard about what features are absolutely core to serving your site e.g. Flickr can disable photo uploads but still allow people to continue viewing photos.

Overall this sounds like a pretty neat idea and apart from the slight complexity of having the conditionals in the code I can’t really think of any reasons why you wouldn’t want to do it. Happy to hear opposing views though!

Published at DZone with permission of Mark Needham, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)