DevOps.com

Where the world meets DevOps

  • Latest
    • Articles
    • Features
    • Most Read
    • News
    • News Releases
  • Topics
    • AI
    • Continuous Delivery
    • Continuous Testing
    • Cloud
    • Culture
    • DevSecOps
    • Enterprise DevOps
    • Leadership Suite
    • DevOps Practice
    • ROELBOB
    • DevOps Toolbox
  • DevOps Chats
  • Webinars
    • Upcoming
    • On-Demand Webinars
  • Library
  • Events
    • Virtual Summits
    • Conferences
  • Sponsored Communities
    • CloudBees
  • Related Sites
    • MediaOps
    • Container Journal
    • Security Boulevard
    • SweetCode.io
    • Digital Anarchist
    • DevOps TV on YouTube
    • DevOps Chat on SoundCloud
    • DevOps Connect
    • DevOps Dozen
  • Follow Us
    • Twitter
    • Google News
    • LinkedIn
    • Facebook
    • DevOps TV on YouTube
    • Email
MENUMENU
  • AI
    • MLOps

      Cloudera Calls for MLOps Standards Initiative

      Future Innovative UX Without UI

      Designing a Future of Innovative UX, Without UI

      Testim

      Testim Adds SDK to AI-Based Testing Platform

      IBM AI

      IBM Zones in on DevOps for AI

      Virtana

      Virtual Instruments Changes Name to Virtana to Drive AIOps

  • Cloud
    • Predictions 2020 Application Trends Opportunities and Challenges

      Predictions 2020: Application Trends, Opportunities and Challenges

      Acquisition Protego

      Moving Things Around: The Acquisition of Protego

      Waging a Winning WAR in AWS

      Waging a Winning WAR in AWS

      Cloud Computing Trends of 2019

      The Top Six Cloud Computing Trends of 2019

      Cloud Migration Open Source Overview

      An Overview of Cloud Migration and Open Source

  • Continuous Delivery
    • Automic CA Broadcom Release Automation

      DevOps Chats: Automic + CA + Broadcom, a Release Automation Journey

      Harness

      Harness Adds Analytics to CDaaS Platform

      Dell Boomi Dives Into DevOps

      Dell Boomi Dives Into DevOps

      Implement an Effective CI/CD Pipeline

      How to Implement an Effective CI/CD Pipeline

      CloudBees continuous delivery

      CloudBees Advances Continuous Delivery

  • Continuous Testing
    • DevOps Software Testing

      DevOps Places Software Testing in the Crosshairs

      testing

      DevOps Chats: Enterprise Continuous Testing With a Shift-Right Mindset

      Investing Mobile Device Testing Lab

      Investing in a Mobile Device Testing Lab

      IBN’s Success is Driven by Formulating the Right Test Validation Strategy

      IBN’s Success is Driven by Formulating the Right Test Validation Strategy

      Steps to Ensuring Validity of Your Business-Critical Data

      5 Steps to Ensuring Validity of Your Business-Critical Data

  • DevSecOps
    • CNCF

      CNCF Graduates TUF Project to Secure Software Updates

      DevSecOps Requires Teamwork Success

      Synack: DevSecOps Being Accelerated by Cultural Shifts

      Predictions 2020: The Future of the Mobile Industry

      Predictions 2020: The Future of the Mobile Industry

      DevSecOps Progress Survey

      Survey: DevSecOps Progress Remains Elusive

      Security Missing DevOps Implementations

      Why Is Security Missing in Many DevOps Implementations?

  • Leadership Suite
    • Chief Digital Officers Driving Digital Transformation

      Chief Digital Officers Driving Digital Transformation

      There's No Such Thing as an Open Source Business Model

      There’s No Such Thing as an Open Source Business Model

      IT Admins Maintain Secure Access

      How Can IT Admins Maintain a Grip on Secure Access?

      Product IT Operating Model

      The Next Frontier for Enterprises: Moving to a Product IT Operating Model

      SMBs Struggle Digital Transformation

      SMBs Struggle with Digital Transformation

  • Practices
    • Predictions 2020 Application Trends Opportunities and Challenges

      Predictions 2020: Application Trends, Opportunities and Challenges

      DevOps Longtail UX

      DevOps at Longtail UX

      Predictions 2020 Real-Time Data Predictions

      Predictions 2020: Five Real-Time Data Predictions

      App Mobility Is the New Use Case

      App Mobility Is the New Use Case

      Social Media Marketing Businesses

      Social Media Marketing for Businesses

  • ROELBOB
    • Flight of Fancy

      Flight of Fancy

      Career Counseling

      Career Counseling

      symbols-n-semantics

      Symbols and Semantics

      career-opportunity

      Career Opportunity

      revision-cycle

      Revision Cycle

  • Toolbox
    • Xen Hypervisor

      Xen Project Advances Hypervisor Project

      IBM Z Open Editor Support Language Server Protocol

      IBM Z Open Editor Support for Language Server Protocol is a Game Changer

      Waging a Winning WAR in AWS

      Waging a Winning WAR in AWS

      envoy

      Solo.io Creates Registry for Extensions to Envoy Proxy Server

      Cloud Migration Open Source Overview

      An Overview of Cloud Migration and Open Source

  • More Topics
    • Application Performance Management/Monitoring
    • Culture
    • Enterprise DevOps

Home » Blogs » DevOps Practice » 5 Best Practices for Feature Flagging

Best Practices Feature Flagging

5 Best Practices for Feature Flagging

By Emily Williamson on November 20, 2019 Leave a Comment

Feature flags, also known as the feature toggles, are important concepts in the field of DevOps. They have been around for a long time and have been used continually by developers for their convenience. As software development services providers are striving for higher agility, practices such as feature flagging are becoming increasingly relevant. If you are not familiar with the concept of a feature flag, let’s start with understanding what feature flagging is.

Related Posts
  • Feature Branching vs. Feature Flags: What’s the Right Tool for the Job?
  • CloudBees Acquires Rollout for Feature Flagging
  • Feature Flagging Poised for Wider Adoption
    Related Categories
  • Blogs
  • DevOps Practice
  • Doin' DevOps
    Related Topics
  • feature flags
  • Feature Toggles
  • Flagging
  • logging
Show more
Show less

What is Feature Flagging?

Feature flags are used for the process of branching your code, which means to turn certain code paths on and off to separate the release of new features from the actual deployment of our code. Why do DevOps developers want to branch their code through feature flags? Well, feature flagging is a great software development practice for two reasons. Firstly, for features that are a work-in-progress, developers can use a feature flag to hold their release until they are ready. This ensures the release of other features that are ready is not delayed just because one feature is not. Secondly, features that are being worked on can be kept off using the feature flag and only once it is ready it can be turned on. This allows developers to work directly on the feature without changing the main code, also known as the trunk or master branch. When all is working and ready to be released, turning on the feature toggle releases the feature, just like a switch.

To understand feature flags in the simplest term, feature flags are “if/else” statements to develop a conditional branch or pathway into your code. For example, you can use a feature flag to state that “if so and so feature is enabled, run new algorithm; or else, run old algorithm.” This allows developers to control the functionality—if the feature flag is enabled only then the new algorithm is executed; else skipped. This is the most basic form of feature flags, however, they could be more complex.

Feature flags are a practical way for software teams to maintain the delivery and release of features, and there are many advantages of using them. However, too many feature flags can make your code more complex and difficult to manage.

Here are the best practices of feature flagging that can save your project from becoming a feature flag hell.

More Feature Flags Equals Complex Code

Feature flagging is a good practice that can help you maintain the delivery and release of different features, however, using too many feature flags can quickly turn your code into a feature flag hell. The more feature flags you create, the more code paths are going to be created, this increases the complexity of your code and makes the testing process harder. A higher number of code paths can cause a mess and risk the functionality of your code. Therefore, it is best to only create feature flags when it makes sense and always check if a previously created feature flag can be re-used instead.

Name Your Feature Flags

For efficient management of feature flags, it is crucial to have a proper flag naming system. Without it, it is possible to confuse the flags, forget why they were created for, or create flags with the same name—all of which can cause disruptions and confusion. When working with a team of developers, it is important to ensure that everyone follows the same labeling method so they can get the information about the flag just by looking at the name. Otherwise, it is likely that a team member might mistakenly trigger the flags, upsetting your code.

Log and Clean Up Old Flags

Over time, it can become difficult to keep track of the changes that are made to a feature flag. Therefore, it is important to track changes through logging, especially when working in teams. Using logging, you can keep a track of who created the feature flag, who made a change and at what time. This can save you from wasting time figuring out who was responsible for what change. A log will set the record straight about every change introduced for every feature flag.

This is also great to know which flag and code paths are obsolete and redundant now. When you know which flags are unused you can clean them from your code to avoid any conflict or confusion.

Use a Feature Flag Management Tool

For better management, control and visibility of your feature flags, you can use available feature flag management tools. Like every other management tool, feature flag management tools are enterprise-scale software to manage feature flags. Some of the most popular tools include LaunchDarkly, Rollout and Bullet Train. Tools like these can make the management of feature flags easier for you and increase your development speed.

Use Feature Flags to Collect Data

When it comes to scaling your product, feature flags can be of great help to collect data from users. For instance, if you want to introduce a new feature, you can roll out the change slowly to a few users first. Using feature flags, you can make the new feature or update available to a smaller set of users only and collect data about how well they respond to the release. You can then use their feedback to improve or change your features to deliver an improved user experience. Feature flags are used in this manner by companies such as Facebook and Netflix to test their new features before releasing them for the entire user base.

Filed Under: Blogs, DevOps Practice, Doin' DevOps Tagged With: feature flags, Feature Toggles, Flagging, logging

  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Twitter (Opens in new window)