6 comments

[ 1.4 ms ] story [ 32.8 ms ] thread
Why have staging if it doesn't catch all issues? I dunno, why have airbags in your car if it doesn't stop all injuries?
While I get your sentiment and even agree on the airbag part of it, we also don't have a staging environment in that sense. Talking SaaS here.

Instead, every developer actually has a full clone of the production environment with all services running while developing. By default only one pod is started for each service (talking Kubernetes here) but if you think it warrants it for what you're currently working on, start a second copy of the pod and see it in action.

QA also tests the same way, i.e. they have their own copy of the production cluster that they deploy the branch they're testing onto.

Once stuff goes to master, we automatically do a 'sanity deploy' to a separate cluster just to make sure that the deployment to prod itself is likely to succeed. Nobody ever tests anything on this cluster though. Nobody tests master after stuff is merged. It's literally just a "yes, CD scripts still work" type of thing. And then it goes out to Prod.

But, you will never have a literal clone of production. Even if the structure is the same, you will need different configurations.

Something like an encryption key isn't a meaningful difference, since it's essentially sampled randomness.

However, keys to integrations need to vary outside of production. I don't want to literally be charging credit card or sending emails or a bunch of other things. This results in an environment that is different, no matter how much they resemble each other.

I agree, configuration can and will be different. Just like I mentioned for example, we don't run the same number of replicas as Prod either etc.

The staging environment or any other kinds of testing environments will also have the same issues of differing configuration. Always. So there's really no difference there.

Since you mention credit cards, I don't know which PSPs you've dealt with, but there's a bunch out there, where you do _not_ get a separate URL for their test/staging environment. If you're lucky, you get test credentials and if you're not, then all you get is "To make a failed test transaction use 4111 1111 1111 111, any CVV, to make a successful test transaction, use same card with CVV 123". And these same PSPs tell you about PCI compliance and such.