View Full Version : Separate Web Server & Database Server vs. 1 Beefy VPS
tim_o
02-26-2007, 10:39 PM
I am considering two options for a Ruby on Rails project:
* Web VPS with 224 MB RAM
* MySQL VPS with 160 MB RAM
VS.
* Single VPS with with 480 MB RAM
Both options are equivalent price wise. To me it makes sense to keep them separate to prevent them from trampling on each other. However, the single VPS options gives more overall memory.
Are there any general suggestions for this? Scalability advantages?
Thanks,
Tim
timharig
02-27-2007, 02:59 AM
The first reason, which you have already stated is that it keeps the systems more cleanly separated which in my mind simplifies managment. It also helps stability if not from being cleaner then from the fact that one system may go down without affecting the other. The database server might go down but some of your website might remain functional. Likewise, if your webserver go down and you use your database for anything else besides running the web back end (like keeping internal data for applications or servering more then one webserver), then you may still have those functions available. I, for instance, use database servers for scheduling applications as well as for the webservers. Having more levels of rundency is always a plus if possible..
The second reason is security. Once again it is possible, if you are very careful to separate the functionality of the two systems (ie, neither system trusts the other), then one system may remain secure while the other is compromised. For example, the database server may hold data which is not available to the webserver. The webserver might be compromised but the cracker was still not able to get ahold of any confidential information.
Finally, databases are highly IO bound. I don't know whether this logic holds true for VPSs but if the systems were normal it might be beneficial to have the webserver accessing a different hard drive so that they are not competing for IO resources. Whether this advantage is mitigated by extra RAM caching depends on how predictable your database queries are and by how much of your database load is read versus how much of it is writing.
There are situations when having them both on the same server is beneficial and it would depend on your application but I generally consider two machines better then one most of the time. I know that is not always possible with the resources you are given but when I have the choice I will always go with the second server.
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.