deployment and operations
Development, Staging, And Production Strategy
Separate environments reduce deployment risk. They should run the same application and broadly the same deployment shape while using distinct data, credentials, scale, and operational controls. The goal is not to make staging expensive. It is to catch release problems before real users meet them.
Separate Values From Code
- Keep environment-specific values outside source code.
- Use separate credentials and services.
- Make staging realistic enough for release checks without copying sensitive production data casually.
Make Staging Useful
- Document config differences.
- Promote one tested artifact.
- Verify migrations, jobs, logs, and rollback per environment.
Watch For Drift
- Configuration drift makes staging misleading.
- Shared credentials increase blast radius.
- Production data in development creates privacy risk.
Environment Matrix
development: local services, synthetic data, verbose developer diagnostics
staging: production-like deployment shape, safe test data, release checks
production: restricted access, real traffic, monitored rollout, rollback ready
Document intentional differences. If a deployment succeeds in staging but fails in production, compare configuration, runtime versions, extensions, service connectivity, and process types before treating the failure as mysterious.
Practice
Practice: Compare Environment Configuration
Prepare a small environment matrix for development, staging, and production. Mark which values must differ and which deployment behaviours should remain comparable.
Requirements
- Keep environment-specific values outside source code.
- Use separate credentials and services.
- Make staging realistic enough for release checks without copying sensitive production data casually.
- Document config differences.
- Promote one tested artifact.
- Verify migrations, jobs, logs, and rollback per environment.
Show solution
Keep source code and the promoted artifact the same across environments. Use distinct credentials, databases, caches, mail destinations, and external-service keys. Development can show verbose diagnostics; production should log failures without exposing details to users.
Staging should still exercise the serving runtime, migrations, workers, logs, health checks, and rollback path. Record intentional differences so a production-only failure can be investigated systematically.