Percentage-Based Feature Rollout
Configure a feature flag with percentage-based rollout to gradually expose a feature to an increasing portion of users, reducing risk during launches.
Detailed Explanation
Percentage-Based Rollout
A percentage rollout releases a feature to a fraction of your user base. Instead of an all-or-nothing launch, you incrementally increase the percentage while monitoring for issues.
Configuration Example
{
"new-checkout-flow": {
"name": "New Checkout Flow",
"description": "Redesigned checkout experience with fewer steps",
"type": "boolean",
"enabled": true,
"defaultValue": false,
"targeting": [
{
"type": "percentage-rollout",
"percentage": 10
}
]
}
}
How Percentage Hashing Works
The percentage is not random on each request. Instead, the user's ID is hashed to produce a consistent bucket number between 0-99. If a user falls in bucket 0-9 (for a 10% rollout), they see the feature. This ensures the same user always gets the same experience.
Recommended Rollout Schedule
| Phase | Percentage | Duration | Purpose |
|---|---|---|---|
| Canary | 1-2% | 1-2 hours | Catch critical bugs |
| Early | 5-10% | 1-2 days | Monitor performance metrics |
| Mid | 25-50% | 3-5 days | Validate at scale |
| Wide | 75-90% | 2-3 days | Final validation |
| Full | 100% | Permanent | Complete rollout |
Unleash Strategy
In Unleash, this uses the gradualRolloutUserId strategy with a percentage parameter and a groupId for consistent bucketing.
Monitoring Tips
- Track error rates by flag variation (on vs off)
- Compare page load times between groups
- Monitor conversion rates if the feature affects a funnel
- Set up alerts for anomalies in the feature-on group
Use Case
Rolling out a redesigned checkout flow for an e-commerce platform. Start with 2% of users to catch critical issues, increase to 10% after 24 hours of clean metrics, then progressively reach 100% over a week.