<p>When I have two mysql servers that have different jobs (holding different databases) but want to be able to use one of them to slip in when the other one fails, what would you suggest how I keep the data on both of them equal "close to realtime"? </p>

<p>Obviously it's not possible to make a full database dump every x minutes.</p>

<p>I've read about the <a href="http://dev.mysql.com/doc/refman/5.0/en/binary-log.html" rel="noreferrer">Binary Log</a>, is that the way that I need to go? Will that not slow down the fallback server a lot? Is there a way to not include some tables in the binary log - where it doesn't matter that the data has changed?</p>

[{'answer_id': 8115, 'author': 'Adam Ernst', 'author_id': 79, 'author_profile': 'https://Stackoverflow.com/users/79', 'pm_score': 3, 'selected': True, 'text': "<p>Binary log is definitely the way to go. However, you should be aware that with <strong>MySQL</strong> you can't just flip back and forth between servers like that.</p>\n\n<p>One server will be the <strong>master</strong> and the other will be the slave. You write/read to the master, but can only read from the slave server. If you ever write to the slave, they'll be out of sync and there's no easy way to get them to sync up again (basically, you have to swap them so the master is the new slave, but this is a tedious manual process).</p>\n\n<p>If you need true hot-swappable backup databases you might have to go to a system other than <strong>MySQL</strong>. If all you want is a read-only live backup that you can use instantly in the worst-case scenario (master is permanently destroyed), Binary Log will suit you just fine.</p>\n"}, {'answer_id': 60711, 'author': 'Erik', 'author_id': 4484, 'author_profile': 'https://Stackoverflow.com/users/4484', 'pm_score': 2, 'selected': False, 'text': '<p>You may want to consider the <strong>master-master</strong> replication scenario, but with a slight twist. You can specify which databases to replicate and limit the replication for each server.</p>\n\n<p>For server1 I would add <code>--replicate-do-db=server_2_db</code> and on server2 <code>--replicate-do-db=server_1_db</code> to your my.cnf (or my.ini on Windows). This would mean that only statements for the server_1_db would be replicated to server2 and vice verse. </p>\n\n<p>Please also make sure that you perform full backups on a regular basis and not just rely on replication as it does not provide safety from accidental <code>DROP DATABASE</code> statements or their like.</p>\n'}]
['https://Stackoverflow.com/questions/8107', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/999/']