Environments
Development, staging, and production environments with isolated configuration.
Environment Management
Overview
AlgorithmShift provides a robust environment management system that enables safe development, testing, and deployment workflows. Each environment is isolated with its own configuration, database, and secrets.
Environment Types
Default Environments
| Environment | Purpose | Deployment | Access |
|---|---|---|---|
| Development | Active development | Auto on push | Developers |
| Staging | Pre-production testing | Manual promote | Team + QA |
| Production | Live users | Manual + Approval | Restricted |
Custom Environments
Create additional environments for:
- Feature branches
- Client demos
- Load testing
- Security audits
- Regional deployments
Database Configuration
Per-Environment Databases
Each environment can have its own database configuration:
typescript
interface DatabaseConnection {
id: string;
name: string; // "Primary Database"
type: 'postgres';
// Connection (per environment)
values: {
development: {
host: 'dev-db.example.com';
port: 5432;
database: 'myapp_dev';
};
staging: {
host: 'staging-db.example.com';
database: 'myapp_staging';
};
production: {
host: 'prod-db.example.com';
database: 'myapp_prod';
ssl: true;
poolSize: 20;
};
};
}Secrets Management
Secret Storage
Secrets are stored securely in AWS Secrets Manager:
typescript
interface Secret {
id: string;
name: string; // STRIPE_SECRET_KEY
description: string;
rotationEnabled: boolean;
rotationDays?: number;
}Common Secrets
| Secret | Purpose |
|---|---|
DB_PASSWORD | Database credentials |
STRIPE_SECRET_KEY | Payment processing |
SENDGRID_API_KEY | Email service |
AWS_ACCESS_KEY_ID | Cloud services |
JWT_SECRET | Token signing |
ENCRYPTION_KEY | Data encryption |
Deployment Pipeline
Pipeline Visualization
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Development │───▶│ Staging │───▶│ Production │
│ │ │ │ │ │
│ Auto-deploy │ │ Manual │ │ Approval │
│ on push │ │ promote │ │ required │
└─────────────┘ └─────────────┘ └─────────────┘Promotion Flow
- Code Commit → Development auto-deploys
- Testing Complete → Promote to Staging
- UAT Approved → Request Production deploy
- Approval Received → Deploy to Production
Best Practices
Development Environment
- Enable all feature flags
- Use debug logging
- Disable rate limiting
- Use test data
- Allow CORS from localhost
Staging Environment
- Mirror production configuration
- Use production-like data (anonymized)
- Enable performance monitoring
- Test with realistic load
- Verify integrations
Production Environment
- Enable all security measures
- Configure proper logging (warn/error)
- Set up monitoring and alerts
- Implement rate limiting
- Use read replicas for scale
- Regular backup schedule
- Document runbooks