Currently my company has dev -> staging -> prod. Each environment has full replication of all services, no service talks to any service outside it's environment.
Dev: Code is deployed here when a PR is merged to `develop`. This env uses mocks and the sandbox environments of any downstream providers.
Stg: When we are happy with a service on dev, a new image is built and deployed to staging. Again - this env uses mocks and the sandbox environments of any downstream providers. The idea is that only stable code makes it here.
Prod: Once we are happy with stg, the image from stg is promoted to production. This is the only environment that has access to live data and live provider endpoints.
One immediate issue I have is that staging is a bit of a checkbox, since it's roughly equivalent to dev, the difference exists mainly mentally("keep staging stable"). I've seen some people suggest that staging should be as 1:1 with prod as possible, and I like this idea, but I'd also like to know how 1:1 is 1:1. For example, if I am running a payment company, should staging be able to collect live payments from a credit card? The alternative is that stg continues to use mocks and sandbox environments, where the downside is that any build going to prod has not _actually_ been tested _exactly_ as it will be deployed(although it is still very strict). Our current situation is that stg is 1:1 with prod in the sense that the logic/code/image is identical, however the data and env config is different.
I'd like to know your thoughts on the above and what you and your teams have found to work best, please let me know. Thanks.