<?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: Master-Master or Master with Many Slaves</title>
	<atom:link href="http://www.mysqlperformanceblog.com/2007/04/06/master-master-or-master-with-many-slaves/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mysqlperformanceblog.com/2007/04/06/master-master-or-master-with-many-slaves/</link>
	<description>Everything about MySQL Performance</description>
	<lastBuildDate>Sat, 07 Nov 2009 18:35:44 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: peter</title>
		<link>http://www.mysqlperformanceblog.com/2007/04/06/master-master-or-master-with-many-slaves/comment-page-1/#comment-105655</link>
		<dc:creator>peter</dc:creator>
		<pubDate>Mon, 09 Apr 2007 10:22:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/04/06/master-master-or-master-with-many-slaves/#comment-105655</guid>
		<description>Dathan,

&quot;I don’t know if I am reading this right, but the 1/3 of the data is spread across each master-master pair? If so, wouldn’t the application need to know where the data is to access the correct master-master? The solution doesn’t look like it will abstract the data-layer that much.&quot;

That is right.  I mean general design here. of course you need to change your application to use data partitioning wisely.  You also normally need to change one to use pure replication correctly - you need to decide which reads you can do from the slave etc.</description>
		<content:encoded><![CDATA[<p>Dathan,</p>
<p>&#8220;I don’t know if I am reading this right, but the 1/3 of the data is spread across each master-master pair? If so, wouldn’t the application need to know where the data is to access the correct master-master? The solution doesn’t look like it will abstract the data-layer that much.&#8221;</p>
<p>That is right.  I mean general design here. of course you need to change your application to use data partitioning wisely.  You also normally need to change one to use pure replication correctly &#8211; you need to decide which reads you can do from the slave etc.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peter</title>
		<link>http://www.mysqlperformanceblog.com/2007/04/06/master-master-or-master-with-many-slaves/comment-page-1/#comment-105654</link>
		<dc:creator>peter</dc:creator>
		<pubDate>Mon, 09 Apr 2007 10:19:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/04/06/master-master-or-master-with-many-slaves/#comment-105654</guid>
		<description>Kevin,

First let me clarify my position a bit.   For Many applications level of Master-Master reliability is enough + backup of course. 

Second I&#039;m not really arguing over having 3-4 copies. It is a bit of complication but it is worth for some applications because it has other benefits.   What is often misuse is having 10+ slaves replicating 500GB database.

Regarding good night sleep, well it depends a lot on number of boxes you have availability requirements and extra hardware needed.  Assume for example you have a choice of paying 200$ bonus to the sys admin who had to wake up at nigh and fix things once per three months or  buying 5 more boxes  to have more copies ?  And again you have a third choice to assume it is unlikely for second node to fail and fix it in the morning. 

It is interesting you have Technorati as example - I&#039;ve seen their search being down so many times I think it is not MySQL related at all.  

&quot;Sure… but this is a non sequitor because we’re dealing with master promotion design here.&quot;

Well it is because the more slaves you have the more redundancy you have but the more hardware you waste. 

&quot;This is a tangential discussion isnt’ it? We use shard and partition our data so we spread writes this way. Each shard has a single master and two slaves that can be promoted to master.

We can just create as many shards as we need writes.&quot;

Well that if fine when.  To often however people use too many slaves using replication Instead of partitioning. 
By the way, how many shards do you have and how many times you had 2 nodes from the same one failing at the same time ? 

&quot;Again. This seems like a tangential issue and one your design suffers from as well. Isnt’ the data replayed on your slaves in MMM?&quot;

Right. I have explained it above with Master-Master you have 2 copies of data with  Master-20-slaves you would have 21 copies which is significant waste.  


Speaking about Shards this is not MMM part - you can however set up several &quot;clusters&quot; and have you application partition data among them a way you desire.</description>
		<content:encoded><![CDATA[<p>Kevin,</p>
<p>First let me clarify my position a bit.   For Many applications level of Master-Master reliability is enough + backup of course. </p>
<p>Second I&#8217;m not really arguing over having 3-4 copies. It is a bit of complication but it is worth for some applications because it has other benefits.   What is often misuse is having 10+ slaves replicating 500GB database.</p>
<p>Regarding good night sleep, well it depends a lot on number of boxes you have availability requirements and extra hardware needed.  Assume for example you have a choice of paying 200$ bonus to the sys admin who had to wake up at nigh and fix things once per three months or  buying 5 more boxes  to have more copies ?  And again you have a third choice to assume it is unlikely for second node to fail and fix it in the morning. </p>
<p>It is interesting you have Technorati as example &#8211; I&#8217;ve seen their search being down so many times I think it is not MySQL related at all.  </p>
<p>&#8220;Sure… but this is a non sequitor because we’re dealing with master promotion design here.&#8221;</p>
<p>Well it is because the more slaves you have the more redundancy you have but the more hardware you waste. </p>
<p>&#8220;This is a tangential discussion isnt’ it? We use shard and partition our data so we spread writes this way. Each shard has a single master and two slaves that can be promoted to master.</p>
<p>We can just create as many shards as we need writes.&#8221;</p>
<p>Well that if fine when.  To often however people use too many slaves using replication Instead of partitioning.<br />
By the way, how many shards do you have and how many times you had 2 nodes from the same one failing at the same time ? </p>
<p>&#8220;Again. This seems like a tangential issue and one your design suffers from as well. Isnt’ the data replayed on your slaves in MMM?&#8221;</p>
<p>Right. I have explained it above with Master-Master you have 2 copies of data with  Master-20-slaves you would have 21 copies which is significant waste.  </p>
<p>Speaking about Shards this is not MMM part &#8211; you can however set up several &#8220;clusters&#8221; and have you application partition data among them a way you desire.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peter</title>
		<link>http://www.mysqlperformanceblog.com/2007/04/06/master-master-or-master-with-many-slaves/comment-page-1/#comment-104698</link>
		<dc:creator>peter</dc:creator>
		<pubDate>Sat, 07 Apr 2007 09:43:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/04/06/master-master-or-master-with-many-slaves/#comment-104698</guid>
		<description>Jeremy,

Yes you&#039;re right. You should take care about halving read capacity of secondary node goes down.  However avoiding reads from Secondary node is only one of possible approaches.    

First in many cases I&#039;ve seen customers would rather see slower response time for fraction of users in this case, than having double hardware requirements.   This especially makes sense if you keep into account you have to prepare to &quot;spikes&quot; which can be as much as 2 times of  95% (&quot;normal&quot;) load in some cases.  In this case if you read from both nodes and one of them fails you will still have enough capacity to handle your normal load but not the spikes.

Second there are load control which can be used, for example many systems get large portion of load from search spiders, especially as these are hard on cache.  Throttling spiders in case you have master failure is another trick you can use.  It is not perfect but may be better than double amount hardware.

Third there are often actions which can be delayed for number of hours while master is down without production impact, such as reporting  queries - these are perfect candidate for standby master.  Other example is Backup process (I prefer to have this done from Active node to avoid problems in case there are bugs in MySQL replication) 

If properly planned the partial capacity should be no more than a few hours,  even if master dies completely you should have standby box which can be scripted to take over by recovery from backup or re-cloning master.  Using backup may be better choice as master can already higher load than usual. 


This is not to say your advice is wrong, but to say using master as standby only is only one of possible solution, which is however good and simply if you have enough money to pay for it :)</description>
		<content:encoded><![CDATA[<p>Jeremy,</p>
<p>Yes you&#8217;re right. You should take care about halving read capacity of secondary node goes down.  However avoiding reads from Secondary node is only one of possible approaches.    </p>
<p>First in many cases I&#8217;ve seen customers would rather see slower response time for fraction of users in this case, than having double hardware requirements.   This especially makes sense if you keep into account you have to prepare to &#8220;spikes&#8221; which can be as much as 2 times of  95% (&#8221;normal&#8221;) load in some cases.  In this case if you read from both nodes and one of them fails you will still have enough capacity to handle your normal load but not the spikes.</p>
<p>Second there are load control which can be used, for example many systems get large portion of load from search spiders, especially as these are hard on cache.  Throttling spiders in case you have master failure is another trick you can use.  It is not perfect but may be better than double amount hardware.</p>
<p>Third there are often actions which can be delayed for number of hours while master is down without production impact, such as reporting  queries &#8211; these are perfect candidate for standby master.  Other example is Backup process (I prefer to have this done from Active node to avoid problems in case there are bugs in MySQL replication) </p>
<p>If properly planned the partial capacity should be no more than a few hours,  even if master dies completely you should have standby box which can be scripted to take over by recovery from backup or re-cloning master.  Using backup may be better choice as master can already higher load than usual. </p>
<p>This is not to say your advice is wrong, but to say using master as standby only is only one of possible solution, which is however good and simply if you have enough money to pay for it <img src='http://www.mysqlperformanceblog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin Burton</title>
		<link>http://www.mysqlperformanceblog.com/2007/04/06/master-master-or-master-with-many-slaves/comment-page-1/#comment-104637</link>
		<dc:creator>Kevin Burton</dc:creator>
		<pubDate>Sat, 07 Apr 2007 08:16:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/04/06/master-master-or-master-with-many-slaves/#comment-104637</guid>
		<description>&quot;“There’s only one machine to act as the standby master. If you have 10 slaves you should be able to fail five times and still be operational.” This is valid consideration but honestly for most of applications it is enough unless you’re using unreliable hardware.&quot;

No.. actually.  It&#039;s not.

Let&#039;s take Technorati for example. They have three copies of everything. This way if a machine failed at night you still have a redundant copy.

If it&#039;s 1AM I want to be able to go back to sleep. :)

&quot;Typically other risks of downtime are higher, what is about having application error which deletes/trashes all the data and gets replicated to all the slaves ?&quot;

Sure... but this is a non sequitor because we&#039;re dealing with master promotion design here.

&quot;Handling write load  If your application is write intensive master-N-slave configuration will be saturated much faster because it has to handle much more write load. Especially keeping into account MySQL replication is single thread it might be not long before it will be unable to keep up.&quot;

This is a tangential discussion isnt&#039; it? We use shard and partition our data so we spread writes this way.  Each shard has a single master and two slaves that can be promoted to master.

We can just create as many shards as we need writes. 

&quot;Waste of cache memory If you have same data on the slaves you will likely same data cached in their database caches. You can partially improve it by load partitioning but still it will not be perfect - for example all of write load has to go to all nodes getting appropriate data in the cache. In our example if you have 16GB boxes and say 12GB allocated to MySQL database caches you can get 12GB effective cache on the master-N-slave configuration compared to 36GB of effective cache on 3 master-master pairs.&quot;

Again.  This seems like a tangential issue and one your design suffers from as well.  Isnt&#039; the data replayed on your slaves in MMM?

It seems like we&#039;re comparing apples to oranges here.

I&#039;m not arguing that partitioning your data isn&#039;t important.  It is.  I&#039;m just saying that there&#039;s and easy way to use a slave as a master anytime you want.  

I didn&#039;t grok from your original post that MMM has sharding (which it seems to now) so I&#039;ll have to play with it. I was just arguing that master to master replication isn&#039;t necessary.

Thanks for posting this stuff!

Kevin</description>
		<content:encoded><![CDATA[<p>&#8220;“There’s only one machine to act as the standby master. If you have 10 slaves you should be able to fail five times and still be operational.” This is valid consideration but honestly for most of applications it is enough unless you’re using unreliable hardware.&#8221;</p>
<p>No.. actually.  It&#8217;s not.</p>
<p>Let&#8217;s take Technorati for example. They have three copies of everything. This way if a machine failed at night you still have a redundant copy.</p>
<p>If it&#8217;s 1AM I want to be able to go back to sleep. <img src='http://www.mysqlperformanceblog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>&#8220;Typically other risks of downtime are higher, what is about having application error which deletes/trashes all the data and gets replicated to all the slaves ?&#8221;</p>
<p>Sure&#8230; but this is a non sequitor because we&#8217;re dealing with master promotion design here.</p>
<p>&#8220;Handling write load  If your application is write intensive master-N-slave configuration will be saturated much faster because it has to handle much more write load. Especially keeping into account MySQL replication is single thread it might be not long before it will be unable to keep up.&#8221;</p>
<p>This is a tangential discussion isnt&#8217; it? We use shard and partition our data so we spread writes this way.  Each shard has a single master and two slaves that can be promoted to master.</p>
<p>We can just create as many shards as we need writes. </p>
<p>&#8220;Waste of cache memory If you have same data on the slaves you will likely same data cached in their database caches. You can partially improve it by load partitioning but still it will not be perfect &#8211; for example all of write load has to go to all nodes getting appropriate data in the cache. In our example if you have 16GB boxes and say 12GB allocated to MySQL database caches you can get 12GB effective cache on the master-N-slave configuration compared to 36GB of effective cache on 3 master-master pairs.&#8221;</p>
<p>Again.  This seems like a tangential issue and one your design suffers from as well.  Isnt&#8217; the data replayed on your slaves in MMM?</p>
<p>It seems like we&#8217;re comparing apples to oranges here.</p>
<p>I&#8217;m not arguing that partitioning your data isn&#8217;t important.  It is.  I&#8217;m just saying that there&#8217;s and easy way to use a slave as a master anytime you want.  </p>
<p>I didn&#8217;t grok from your original post that MMM has sharding (which it seems to now) so I&#8217;ll have to play with it. I was just arguing that master to master replication isn&#8217;t necessary.</p>
<p>Thanks for posting this stuff!</p>
<p>Kevin</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy Cole</title>
		<link>http://www.mysqlperformanceblog.com/2007/04/06/master-master-or-master-with-many-slaves/comment-page-1/#comment-104414</link>
		<dc:creator>Jeremy Cole</dc:creator>
		<pubDate>Sat, 07 Apr 2007 02:16:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/04/06/master-master-or-master-with-many-slaves/#comment-104414</guid>
		<description>Hi Peter,

I completely agree with you except for one point: If you send reads to the &quot;inactive&quot; master, you are lying to yourself about your true capacity.  If one of the masters fails, you don&#039;t have enough read capacity to handle your load.

For this reason, I always suggest that customers use master-master, but scale by adding more partitions, rather than using the &quot;slave&quot; for reads.

Regards,

Jeremy</description>
		<content:encoded><![CDATA[<p>Hi Peter,</p>
<p>I completely agree with you except for one point: If you send reads to the &#8220;inactive&#8221; master, you are lying to yourself about your true capacity.  If one of the masters fails, you don&#8217;t have enough read capacity to handle your load.</p>
<p>For this reason, I always suggest that customers use master-master, but scale by adding more partitions, rather than using the &#8220;slave&#8221; for reads.</p>
<p>Regards,</p>
<p>Jeremy</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dathan Pattishall</title>
		<link>http://www.mysqlperformanceblog.com/2007/04/06/master-master-or-master-with-many-slaves/comment-page-1/#comment-104341</link>
		<dc:creator>Dathan Pattishall</dc:creator>
		<pubDate>Sat, 07 Apr 2007 01:26:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/04/06/master-master-or-master-with-many-slaves/#comment-104341</guid>
		<description>&quot;When you compare master-master to multiple slaves you should compare it for same amount of servers. For example if we have 6 boxes we can use 1 master and 5 slaves or 3 master-master pairs. In this case each of the master-master nodes gets 1/3rd of database size and about 1/3rd of traffic.&quot;

I don&#039;t know if I am reading this right, but the 1/3 of the data is spread across each master-master pair? If so, wouldn&#039;t the application need to know where the data is to access the correct master-master? The solution doesn&#039;t look like it will abstract the data-layer that much.

Other then the question above:

Overall I would say this is a great solution for many people to get a HA solution without building it directly into their app.</description>
		<content:encoded><![CDATA[<p>&#8220;When you compare master-master to multiple slaves you should compare it for same amount of servers. For example if we have 6 boxes we can use 1 master and 5 slaves or 3 master-master pairs. In this case each of the master-master nodes gets 1/3rd of database size and about 1/3rd of traffic.&#8221;</p>
<p>I don&#8217;t know if I am reading this right, but the 1/3 of the data is spread across each master-master pair? If so, wouldn&#8217;t the application need to know where the data is to access the correct master-master? The solution doesn&#8217;t look like it will abstract the data-layer that much.</p>
<p>Other then the question above:</p>
<p>Overall I would say this is a great solution for many people to get a HA solution without building it directly into their app.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
