Bugs keep passing staging and appearing in production. How do you make staging closer to prod?
IntermediateScenarioMulti-env and multi-account
Answer
Situation read → Staging usually differs in config, versions, data size and traffic. You can't copy everything, but you can remove the differences that matter.
What I'd do →
- Look at the last ten escaped bugs and classify why staging missed them. That tells you which gap to fix first.
- Same IaC modules for both, with only size and count as variables; no hand-built staging resources.
- Same versions: database engine, Kubernetes, add-ons, and feature flag defaults.
- Realistic data: a masked copy of prod for shape and volume.
- Realistic traffic: replay or a load test before big releases.
- Accept what's left: use canaries and feature flags in prod for the gaps staging will never close.
Why → Parity through shared code is cheap; full parity in size and traffic is expensive, so cover that gap with progressive delivery.
Interview tip → Start from the escaped bugs data; it shows you fix the real gaps, not imagined ones.
More on Multi-env and multi-account
Design the AWS account structure for a 50-engineer startup that's growing fast.IntermediateHow do you promote the same build from dev to staging to prod?BeginnerHow do you structure Terraform for dev, staging and prod? Workspaces, directories or Terragrunt?IntermediateDevelopers want a preview environment for every pull request. How would you build it?AdvancedHelm values files or Kustomize overlays for per-environment config?BeginnerCI runs in a shared tools account and must deploy to dev, staging and prod accounts. How do you set up access?Intermediate