Good Enough Failover Strategy for DNS / MySQL / Email
- by IMB
I've asked and read a lot questions regarding DNS failover but the more I read the more complicated it becomes, some people say it's good enough some say it isn't. No clear answers from what I read. I was wondering if we can set it straight once and for all, at least for the requirements of most websites out there.
Right now let's assume the following:
We don't need really need load-balancing, what we need is a failover solution.
We are running a website based on LAMP on a VPS.
We need to make sure that the Web Server, MySQL, Email are always accessible if not 99%.
Basically here's my idea and questions about it:
Web Server:
We need at least one failover server (another VPS on a separate data center).
Is DNS Failover via Round Robin good, if not, what's the best? And how do you exactly implement it?
How do you make the files you upload/delete on Server A is also on Server B?
MySQL:
I've only read a brief intro to MySQL replication and I assume that I can replicate Server A to Server B and vice versa on the fly right?
So just it case Server A fails and Server B is now running, it will continue to work and replicate to Server A when it becomes available. So in essence Server B is now the primary server, and will later on failover to Server A, should a failure happen again.
Email:
If we are gonna use DNS Failover, using webmail or relying on emails stored on the server is probably not a good idea right? Since some emails might be on Server A while some might be on Server B?
I assume a basic email forwarder to a 3rdparty is good enough (like Gmail for example) to ensure all emails are kept in one place.
Here's a basic diagram for a better picture: http://i.stack.imgur.com/KWSIi.png