<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: MySQL Replication vs DRBD Battles</title>
	<atom:link href="http://www.mysqlperformanceblog.com/2008/04/28/mysql-replication-vs-drbd-battles/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mysqlperformanceblog.com/2008/04/28/mysql-replication-vs-drbd-battles/</link>
	<description>Everything about MySQL Performance</description>
	<pubDate>Wed, 27 Aug 2008 23:50:41 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: joelb</title>
		<link>http://www.mysqlperformanceblog.com/2008/04/28/mysql-replication-vs-drbd-battles/#comment-320145</link>
		<dc:creator>joelb</dc:creator>
		<pubDate>Mon, 30 Jun 2008 19:26:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/04/28/mysql-replication-vs-drbd-battles/#comment-320145</guid>
		<description>hello, we are debating DRBD vs MySqL replication. The idea would be two servers, one master, one slave running drbd. Second server would never be live unless the first server crashed, or needed maintainance. There would be a third server not at the colo that would use mysql replication to keep as closely up to date as possible with the master server at the colo, and be used as a failover in the event of an outage. 

I'm confused by what I've read: After a crash, the slave is now live. How long does it take to resync the master with the slave? Can the slave simply become the master and the master now be considered the hot spare slave that will take over if the new "master" machine ever crashes?

Thanks,

Any comments (&#38; the sooner the better) would be helpful, also any direction to a community of folks who are deeply involved with these technologies would be helpful as well.

 - Joel</description>
		<content:encoded><![CDATA[<p>hello, we are debating DRBD vs MySqL replication. The idea would be two servers, one master, one slave running drbd. Second server would never be live unless the first server crashed, or needed maintainance. There would be a third server not at the colo that would use mysql replication to keep as closely up to date as possible with the master server at the colo, and be used as a failover in the event of an outage. </p>
<p>I&#8217;m confused by what I&#8217;ve read: After a crash, the slave is now live. How long does it take to resync the master with the slave? Can the slave simply become the master and the master now be considered the hot spare slave that will take over if the new &#8220;master&#8221; machine ever crashes?</p>
<p>Thanks,</p>
<p>Any comments (&amp; the sooner the better) would be helpful, also any direction to a community of folks who are deeply involved with these technologies would be helpful as well.</p>
<p> - Joel</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peter</title>
		<link>http://www.mysqlperformanceblog.com/2008/04/28/mysql-replication-vs-drbd-battles/#comment-291561</link>
		<dc:creator>peter</dc:creator>
		<pubDate>Thu, 01 May 2008 23:44:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/04/28/mysql-replication-vs-drbd-battles/#comment-291561</guid>
		<description>Right. You do not want long running transactions in the perfect world, if you can avoid them it is not a big issue.
By the way it would be cool if Innodb could allow to restrict number of changes transaction could do - enabling such stuff would allow to catch users running bad transactions easily. 

Again my point is not to say generally it is good or bad but highlight the problems you can run into :)</description>
		<content:encoded><![CDATA[<p>Right. You do not want long running transactions in the perfect world, if you can avoid them it is not a big issue.<br />
By the way it would be cool if Innodb could allow to restrict number of changes transaction could do - enabling such stuff would allow to catch users running bad transactions easily. </p>
<p>Again my point is not to say generally it is good or bad but highlight the problems you can run into <img src='http://www.mysqlperformanceblog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Callaghan</title>
		<link>http://www.mysqlperformanceblog.com/2008/04/28/mysql-replication-vs-drbd-battles/#comment-291552</link>
		<dc:creator>Mark Callaghan</dc:creator>
		<pubDate>Thu, 01 May 2008 23:23:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/04/28/mysql-replication-vs-drbd-battles/#comment-291552</guid>
		<description>Don't allow long running transactions and undo is not a problem. Of course, that is easier said than done. But you don't want long running transactions. They are an instant source of replication delay and force applications to go back to the primary to get current data or stop using the slave.</description>
		<content:encoded><![CDATA[<p>Don&#8217;t allow long running transactions and undo is not a problem. Of course, that is easier said than done. But you don&#8217;t want long running transactions. They are an instant source of replication delay and force applications to go back to the primary to get current data or stop using the slave.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peter</title>
		<link>http://www.mysqlperformanceblog.com/2008/04/28/mysql-replication-vs-drbd-battles/#comment-291531</link>
		<dc:creator>peter</dc:creator>
		<pubDate>Thu, 01 May 2008 22:34:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/04/28/mysql-replication-vs-drbd-battles/#comment-291531</guid>
		<description>Mark,

I do not think it is as easy as you say.  you can limit number of io for REDO but there is also UNDO part which depends only on size of transaction.   It is indeed background in 5.0 but the data remains locked until rollback is complete which can affect operation. 

Plus you still have warmup problem.

Speaking about Google batch - I think there is a lot of cool stuff out where besides HA, and thanks for explanations.</description>
		<content:encoded><![CDATA[<p>Mark,</p>
<p>I do not think it is as easy as you say.  you can limit number of io for REDO but there is also UNDO part which depends only on size of transaction.   It is indeed background in 5.0 but the data remains locked until rollback is complete which can affect operation. </p>
<p>Plus you still have warmup problem.</p>
<p>Speaking about Google batch - I think there is a lot of cool stuff out where besides HA, and thanks for explanations.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Callaghan</title>
		<link>http://www.mysqlperformanceblog.com/2008/04/28/mysql-replication-vs-drbd-battles/#comment-291306</link>
		<dc:creator>Mark Callaghan</dc:creator>
		<pubDate>Thu, 01 May 2008 15:12:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/04/28/mysql-replication-vs-drbd-battles/#comment-291306</guid>
		<description>I think DRBD is amazing. The concern about long crash recovery times after failover with InnoDB and DRBD can be resolved. One method to do this is a config option that enforces the maximum number of crash-recovery IO (dirty pages in buffer cache + pending IO from insert buffer + pending IO for purge thread). When the max is exceeded the server can favor background IO over transactions to let the server catch up. Another option is to let Maatkit watch the server and run commands (might need more FLUSH commands) to force more background IO when there is too much pending IO in a server. 

Is there any parallelism or concurrency (multiple threads or multiple IOs pending) in InnoDB crash recovery code?

The Google patch had more than semi-sync for an HA solution with MySQL. It also includes a feature to keep the InnoDB transaction log and slave replication state in sync after a crash (transactional replication). But the most interesting feature was mirror binlog. This maintained mirrors of the master's binlog on a slave (same filename as used on the master, byte for byte equivalent). This was done using the same replication protocol -- the IO thread would copy events into the relay log and the mirrored binlog. It allows hierarchical replication and transparent slave failover. 

We are trying to redo support for hierarchical replication and transparent slave failover with global transaction IDs.</description>
		<content:encoded><![CDATA[<p>I think DRBD is amazing. The concern about long crash recovery times after failover with InnoDB and DRBD can be resolved. One method to do this is a config option that enforces the maximum number of crash-recovery IO (dirty pages in buffer cache + pending IO from insert buffer + pending IO for purge thread). When the max is exceeded the server can favor background IO over transactions to let the server catch up. Another option is to let Maatkit watch the server and run commands (might need more FLUSH commands) to force more background IO when there is too much pending IO in a server. </p>
<p>Is there any parallelism or concurrency (multiple threads or multiple IOs pending) in InnoDB crash recovery code?</p>
<p>The Google patch had more than semi-sync for an HA solution with MySQL. It also includes a feature to keep the InnoDB transaction log and slave replication state in sync after a crash (transactional replication). But the most interesting feature was mirror binlog. This maintained mirrors of the master&#8217;s binlog on a slave (same filename as used on the master, byte for byte equivalent). This was done using the same replication protocol &#8212; the IO thread would copy events into the relay log and the mirrored binlog. It allows hierarchical replication and transparent slave failover. </p>
<p>We are trying to redo support for hierarchical replication and transparent slave failover with global transaction IDs.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Monashev</title>
		<link>http://www.mysqlperformanceblog.com/2008/04/28/mysql-replication-vs-drbd-battles/#comment-289889</link>
		<dc:creator>Michael Monashev</dc:creator>
		<pubDate>Tue, 29 Apr 2008 17:49:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/04/28/mysql-replication-vs-drbd-battles/#comment-289889</guid>
		<description>Я недавно писал об альтернативе DRBD на FreeBSD: http://michael.mindmix.ru/366-392-ggate-kak-al-ternativa-memcached-i-memory-appliance.zhtml

Сам не пробовал такую схему реализовывать, но возможно она окажется быстрее по чтению. Особенно по случайному.</description>
		<content:encoded><![CDATA[<p>Я недавно писал об альтернативе DRBD на FreeBSD: <a href="http://michael.mindmix.ru/366-392-ggate-kak-al-ternativa-memcached-i-memory-appliance.zhtml" rel="nofollow">http://michael.mindmix.ru/366-392-ggate-kak-al-ternativa-memcached-i-memory-appliance.zhtml</a></p>
<p>Сам не пробовал такую схему реализовывать, но возможно она окажется быстрее по чтению. Особенно по случайному.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gregory Haase</title>
		<link>http://www.mysqlperformanceblog.com/2008/04/28/mysql-replication-vs-drbd-battles/#comment-289807</link>
		<dc:creator>Gregory Haase</dc:creator>
		<pubDate>Tue, 29 Apr 2008 13:52:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/04/28/mysql-replication-vs-drbd-battles/#comment-289807</guid>
		<description>I'm not sure what Peter R. means about not being able to do an lvm snapshot of the DRBD secondary node. Surely you can. If DRBD sits on top of LVM, then you snapshot the LVM and you get a snapshot of the blocks on the drbd device. Whether DRBD is in primary or secondary at this point is irrelevant.

Another thing I'd like to add is that there are some database/application designs that just don't allow for friendly multi-master setups. More real-time data warehouse applications that log tons of data and frequently summarize and aggregate will run into problems. Do you run aggregation scripts only on one server and propagate them? Do you run aggregates on both servers and "assume" that all the numbers add up in the end - this can be very dangerous.

Also, merely having a slave sitting ready to take master can be troublesome in some situations because the slave is still single-threaded. You end up getting a beefier slave than your production system just so that a single thread on the slave can keep up with all your transactional threads on your master. Now you have to ask yourself - maybe I can use the slave for other things, so it doesn't bother me too much that my slave is actually more powerful than my master. Or maybe it's better to have two equally setup systems and use DRBD instead.

I think given the argument that we all agree on one thing - it really depends on your application/database environment, your requirements for recovery speed, data loss, etc.

Finally, I will leave with this note - we actually do both - drbd + ha cluster for high-availability and a big beefy slave for redundancy and read only queries.</description>
		<content:encoded><![CDATA[<p>I&#8217;m not sure what Peter R. means about not being able to do an lvm snapshot of the DRBD secondary node. Surely you can. If DRBD sits on top of LVM, then you snapshot the LVM and you get a snapshot of the blocks on the drbd device. Whether DRBD is in primary or secondary at this point is irrelevant.</p>
<p>Another thing I&#8217;d like to add is that there are some database/application designs that just don&#8217;t allow for friendly multi-master setups. More real-time data warehouse applications that log tons of data and frequently summarize and aggregate will run into problems. Do you run aggregation scripts only on one server and propagate them? Do you run aggregates on both servers and &#8220;assume&#8221; that all the numbers add up in the end - this can be very dangerous.</p>
<p>Also, merely having a slave sitting ready to take master can be troublesome in some situations because the slave is still single-threaded. You end up getting a beefier slave than your production system just so that a single thread on the slave can keep up with all your transactional threads on your master. Now you have to ask yourself - maybe I can use the slave for other things, so it doesn&#8217;t bother me too much that my slave is actually more powerful than my master. Or maybe it&#8217;s better to have two equally setup systems and use DRBD instead.</p>
<p>I think given the argument that we all agree on one thing - it really depends on your application/database environment, your requirements for recovery speed, data loss, etc.</p>
<p>Finally, I will leave with this note - we actually do both - drbd + ha cluster for high-availability and a big beefy slave for redundancy and read only queries.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Romianowski</title>
		<link>http://www.mysqlperformanceblog.com/2008/04/28/mysql-replication-vs-drbd-battles/#comment-289764</link>
		<dc:creator>Peter Romianowski</dc:creator>
		<pubDate>Tue, 29 Apr 2008 12:31:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/04/28/mysql-replication-vs-drbd-battles/#comment-289764</guid>
		<description>Great post summing up all pros and cons. 

I would add another point: Backup from slave / secondary. With DRBD this is hard / impossible in many situations.

We use both, replication and DRBD in production. One database which is doing nothing but "spooling" working sets runs on DRBD (no slave lag, 100% sure all transactions are there, no need to backup this database). The main database is configured in Master-Master replication fashion. We evaluated using DRBD here too but did not do it because we'd loose the ability to do "online schema change" or LVM snapshot backup. And finally we were not able to get a descent InnoDB recovery time (26G buffer pool). So it would not even be a cold stand-by but a frozen one. ;)

So all the pros and cons stroke us.</description>
		<content:encoded><![CDATA[<p>Great post summing up all pros and cons. </p>
<p>I would add another point: Backup from slave / secondary. With DRBD this is hard / impossible in many situations.</p>
<p>We use both, replication and DRBD in production. One database which is doing nothing but &#8220;spooling&#8221; working sets runs on DRBD (no slave lag, 100% sure all transactions are there, no need to backup this database). The main database is configured in Master-Master replication fashion. We evaluated using DRBD here too but did not do it because we&#8217;d loose the ability to do &#8220;online schema change&#8221; or LVM snapshot backup. And finally we were not able to get a descent InnoDB recovery time (26G buffer pool). So it would not even be a cold stand-by but a frozen one. <img src='http://www.mysqlperformanceblog.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>So all the pros and cons stroke us.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul McCullagh</title>
		<link>http://www.mysqlperformanceblog.com/2008/04/28/mysql-replication-vs-drbd-battles/#comment-289748</link>
		<dc:creator>Paul McCullagh</dc:creator>
		<pubDate>Tue, 29 Apr 2008 11:35:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/04/28/mysql-replication-vs-drbd-battles/#comment-289748</guid>
		<description>Hi Peter,

As I discussed at the conference (http://www.primebase.org/download/pbxt-uc-2008.pdf), I am planning to add HA capabilities to PBXT using synchronous replication at the engine level.

What do you think of this approach?

Best regards,

Paul</description>
		<content:encoded><![CDATA[<p>Hi Peter,</p>
<p>As I discussed at the conference (http://www.primebase.org/download/pbxt-uc-2008.pdf), I am planning to add HA capabilities to PBXT using synchronous replication at the engine level.</p>
<p>What do you think of this approach?</p>
<p>Best regards,</p>
<p>Paul</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wei</title>
		<link>http://www.mysqlperformanceblog.com/2008/04/28/mysql-replication-vs-drbd-battles/#comment-289670</link>
		<dc:creator>Wei</dc:creator>
		<pubDate>Tue, 29 Apr 2008 07:22:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/04/28/mysql-replication-vs-drbd-battles/#comment-289670</guid>
		<description>The patch also includes mirroring binlogs on the replicas and serve the mirrored binlogs from the replicas.  The patch should also make the hierarchal replication available.  I wrote it, but could not find an easy way to integrate it smoothly.</description>
		<content:encoded><![CDATA[<p>The patch also includes mirroring binlogs on the replicas and serve the mirrored binlogs from the replicas.  The patch should also make the hierarchal replication available.  I wrote it, but could not find an easy way to integrate it smoothly.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
