<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Why MySQL&#8217;s binlog-do-db option is dangerous</title>
	<atom:link href="http://www.mysqlperformanceblog.com/2009/05/14/why-mysqls-binlog-do-db-option-is-dangerous/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mysqlperformanceblog.com/2009/05/14/why-mysqls-binlog-do-db-option-is-dangerous/</link>
	<description>Percona&#039;s MySQL &#38; InnoDB performance and scalability blog</description>
	<lastBuildDate>Sat, 11 Feb 2012 16:45:54 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Simon Mudd</title>
		<link>http://www.mysqlperformanceblog.com/2009/05/14/why-mysqls-binlog-do-db-option-is-dangerous/comment-page-1/#comment-563807</link>
		<dc:creator>Simon Mudd</dc:creator>
		<pubDate>Tue, 19 May 2009 23:20:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=689#comment-563807</guid>
		<description>Row based replication in 5.1 makes this sort of thing clearer and that&#039;s almost certainly one of the reasons it was added. For certain SQL statements it can also be much quicker.

The whole replicate-wild* or replicate*ignore options would be so much better handled if they were done differently, for example as done by Sybase were you can easily configure replication on a per table basis.

Even having a few mysql.XXXX tables which define the replication rules would be better than using the my.cnf only options. I&#039;ve only looked in detail at Sybase replication, so am not sure what is offered by Oracle or other commercial RDBMS vendors. MySQL&#039;s replication facilities for simple stuff is great, but the moment you want to do things in a slightly more complex fashion opens the way for potential headaches if you are not really aware of how replication works in MySQL.

Which is why I stand by the claim in my blog posting a while back that it would be so much better if replication were pulled out of mysqld and moved to a separate process dedicated to the task.

Then as mentioned the binlog could be used for what it&#039;s supposed to be: point in time recovery and the replication process could be improved without having to worry so much about what goes on in the database.</description>
		<content:encoded><![CDATA[<p>Row based replication in 5.1 makes this sort of thing clearer and that&#8217;s almost certainly one of the reasons it was added. For certain SQL statements it can also be much quicker.</p>
<p>The whole replicate-wild* or replicate*ignore options would be so much better handled if they were done differently, for example as done by Sybase were you can easily configure replication on a per table basis.</p>
<p>Even having a few mysql.XXXX tables which define the replication rules would be better than using the my.cnf only options. I&#8217;ve only looked in detail at Sybase replication, so am not sure what is offered by Oracle or other commercial RDBMS vendors. MySQL&#8217;s replication facilities for simple stuff is great, but the moment you want to do things in a slightly more complex fashion opens the way for potential headaches if you are not really aware of how replication works in MySQL.</p>
<p>Which is why I stand by the claim in my blog posting a while back that it would be so much better if replication were pulled out of mysqld and moved to a separate process dedicated to the task.</p>
<p>Then as mentioned the binlog could be used for what it&#8217;s supposed to be: point in time recovery and the replication process could be improved without having to worry so much about what goes on in the database.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Morgan Christiansson</title>
		<link>http://www.mysqlperformanceblog.com/2009/05/14/why-mysqls-binlog-do-db-option-is-dangerous/comment-page-1/#comment-561591</link>
		<dc:creator>Morgan Christiansson</dc:creator>
		<pubDate>Fri, 15 May 2009 05:35:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=689#comment-561591</guid>
		<description>Shantanu, there is also --replicate-do-table and --replicate-wild-do-table which have different behaviour than --binlog-do-db

See
http://dev.mysql.com/doc/refman/5.0/en/replication-options-slave.html#option_mysqld_replicate-do-table
http://dev.mysql.com/doc/refman/5.0/en/replication-options-slave.html#option_mysqld_replicate-wild-do-table

The documentation even says &quot;This works for cross-database updates, in contrast to --replicate-ignore-db.&quot;

But you still need to be aware of it&#039;s quirks, queries that JOIN the wrong tables in updates could leave your replication out of sync.</description>
		<content:encoded><![CDATA[<p>Shantanu, there is also &#8211;replicate-do-table and &#8211;replicate-wild-do-table which have different behaviour than &#8211;binlog-do-db</p>
<p>See<br />
<a href="http://dev.mysql.com/doc/refman/5.0/en/replication-options-slave.html#option_mysqld_replicate-do-table" rel="nofollow">http://dev.mysql.com/doc/refman/5.0/en/replication-options-slave.html#option_mysqld_replicate-do-table</a><br />
<a href="http://dev.mysql.com/doc/refman/5.0/en/replication-options-slave.html#option_mysqld_replicate-wild-do-table" rel="nofollow">http://dev.mysql.com/doc/refman/5.0/en/replication-options-slave.html#option_mysqld_replicate-wild-do-table</a></p>
<p>The documentation even says &#8220;This works for cross-database updates, in contrast to &#8211;replicate-ignore-db.&#8221;</p>
<p>But you still need to be aware of it&#8217;s quirks, queries that JOIN the wrong tables in updates could leave your replication out of sync.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shantanu Oak</title>
		<link>http://www.mysqlperformanceblog.com/2009/05/14/why-mysqls-binlog-do-db-option-is-dangerous/comment-page-1/#comment-561581</link>
		<dc:creator>Shantanu Oak</dc:creator>
		<pubDate>Fri, 15 May 2009 04:56:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=689#comment-561581</guid>
		<description>&gt;&gt; Because binlog-ignore-db doesn&#039;t do what you think. 
I wish it did what it says. It would have brought down the network traffic when I have to update the slaves located in other cities.</description>
		<content:encoded><![CDATA[<p>&gt;&gt; Because binlog-ignore-db doesn&#8217;t do what you think.<br />
I wish it did what it says. It would have brought down the network traffic when I have to update the slaves located in other cities.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Baron Schwartz</title>
		<link>http://www.mysqlperformanceblog.com/2009/05/14/why-mysqls-binlog-do-db-option-is-dangerous/comment-page-1/#comment-561574</link>
		<dc:creator>Baron Schwartz</dc:creator>
		<pubDate>Fri, 15 May 2009 03:31:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=689#comment-561574</guid>
		<description>Morgan, I have slowly come to realize that most people never read the manual.  They read wikihow.com or some other garbage and think they know things.  Sad but true.</description>
		<content:encoded><![CDATA[<p>Morgan, I have slowly come to realize that most people never read the manual.  They read wikihow.com or some other garbage and think they know things.  Sad but true.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Morgan Christiansson</title>
		<link>http://www.mysqlperformanceblog.com/2009/05/14/why-mysqls-binlog-do-db-option-is-dangerous/comment-page-1/#comment-561546</link>
		<dc:creator>Morgan Christiansson</dc:creator>
		<pubDate>Fri, 15 May 2009 02:04:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=689#comment-561546</guid>
		<description>Which is why this behaviour is very clearly documented in the MySQL manual for this setting.

http://dev.mysql.com/doc/refman/5.0/en/replication-options-binary-log.html</description>
		<content:encoded><![CDATA[<p>Which is why this behaviour is very clearly documented in the MySQL manual for this setting.</p>
<p><a href="http://dev.mysql.com/doc/refman/5.0/en/replication-options-binary-log.html" rel="nofollow">http://dev.mysql.com/doc/refman/5.0/en/replication-options-binary-log.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Hodges</title>
		<link>http://www.mysqlperformanceblog.com/2009/05/14/why-mysqls-binlog-do-db-option-is-dangerous/comment-page-1/#comment-561477</link>
		<dc:creator>Robert Hodges</dc:creator>
		<pubDate>Fri, 15 May 2009 00:40:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=689#comment-561477</guid>
		<description>Master side filtering has a host of pitfalls, but even so it is sometimes necessary.  Applications can turn off the binlog for selected statements using SET SQL_LOG_BIN=0.  That&#039;s better because at least you presumably know exactly what you are doing at the application level.  We use this feature for Tungsten Replicator catalogs--replicating them would break our application.  We have very flexible filters both on the master as well as the slave but our experience has been exactly what Baron found, namely that filtering on the slave is best.</description>
		<content:encoded><![CDATA[<p>Master side filtering has a host of pitfalls, but even so it is sometimes necessary.  Applications can turn off the binlog for selected statements using SET SQL_LOG_BIN=0.  That&#8217;s better because at least you presumably know exactly what you are doing at the application level.  We use this feature for Tungsten Replicator catalogs&#8211;replicating them would break our application.  We have very flexible filters both on the master as well as the slave but our experience has been exactly what Baron found, namely that filtering on the slave is best.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peter</title>
		<link>http://www.mysqlperformanceblog.com/2009/05/14/why-mysqls-binlog-do-db-option-is-dangerous/comment-page-1/#comment-561176</link>
		<dc:creator>peter</dc:creator>
		<pubDate>Thu, 14 May 2009 15:58:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=689#comment-561176</guid>
		<description>Sheeri,

Indeed - so any binlog filtering is evil if you care about your data.
With row level replication it is probably safe to skip tables which you do not care about such as temporary tables from the logging but this is about it.</description>
		<content:encoded><![CDATA[<p>Sheeri,</p>
<p>Indeed &#8211; so any binlog filtering is evil if you care about your data.<br />
With row level replication it is probably safe to skip tables which you do not care about such as temporary tables from the logging but this is about it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Baron Schwartz</title>
		<link>http://www.mysqlperformanceblog.com/2009/05/14/why-mysqls-binlog-do-db-option-is-dangerous/comment-page-1/#comment-561173</link>
		<dc:creator>Baron Schwartz</dc:creator>
		<pubDate>Thu, 14 May 2009 14:26:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=689#comment-561173</guid>
		<description>John, yes that&#039;s true.</description>
		<content:encoded><![CDATA[<p>John, yes that&#8217;s true.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sheeri K. Cabral</title>
		<link>http://www.mysqlperformanceblog.com/2009/05/14/why-mysqls-binlog-do-db-option-is-dangerous/comment-page-1/#comment-561172</link>
		<dc:creator>Sheeri K. Cabral</dc:creator>
		<pubDate>Thu, 14 May 2009 14:24:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=689#comment-561172</guid>
		<description>The other important issue to consider is that binary logs are not only used for replication.  They are incremental backups, and if you chose to use the &quot;do&quot; statements, you are effectively erasing history, and should you have a disaster and need the incremental backups, there is no way to retrieve the ignored information.</description>
		<content:encoded><![CDATA[<p>The other important issue to consider is that binary logs are not only used for replication.  They are incremental backups, and if you chose to use the &#8220;do&#8221; statements, you are effectively erasing history, and should you have a disaster and need the incremental backups, there is no way to retrieve the ignored information.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Swindells</title>
		<link>http://www.mysqlperformanceblog.com/2009/05/14/why-mysqls-binlog-do-db-option-is-dangerous/comment-page-1/#comment-561167</link>
		<dc:creator>John Swindells</dc:creator>
		<pubDate>Thu, 14 May 2009 14:07:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=689#comment-561167</guid>
		<description>This is good to know.  Is it true, therefore, that binlog-do-db behaves itself if you have always selected your database beforehand?  When you say &#039;default database&#039;, does that include a database selected by USE DATABASE?</description>
		<content:encoded><![CDATA[<p>This is good to know.  Is it true, therefore, that binlog-do-db behaves itself if you have always selected your database beforehand?  When you say &#8216;default database&#8217;, does that include a database selected by USE DATABASE?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

