Environment Deployment Workflows
Learn proven workflows for safely deploying changes from development to production using KnoxCall environments.Standard Three-Tier Workflow
Workflow Overview
| Environment | Purpose | Stability | Users |
|---|---|---|---|
| Development | Feature development, experimentation | Unstable | Developers |
| Staging | Pre-production testing, QA | Stable | QA team, stakeholders |
| Production | Live customer-facing system | Very stable | End users |
How KnoxCall Makes This Easy
With KnoxCall, you don’t need to change code or redeploy your client applications to switch environments. Traditional approach:Deployment Process
Step 1: Develop in Development
What: Make code changes and test locally KnoxCall setup:- Environment:
development - Target URL:
http://localhost:3000 - Secrets: Dev API keys
- Clients: Your laptop IP
- Rate limits: Unlimited
http://localhost:3000/api/users
Iterate quickly:
- Make changes to local backend
- Test immediately
- No deployment needed
Step 2: Promote to Staging
What: Deploy backend to staging server, run full QA KnoxCall setup:- Environment:
staging - Target URL:
https://staging-api.yourcompany.com - Secrets: Staging API keys
- Clients: Staging server IPs, QA team IPs
- Rate limits: Moderate (1000/min)
https://staging-api.yourcompany.com/api/users
Staging checklist:
- All unit tests pass
- Integration tests pass
- Manual QA completed
- Performance acceptable
- Security scan passed
- No critical bugs
- Stakeholder approval
Step 3: Deploy to Production
What: Deploy to live environment after thorough testing KnoxCall setup:- Environment:
production(base environment) - Target URL:
https://api.yourcompany.com - Secrets: Production API keys
- Clients: Production server IPs only
- Rate limits: Strict (100/min)
https://api.yourcompany.com/api/users (default/base environment)
Post-deployment monitoring:
- Monitor error rates in KnoxCall dashboard
- Check response times
- Watch for spike in 5xx errors
- Verify no increase in failed requests
- Monitor user reports/support tickets
Environment-Specific Configuration
Different Rate Limits Per Environment
Development: Relaxed for testing- Edit route
- Go to Environment Overrides tab
- Set different
rate_limit_requestsandrate_limit_windowper environment
Different Secrets Per Environment
Use environment-specific secrets for security: Development route override:Different Monitoring Thresholds
Development: No alerts (expect errors during development) Staging: Warning-level alerts- Alert if error rate > 20%
- Alert if P95 latency > 5 seconds
- Send to Slack
#staging-alertschannel
- Alert if error rate > 5%
- Alert if P95 latency > 1 second
- Send to PagerDuty for on-call rotation
- Send to Slack
#production-alertschannel
- Navigate to Alerts
- Create alert rules with environment filters
- Set different thresholds per environment
- Configure notification channels
Rollback Strategy
If production deployment fails, you can roll back instantly without code changes.Quick Rollback via Environment Override
Scenario: New backend version (v2) has critical bug Option 1: Point production to old backend- Edit route → Environment Overrides
- Add override for “production” environment
- Set target URL to old backend:
- Save
- Edit route → Environment Overrides
- Override production target URL:
- Save
Full Rollback Workflow
Advanced Deployment Patterns
Feature Branch Environments
For large features, create temporary environments: Example: New payment system- Create environment:
feature-payment-v2 - Configure route override:
- Target URL:
https://payment-v2-api.yourcompany.com - Secrets:
payment_v2_api_key
- Target URL:
- Test feature branch in isolation
- After merge: Delete
feature-payment-v2environment
- Test big changes safely
- Don’t interfere with staging
- Easy cleanup after merge
Canary Deployments
Gradually roll out to production: Phase 1: Internal testing (5% of traffic)Blue-Green Deployments
Run two identical production environments: Blue (current production):Regional Environments
For global applications, route by region:- Data sovereignty compliance
- Reduced latency (users hit closest region)
- Region-specific deployments
- Isolated failures (one region down doesn’t affect others)
Monitoring Across Environments
Compare Metrics Dashboard
Create a dashboard showing all environments side-by-side:| Metric | Development | Staging | Production |
|---|---|---|---|
| Request volume | 50/min | 500/min | 5,000/min |
| Error rate | 15% (expected) | 2% | 0.5% |
| P95 latency | 2s | 500ms | 200ms |
| Success rate | 85% | 98% | 99.5% |
- Navigate to Analytics
- Group by “Environment”
- Compare metrics across environments
- Spot differences between staging and production
Environment Health Dashboard
Monitor the overall health of each environment:Troubleshooting Deployment Issues
Changes Not Showing in Staging
Symptoms: Made changes, but staging still shows old behavior Possible causes:- Backend not deployed yet
- Wrong environment header in request
- Caching (client-side or CDN)
- Environment override not configured
Different Behavior Between Environments
Symptoms: Works in staging, fails in production Possible causes:- Different secrets (dev keys vs prod keys)
- Different backend code versions
- Different environment variables
- Different database state
- Different rate limits causing throttling
- Compare route configurations (base vs overrides)
- Verify secrets are environment-specific
- Check backend versions match
- Compare environment variables
- Review rate limit settings
- Check database schema versions
Pre-Deployment Checklist
Before each production deployment, complete this checklist:Pre-Deployment
- All tests passing in staging
- Stakeholder approval received
- Rollback plan documented
- Team notified in Slack
- Monitoring dashboard ready
- On-call engineer identified
- Database migrations tested (if any)
- Feature flags configured (if applicable)
During Deployment
- Deploy backend to production
- Verify health endpoint responds
- Test critical user flows manually
- Monitor error rates in real-time
- Check latency metrics
- Review first 100 production requests
Post-Deployment
- Monitor for 30 minutes
- Review error logs (should be stable)
- Check analytics (traffic patterns normal)
- Verify zero increase in support tickets
- Update team status: “Deployment successful”
- Update documentation (if needed)
- Mark deployment as stable in tracking system
Best Practices Summary
✅ Do:- Always test in development first
- Require QA approval for staging → production
- Set production as default environment
- Use different API keys per environment
- Monitor each environment separately
- Document rollback procedures
- Keep staging close to production config
- Run load tests in staging
- Deploy directly to production without staging
- Use production API keys in development
- Skip the staging environment (“it’s just a small change”)
- Forget to monitor after deployment
- Make manual changes directly in production
- Test in production (use staging!)
Next Steps
Now that you understand deployment workflows:Alert Configuration
Set up environment-specific alerts
Secret Management
Manage secrets per environment
Rate Limiting
Configure limits per environment
Audit Logs
Track configuration changes
Related Concepts
- Base Route: Default production configuration
- Environment Override: Environment-specific settings (NULL = inherit)
- Default Environment: Used when no header specified
- Environment Clients: IP whitelist per environment
- Rollback: Point route to previous backend version
📊 Statistics
- Level: intermediate
- Time: 15 minutes
🏷️ Tags
environments, deployment, workflows, devops, staging