In my past and current web development positions, Staging / Beta and Production / Stable environments have shared a database.
Here's my understanding of what is going on:
Staging / Beta is basically identical to Production / Stable's server(s), except the public at large cannot access Staging / Beta
Once QA's tests pass the upcoming iteration of code on its own sanitized subset copy of Production / Stable data, the next step in the development is to make sure that the upcoming iteration of code will work with the full set of Production / Stable data while not breaking the existing Production / Stable website - that's the purpose of Staging / Beta. Also, a company can let beta-testers test out the code using the same data which the world at large can see. Then, when the beta-testers give the thumbs up, it should be a simple switch from the older iteration to the newer iteration of code.
One of my direct reports called this a "smell". He suggests that Staging / Beta should have a full and complete copy of Production / Stable's database -- thus if there truly is a problem with Staging / Beta code which was not caught during QA, it won't affect the Production / Stable experience. That was the answer with these two links:
So here's my question: in what exact cases SHOULD Staging / Beta and Production / Stable share a database server? Or are my current and previous companies doing things wrong / being cheap / etc.?
Thank you in advance for your thoughts.