We've been storing our staging database around the production database server using the mindset that it seems sensible to become as just like production as you possibly can.
Recently, some comments make me question that idea. Since there's some remote chance which i is going to do something to production in error it might seem sensible not to put both on a single server.
Should my Staging database really live on a single server as my development database and different server as production?
Ideally you would like to possess a separate staging atmosphere that mirrors your live atmosphere, but does not really exist onto it. However, $$$ does not always permit this, therefore the ideal is not always adopted.
Including (but might not be restricted to) the next:
- Web servers
- Database servers
- Application servers
And anything on individuals machines (physical or virtual) ought to be isolated within their particular conditions, which means you should not see staging code on the production server, together with you should not visit a staging database on the production database server. They must be separate.
Also, if you are using great bandwidth internally you might want to even isolate the systems, to avoid the staging atmosphere bandwidth usage from flooding the development environment's bandwidth.
Whichever solution you may choose ultimately, I'd say : keep the production server for production, and production only !
Should you put some non-production onto it, there's the chance of mistakes, obviously, while you stated... But there's even the perils of bugs : let's say the application goes mad, and uses all of the CPU from the server, for example ? Your production might experience it.
And that is just a good example, obviously -)
For me, the very best solution is always to have another server for staging, having a setup that's as near as you possibly can (a genuine "clone" will be the best) towards the production setup.
Thinking about this may cost a great deal for any machine utilized by merely a couple of testers, it's frequently not too possible :-( An alternate I have seen is by using an online Machine (located in your development server -- not the development one) : it functions just like a "real" machine, on which you'll do anything you want, without impact eiter push nor dev.
And, if required, you should use several Virtual Machine, if must be nearest for your production configurations.
In my opinion a staging atmosphere ought to be independent since it allows you rehearse the roll-out methods for any era. If you're on a single box or same virtual machine you are not obtaining the "full" connection with library updates and so on.
Personally I love virtual machines because I'm able to pull production to stage after which update it. Which means that my update is very realistic, because all the edge situation data, libraries and the like are now being produced. This can be a positive thing... I can not count the amount of occasions within the 9 year good reputation for our major product which a library module wasn't incorporated or some update script for that database hit edge cases that were not detected in development and testing conditions.
So far as touching the development atmosphere... I'd say never do that if there's an alternate. Update a shared library in staging which impacts production and you'll have the discomfort. Update the code and cause your internet server to enter a tizzy and also you introduced (a minimum of a part of) your live atmosphere lower.
If you need to fake it, I would suggest discussing using the development conditions and merely understand that upgrading production make cause unpredicted down time throughout the update while you validate everything works. We needed to do this for that first couple of years for financial reasons also it can act as lengthy while you don't just update production and leave.
To sum up
- Production is sacrosanct: don't share any non-production aspects if you're able to cure it.
- Virtual machines are the friend: they allow you to clone working conditions increase all of them with nearly zero risk (just copy the VM file over any botched update attempts).
- Staging ought to be isolated from development to prevent overconfidence together with your update routine.