Rollouts & Kill Switches
Learn how to safely roll out features and use kill switches to quickly disable features in emergencies.
Feature Rollouts
A rollout is the process of gradually enabling a feature for an increasing percentage of users.
Rollout Strategy
Phase 1: Internal Testing (1-5%)
Start with a small percentage to catch issues early:
- Enable for 1% of users
- Monitor for 24-48 hours
- Check metrics, error rates, and user feedback
- Increase to 5% if no issues
Phase 2: Early Adopters (5-25%)
Expand to early adopters:
- Increase to 5% of users
- Monitor for another 24-48 hours
- Increase to 10%, then 25%
- Watch for edge cases and unusual patterns
Phase 3: Majority (25-100%)
Roll out to the majority of users:
- Increase to 50% of users
- Monitor closely for issues
- If stable, increase to 100%
- Consider keeping at 95% as a safety margin
Rollout Best Practices
- Start Small: Always begin with 1-5%
- Monitor Continuously: Watch metrics throughout the rollout
- Increase Gradually: Don't jump from 10% to 100%
- Have Rollback Plan: Know how to disable quickly
- Document Decisions: Record why you're rolling out and what you're watching
Kill Switches
Kill switches are feature flags used to quickly disable features in emergencies without code deployment.
Creating Kill Switches
- Create a feature flag for critical features
- Name it clearly (e.g.,
kill-switch-payment-gateway) - Set up monitoring and alerts
- Document the rollback procedure
Using Kill Switches
// Critical payment feature
const paymentEnabled = await toggly.isFeatureEnabled('new-payment-gateway');
if (!paymentEnabled) {
// Fall back to legacy payment system
return processLegacyPayment();
}
// Use new payment gateway
return processNewPayment();
Kill Switch Best Practices
- Create for Critical Features: Use kill switches for features that could cause major issues
- Test Regularly: Periodically test that kill switches work
- Monitor Alerts: Set up alerts for kill switch activations
- Document Procedures: Document when and how to use kill switches
- Train Team: Ensure team members know how to use kill switches
Emergency Procedures
When to Use a Kill Switch
Use kill switches when:
- High Error Rates: Error rates spike unexpectedly
- Performance Degradation: Response times increase significantly
- Business Metrics Drop: Conversion rates or revenue drop
- User Complaints: Significant increase in support tickets
- Security Issues: Potential security vulnerabilities detected
How to Activate a Kill Switch
- Navigate to the feature flag in the dashboard
- Click Disable (or set percentage to 0%)
- Verify the feature is disabled
- Monitor metrics to confirm the issue is resolved
- Investigate the root cause
- Fix the issue before re-enabling
Post-Incident
After using a kill switch:
- Document the Incident: Record what happened and why
- Root Cause Analysis: Investigate the root cause
- Fix the Issue: Resolve the underlying problem
- Test Thoroughly: Test the fix before re-enabling
- Gradual Re-enablement: Re-enable gradually, not all at once
Monitoring During Rollouts
Key Metrics to Watch
- Error Rates: Percentage of failed requests
- Performance: Response times and latency
- Business Metrics: Conversion rates, revenue
- User Feedback: Support tickets, user complaints
- Feature Usage: How often the feature is used
Setting Up Alerts
Configure alerts for:
- Error Rate Thresholds: Alert if error rate exceeds X%
- Performance Degradation: Alert if latency increases by X%
- Business Metric Drops: Alert if conversions drop by X%
- Anomaly Detection: Alert on unusual patterns
Rollout Examples
Example 1: New Checkout Flow
Day 1: Enable for 1% of users
Day 2: Monitor metrics, no issues → increase to 5%
Day 4: Monitor metrics, no issues → increase to 10%
Day 6: Monitor metrics, no issues → increase to 25%
Day 8: Monitor metrics, no issues → increase to 50%
Day 10: Monitor metrics, no issues → increase to 100%
Example 2: Premium Feature
Week 1: Enable for premium users only
Week 2: Monitor metrics and feedback
Week 3: Expand to premium + enterprise users
Week 4: Monitor metrics
Week 5: Roll out to all users if successful
Best Practices
1. Always Have a Rollback Plan
Know how to disable features quickly before starting a rollout.
2. Monitor Continuously
Watch metrics throughout the rollout, not just at the end.
3. Start Small
Always begin with a small percentage (1-5%) to catch issues early.
4. Increase Gradually
Don't jump from 10% to 100%. Increase in stages.
5. Document Everything
Record rollout decisions, metrics, and any issues encountered.
Next Steps
- Learn about Experiments Setup
- Explore Monitoring Metrics
- Read about Release Strategies