I currently have my web app on a single cloud server. Been doing this for a few months now and I have EVERYTHING on this instance (app, cron scripts, mysql, svn, dev environment, etc).
The site is getting bigger now and I'm going to open up a new server instance. What is the best way to utilize this? I have a few options:
Move my development environment over to the new instance along with production cron scripts (the scripts will do operations on the database). The production app and the database itself would still stay in the old server. This option will help minimize any accidental crashes to the production server if I want to do anything on the development server. But it won't be a pure production/development separation because I will still be running cron scripts and maybe thinking of hosting some static assets on the new instance (trying to utilize the most out of this setup).
Move database over to the new instance. This seems like a standard option from the research I've done. But a few questions come to mind: What should be done about the dev/prod separation (do I even need to separate the two)? Static assets--keep in app server or the db server?
I can only afford the total of two servers for now. I would love to get 3, but this is what I have to work with in the meantime.
Thanks for your feedback!
I doubt my response is 'standard', but another opinion might not hurt.
I would suggest using the second instance to try and attain high-availability. Use HAProxy to load balance between the two servers, and have a distributed filesystem (Gluster) for replicating files between the instances. Have each server monitor the other (e.g. Corosync/Heartbeat/Keepalived), and if one goes down, have the other take over, and launch a new instance. If you have been getting along so far with a single instance, it seems a waste to simply move the databases to one server, as it will probably not be fully utilized.
Essentially, my suggestion is full redundancy - that will split the load between the two servers. You could set the weights such that the 'primary' machine handles more web requests, and the 'secondary' machine handles more database requests, or just leave them equal.
I think the end result of this would be more beneficial than just offloading one aspect of the processing to another server, disproportionately using your servers, and having multiple points of failure.
As for the dev environment, I might suggest that is trickier. A dev environment on a production machine could potentially go wrong. (On the other hand, just keeping an SVN repository on it might not be as risky, if it is well secured).