<?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: On Slave Usage</title>
	<atom:link href="http://www.pythian.com/news/1496/on-slave-usage/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pythian.com/news/1496/on-slave-usage/</link>
	<description>News and views from Pythian DBAs</description>
	<lastBuildDate>Fri, 10 Feb 2012 13:01:25 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
	<item>
		<title>By: Shlomi Noach</title>
		<link>http://www.pythian.com/news/1496/on-slave-usage/#comment-343046</link>
		<dc:creator>Shlomi Noach</dc:creator>
		<pubDate>Fri, 20 Feb 2009 11:58:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.pythian.com/blogs/1496/on-slave-usage#comment-343046</guid>
		<description>Hi,

Other good use for slaves:
1. Testing MySQL version upgrade:
Upgrading the MySQL version on the slave is relatively safe. It may (though not necessarily) reflect any incompatibilities between your application and the new version. So if the slave upgraded, and replication continues without issues, it&#039;s relatively safe to upgrade the master.

2. Testing index impact and performance:
To verify schema improvements, one can add/change indexing on tables on the slave, testing previous slow queries on the new schema. If successful, these changes can be propagated to the master as described.

3. I usually require more than one slave. In such cases where it is possible, a particular slave is marked as &quot;a replacement for the master&quot; in case of disaster. This particular slave has the exact same design and settings as the master.
The other slave, however, can be utilized for backups, may have more relaxed settings, etc.
This second slave may also be forced to lag behind the master (e.g. using maatkit&#039;s mk-slave-delay) to also provide recovery in case of a &quot;drop database&quot; statement.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Other good use for slaves:<br />
1. Testing MySQL version upgrade:<br />
Upgrading the MySQL version on the slave is relatively safe. It may (though not necessarily) reflect any incompatibilities between your application and the new version. So if the slave upgraded, and replication continues without issues, it&#8217;s relatively safe to upgrade the master.</p>
<p>2. Testing index impact and performance:<br />
To verify schema improvements, one can add/change indexing on tables on the slave, testing previous slow queries on the new schema. If successful, these changes can be propagated to the master as described.</p>
<p>3. I usually require more than one slave. In such cases where it is possible, a particular slave is marked as &#8220;a replacement for the master&#8221; in case of disaster. This particular slave has the exact same design and settings as the master.<br />
The other slave, however, can be utilized for backups, may have more relaxed settings, etc.<br />
This second slave may also be forced to lag behind the master (e.g. using maatkit&#8217;s mk-slave-delay) to also provide recovery in case of a &#8220;drop database&#8221; statement.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sheeri Cabral</title>
		<link>http://www.pythian.com/news/1496/on-slave-usage/#comment-342836</link>
		<dc:creator>Sheeri Cabral</dc:creator>
		<pubDate>Thu, 19 Feb 2009 21:51:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.pythian.com/blogs/1496/on-slave-usage#comment-342836</guid>
		<description>Tim -- yes, definitely.  I started to allude to that kind of stuff by saying &quot;We regularly test whether slaves are in sync, to ensure accuracy no matter what purposes replication slaves are used for.&quot;

Using existing data in DML is also bad as you point out -- but row-based replication has changed that problem.

As you point out, using the &quot;replicate-do&quot; and &quot;replicate-ignore&quot; statements have their problems.  I think it&#039;s particularly important to note that using &quot;binlog-do&quot; and &quot;binlog-ignore&quot; mean that you don&#039;t log information that you may be required to (or you may want to).

In my opinion it&#039;s better to log everything and just apply what you want, than to log selectively and apply everything.

There&#039;s a lot to replication; this post was just meant to be a warning if people are using slaves for more than one purpose, they should make sure they&#039;re not going to get stuck if they haven&#039;t thought everything through.</description>
		<content:encoded><![CDATA[<p>Tim &#8212; yes, definitely.  I started to allude to that kind of stuff by saying &#8220;We regularly test whether slaves are in sync, to ensure accuracy no matter what purposes replication slaves are used for.&#8221;</p>
<p>Using existing data in DML is also bad as you point out &#8212; but row-based replication has changed that problem.</p>
<p>As you point out, using the &#8220;replicate-do&#8221; and &#8220;replicate-ignore&#8221; statements have their problems.  I think it&#8217;s particularly important to note that using &#8220;binlog-do&#8221; and &#8220;binlog-ignore&#8221; mean that you don&#8217;t log information that you may be required to (or you may want to).</p>
<p>In my opinion it&#8217;s better to log everything and just apply what you want, than to log selectively and apply everything.</p>
<p>There&#8217;s a lot to replication; this post was just meant to be a warning if people are using slaves for more than one purpose, they should make sure they&#8217;re not going to get stuck if they haven&#8217;t thought everything through.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim S.</title>
		<link>http://www.pythian.com/news/1496/on-slave-usage/#comment-342815</link>
		<dc:creator>Tim S.</dc:creator>
		<pubDate>Thu, 19 Feb 2009 20:40:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.pythian.com/blogs/1496/on-slave-usage#comment-342815</guid>
		<description>All good uses for a slave, but I think it&#039;s important to point out that all of those options depend on replication working properly. The backups, in particular. They are only as good as replication. While replication generally works reasonably well, there&#039;s plenty that can go wrong when the limitations and capabilities in replication are not addressed.

For instance, filtering databases can cause problems when using cross-database updates (or updates without first running the &quot;USE &quot; command). &quot;INSERT&#124;UPDATE ... SELECT&quot; can also cause problems.

For multi-master&#039;s, it&#039;s important to note that using auto_increment offsets won&#039;t always save you if you send writes to both servers, such as when you might be using UNIQUE keys.

These limitations can generally be overcome, and, when they are, replication tends to work very well. Thought I&#039;d put my $0.02 about them though since not everyone who might read this post might be thinking about them.</description>
		<content:encoded><![CDATA[<p>All good uses for a slave, but I think it&#8217;s important to point out that all of those options depend on replication working properly. The backups, in particular. They are only as good as replication. While replication generally works reasonably well, there&#8217;s plenty that can go wrong when the limitations and capabilities in replication are not addressed.</p>
<p>For instance, filtering databases can cause problems when using cross-database updates (or updates without first running the &#8220;USE &#8221; command). &#8220;INSERT|UPDATE &#8230; SELECT&#8221; can also cause problems.</p>
<p>For multi-master&#8217;s, it&#8217;s important to note that using auto_increment offsets won&#8217;t always save you if you send writes to both servers, such as when you might be using UNIQUE keys.</p>
<p>These limitations can generally be overcome, and, when they are, replication tends to work very well. Thought I&#8217;d put my $0.02 about them though since not everyone who might read this post might be thinking about them.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

