The advantages of feature flags
For every new feature that’s developed, it’s common practice to write test cases with expectations for how your app ought to behave. This ensures that future changes to your evolving codebase don’t cause disruptions for your users. However, no matter how well-defined your integration and acceptance test coverage might be, once code lands in production, there is always the possibility for unexpected bugs or issues to arise.
Real users in production can reveal more about how a feature works than any test ever could. For example, you may have neglected to optimize your database queries. This is a serious performance problem that only manifests when you have many active users and records. Or, you might expect you have enough CPU, memory, and disk space to run your app efficiently, only to find that your new feature is extremely popular, consuming all your available resources.
Gradually bringing users in through feature flags can help uncover—if not entirely mitigate—these issues. If you notice your database cannot keep up with the activities of your feature-flagged users, you can address the problem immediately, without incurring downtime for everyone. Feature flagging can help you monitor how your infrastructure handles an influx of new activity in scenarios you can’t predict.
Ultimately, feature flagging is about being careful, considerate, and controlled. Software can indeed be fickle, but as long as you know that, you can introduce changes slowly, with minimal fear of breaking something.