Feature flag development: Controlling functionality without deployments
This article explains feature flags as a software development technique that enables teams to control functionality without code deployments. It covers their benefits, the advantages of using a purpose-built solution like Unleash versus building in-house, implementation details, enterprise features, and best practices for effective feature flag management. The article includes real-world examples of organizations that have transformed their development processes through feature flags.
Understanding feature flags
Feature flags (also known as feature toggles or feature switches) are a software development technique that allows teams to turn functionality on or off without deploying new code. At their most basic, feature flags are conditional statements in your code that determine which code path to execute at runtime.
For example, imagine you’re building a new checkout process for an e-commerce site. With feature flags, you could deploy the code but only enable it for internal testing teams initially, then gradually roll it out to customers while keeping the old checkout system available as a fallback.
The primary benefits of feature flags include:
- Decoupling deployment from release, enabling continuous deployment while controlling when users see new features
- Reducing risk by allowing gradual rollouts and instant rollbacks
- Enabling experimentation and A/B testing in production environments
- Supporting trunk-based development by allowing incomplete features to be merged into the main branch
- Providing kill switches for rapid incident response
Why build vs. buy matters
Many organizations begin their feature flag journey by building homegrown solutions. However, as Mark Quigley from Wayfair noted: “We flipped the most important flag we could when we went from our in-house system to Unleash. Right away we found that it was scalable, highly performant, resilient out of the box. And Unleash ended up being 1/3 the cost of our homegrown feature flag solution, while also improving the reliability and scalability of our platform.”
A purpose-built solution like Unleash offers several advantages over in-house systems:
- Reduced maintenance burden
- Comprehensive feature set and SDKs across languages and frameworks developed based on industry best practices
- Enhanced reliability and performance
- Better developer experience
- Stronger security and compliance controls
Consider a team that built their own feature flag system but now spends 20% of their development time maintaining it instead of building new product features. Switching to a dedicated solution could free up that time while providing more robust functionality.
Feature flag development with Unleash
Unleash provides developers with an intuitive platform for implementing and managing feature flags. Here’s how it works:
Implementation process
- Install the Unleash SDK: Unleash supports numerous programming languages and frameworks including JavaScript, Java, Go, Python, .NET, and more.
- Create a feature flag: Define a new feature in the Unleash UI, providing a name, description, and default state.
- Implement the flag in code: Add conditional logic using the Unleash SDK, e.g. if (unleash.isEnabled(‘new-feature’)) { // New feature code} else { // Old implementation}
- Configure rollout strategies: Unleash offers various activation strategies:
- Gradual rollout (percentage-based)
- User targeting (specific users or groups)
- Environment-specific releases
- A/B testing configurations
For instance, you could set up a rollout strategy that first enables a new recommendation algorithm for 5% of users, monitors performance, then gradually increases to 100% if metrics look good.
Advanced features for enterprise development
Unleash distinguishes itself with enterprise-ready capabilities that address the needs of large organizations:
Security and compliance
As Jason Crow, Lead Principal Architect at Total Wine & More, mentioned: “What appealed to us about Unleash was the central control via the Admin Console, as well as the security posture of running the entire infrastructure under our own architecture and standards.”
Unleash offers:
- Role-based access control (RBAC)
- Detailed audit logs
- Change request workflows
- Data privacy controls ensuring user data never leaves your environment
- Support for air-gapped and FedRAMP requirements
Scalability
Unleash is designed for high-performance environments:
- Low-latency flag evaluations
- SDK side caching to minimize network overhead
- High availability architecture
- Support for multi-region deployments
Developer experience
Good developer experience is critical for adoption. Unleash provides:
- Intuitive UI for feature management
- Comprehensive documentation
- Language-specific SDKs
- Integration with existing CI/CD pipelines
- API-first design for automation
Best practices for feature flag development
To maximize the benefits of feature flags while minimizing potential drawbacks, follow these best practices:
Flag lifecycle management
- Plan for removal: Establish a process for removing flags once they’re fully released to prevent code bloat. For example, set up a quarterly review where your team identifies flags that can be removed, or automate alerts for flags that haven’t changed state in 90+ days.
- Use naming conventions: Adopt consistent naming that indicates the flag’s purpose and scope.
- Document flags: Include descriptions and business context for each flag to help team members understand their purpose.
- Set expiration dates: Define when temporary flags should be removed to prevent accumulation of technical debt.
Architecture considerations
- Flag granularity: Determine the appropriate level of granularity – too many flags increase complexity, too few limit flexibility.
- Performance optimization: Use local caching to minimize latency impact of flag evaluations.
- Default values: Always specify default behaviors for when the flag service is unavailable.
- Testing strategy: Develop a comprehensive testing approach for all flag states.
Organizational practices
- Cross-functional collaboration: Involve product, QA, and operations teams in feature flag decisions.For instance, create a weekly feature flag review meeting where engineers, product managers, and QA discuss upcoming flags, those ready for wider release, and those that can be retired.
- Establish governance: Define clear ownership and decision-making processes for flag management.
- Monitoring and analytics: Track flag usage patterns and impact on system and business metrics.
Real-world impact
Organizations using Unleash have achieved significant improvements in their development processes:
Truls Jørgensen, Principal Engineer at the Norwegian Labor and Welfare Administration (NAV), shared their transformation: “Before 2016, NAV used to take pride in 4 huge, coordinated, massive releases per year. As of today, this number is over 1400 times per week, which translates roughly to once every other minute.”
Henning Støverud, Chief Architect at Talentech, noted: “By deploying more frequently, the size of each deployment has been drastically reduced and new functionality can be tested early and more gradually thanks to Unleash and feature toggles.”