I'm looking at setting up a seperate database server for one of my applications, the application currently runs on 3 servers; 1 frontend server and 2 application/database servers. But for performance reasons I'm looking to move the database onto it's own machine(s).
So it comes down to this, am I better off getting two servers and setting them up as replicas of each other. Or just one server but make it twice as powerful?
Things I've thought of so far;
With one server:
- Easyer to manage
- More CPU/Memory/Disk avaliable to the database as the OS will only take up one lot of resorces
- More storage space (If the DB was replicated I'd need 2x the amount of disk storage to store the same data)
- Cheaper (With rented servers only a little bit, but I imagine more so on purchased servers)
With two servers:
- Better redundancy (Kernel Panic/Disk Failure/OS Failure/Network Failure and the database as a whole would still work, but probably slow down a bit)
- Less disk/network IO per server (Would this make it faster?)
Some technical details specific to my situation;
The servers would be run on a cloud service called StormOnDemand so we wouldn't really have too many issues with hardware reliability. We could also scale vertically up and down as needed.
We use 4 different database systems; Postgresql, MongoDB, Redis and Memcached*
Last time I checked, we average just over 2mill transactions a day on Postgres, about 2.5mill on Mongo, not sure about Redis and Memcached but we use them both for caching so I would imagine it's about the same.
The servers are all connected via a 1GB/s local network.
The databases are, I would say, about medium size (Postgresql: 32GB, MongoDB: 16GB, Redis and Memcached both use memory for storage but I think they currently run about Redis:12GB and 4GB)
The servers I would be looking at getting would ether be a 8CPU and 30GB RAM for a single server, or 4CPU and 8GB RAM for two servers
For redundency, it's a web app and the vast majority of our visitors are reccuring so, although we don't want downtime, we'd be happy with a couple of hours a month for the cost savings we'd get from a single server. In 6 months running with SOD we've never had any downtime but that's not to say it won't happen in the future.
If I've excluded any details that would be useful I'm happy to provide them but I've tried to include as much as possible.
*Memcached would continue to run on the application servers, we use it as a sort of 'local cache' as such it's not replicated/sharded across servers, using Redis as a distributed cache