Gradual Rollouts
Gradually release features from 0% to 100%
A gradual rollout releases a feature to a growing portion of users over time. Start at 0%, increase gradually, reach 100%.
How It Works
When you set a gradual rollout:
Flipswitch:
- Hashes the user's
targetingKey - Maps the hash to a bucket (0-99)
- Returns the variant based on bucket
User alice@example.com might hash to bucket 42. With 10% rollout, she gets the old feature. Increase to 50%, and she gets the new feature.
Properties
Deterministic. Same user, same bucket, same variant. Alice always sees the same thing.
Consistent. Increasing from 10% to 20% doesn't reassign users in the first 10%. Users who had the new feature keep it.
Even distribution. Hash function distributes users evenly across buckets. 10% means roughly 10% of users, not exactly.
Implementation
1. Create the Flag
2. Configure Rollout
Start at 0%:
3. Evaluate in Code
4. Increase Gradually
Watch metrics at each stage before increasing.
The targetingKey
The targeting key determines which bucket a user falls into:
For stateless services, use a consistent identifier like request ID:
Combining with Rules
Targeting rules are evaluated before gradual rollouts. If a rule matches, the rollout is skipped:
Internal and beta users always get the new feature (via rules). Everyone else has a 10% chance (via rollout).
Multi-Variant Rollouts
For A/B tests or multiple variants:
Ring-Based Rollouts
Some teams use "rings" for staged rollouts:
This combines segments (for ring 0) with gradual rollouts (for rings 1-4).
Rollback
If something goes wrong at 25%:
All users immediately get the old behavior. Users who had the new feature switch to the old one.
Cleanup
At 100% with stable metrics:
- Remove the flag check from code
- Keep the flag for a week (in case you need to roll back)
- Delete the flag
- Remove the old code path