Staging Environment
Posted by HourExam1541@reddit | ExperiencedDevs | View on Reddit | 13 comments
A staging environment should mimic production environment as closely as possible to provide a means to test functionality, performance, and useability in relation to original business requirements.
Other than the size of allocated resources, restriction of business users, etc. What else should be implemented in a staging environment and not in production, or vise versa? Any resources formalizing environment setup are highly appreciated.
0dev0100@reddit
For my staging environments I'll usually have them setup to be easier to access the individual services directly.
Generally lower power than prod.
Emails might get sent differently depending on the application and what it's testing
Everything else is basically the same.
Saki-Sun@reddit
Worth repeating. This is a great way to catch performance issues early.
nothing786767@reddit
Depends on the application
inputwtf@reddit
Regular copying/import of production data from a backup of production
Life-Principle-3771@reddit
Depending on the data size you can also just sample production data.
Testing the integration between your service and it's data is incredibly important.
johnpeters42@reddit
Depending on the nature of the data, you can also generate new data based on previously sampled data. (We store some revenue data and want some variation in it, doesn't have to be super realistic, just not "every entry is exactly $1" which a previous cow-orker actually wrote).
Also, yeah, things like emails to outside users should be redirected to an internal mailbox and labeled as coming from staging, etc.
morosis1982@reddit
Depending on the data, obfuscated production data.
We have a customer profile backend that uses a library to generate realistic looking profiles, including junk email addresses. This is important because it has prod-like integrations into other UAT envs and we don't want any real user data escaping our little wall.
It happened when I took control of that team, staging was a copy of prod data, luckily the fake invoice was sent to the partner of an employee, but I made it my mission at the time to replace all the data and push it downstream.
justaguy1020@reddit
😬
flavius-as@reddit
Wrong.
Production should mirror staging, with a very minimal set of patches on top.
The extreme I got it to was to have a single script differ: the one which was doing a load balancer fail-over. The production one was using the API of the cloud vendor, while the internal one was using standard Linux commands.
The path to the script was the same, so it was like a black box.
To prove that this was all correct, the cluster was able to rebuild itself from ansible playbooks etc inside of itself. It was actually part of the standard way of upgrading infrastructure: it was doing this matrix-like Isomorphic build of itself, promoting and self testing, and production was then mirroring the stable staging.
Changes flow in one direction only: from dev, to staging, to prod, including infrastructure changes.
The moment you think backwards and try to mirror production, you are more likely to have bugs.
Oh and BTW, part of the promotion process was that developers would run on their laptops the new staging environment for development work for 2 weeks for staging to get promoted to production.
mxdx-@reddit
Depends on the type of application, your data and your access / identity paradigm.
Consider the data you carry onto staging, be mindful of the confidentiality / classifications of data. You don't want real world user data cloned into staging.
Depends also on the type of application, a SaaS doesn't offer the same flexibility an app would infra wise and data wise, so you might have limited options compared.
den_eimai_apo_edo@reddit
Normal testing / workflows? Or am I misunderstanding
pseudo_babbler@reddit
Often there are external things that can't be replicated exactly, like payment gateways (the providers have test payment gateways but they're hilariously badly managed), email gateways, data feeds are reduced because processing the full prod data feeds is too much, bank feeds, less log redaction. Plus the obvious ones like, you know, it shouldn't be available on the open internet.
03263@reddit
Depends on the application