<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: How fast is MySQL replication?</title>
	<link>http://www.xaprb.com/blog/2007/10/23/how-fast-is-mysql-replication/</link>
	<description>Stay curious!</description>
	<pubDate>Thu, 24 Jul 2008 00:23:59 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.2</generator>

	<item>
		<title>By: Xaprb</title>
		<link>http://www.xaprb.com/blog/2007/10/23/how-fast-is-mysql-replication/#comment-14310</link>
		<author>Xaprb</author>
		<pubDate>Wed, 19 Mar 2008 13:29:18 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2007/10/23/how-fast-is-mysql-replication/#comment-14310</guid>
		<description>In most cases it would be a bad idea, because you might change something that would alter the results of queries the slave will replay:

update account set balance = balance + 5 where id = 10;

I think you ultimately have to build your application to tolerate slave lag.  The more robust you make that, the better off you'll be.

If you're having trouble making this work right, a few hours of consulting help might be a good investment.  Check out &lt;a href="http://www.xaprb.com/blog/2008/03/06/send-your-employees-to-the-mysql-conference/" rel="nofollow"&gt;the companies I listed in this post.&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>In most cases it would be a bad idea, because you might change something that would alter the results of queries the slave will replay:</p>
<p>update account set balance = balance + 5 where id = 10;</p>
<p>I think you ultimately have to build your application to tolerate slave lag.  The more robust you make that, the better off you&#8217;ll be.</p>
<p>If you&#8217;re having trouble making this work right, a few hours of consulting help might be a good investment.  Check out <a href="http://www.xaprb.com/blog/2008/03/06/send-your-employees-to-the-mysql-conference/" rel="nofollow">the companies I listed in this post.</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://www.xaprb.com/blog/2007/10/23/how-fast-is-mysql-replication/#comment-14308</link>
		<author>Mark</author>
		<pubDate>Tue, 18 Mar 2008 21:37:24 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2007/10/23/how-fast-is-mysql-replication/#comment-14308</guid>
		<description>Thanks for the info and great responses. It sounds like you know a lot about MySQL replication.

Regarding the slave not having caught up to it's master - and wanting to select from the slave...

Do you think it an okay idea to make a database link to the master - update the master close the connection, make a connection to the slave and also update the slave (from which you are just about to select from) (with the same data  that just got inserted into the master) and then select from the slave. 

Sounds messy and you have to make sure you are updating and selecting from the same slave in order to make use of it. Or would that be a bad idea?

Thanks again :)</description>
		<content:encoded><![CDATA[<p>Thanks for the info and great responses. It sounds like you know a lot about MySQL replication.</p>
<p>Regarding the slave not having caught up to it&#8217;s master - and wanting to select from the slave&#8230;</p>
<p>Do you think it an okay idea to make a database link to the master - update the master close the connection, make a connection to the slave and also update the slave (from which you are just about to select from) (with the same data  that just got inserted into the master) and then select from the slave. </p>
<p>Sounds messy and you have to make sure you are updating and selecting from the same slave in order to make use of it. Or would that be a bad idea?</p>
<p>Thanks again :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Xaprb</title>
		<link>http://www.xaprb.com/blog/2007/10/23/how-fast-is-mysql-replication/#comment-14307</link>
		<author>Xaprb</author>
		<pubDate>Tue, 18 Mar 2008 20:59:44 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2007/10/23/how-fast-is-mysql-replication/#comment-14307</guid>
		<description>Mark,

You can do SHOW MASTER STATUS on the master, and then MASTER_POS_WAIT() on the slave to create a synchronization barrier, but there's no way to force the slave to fetch the statement that just happened on the master and replay it.  What you're looking for doesn't exist :-)  You have to kind of assemble the pieces yourself.

If your app is running in production on 5.0, I would not upgrade to 5.1 until you are more familiar with 5.0.  If you have not yet put the app into production, by all means upgrade and see how it goes.  I don't have a lot of experience with it yet myself.</description>
		<content:encoded><![CDATA[<p>Mark,</p>
<p>You can do SHOW MASTER STATUS on the master, and then MASTER_POS_WAIT() on the slave to create a synchronization barrier, but there&#8217;s no way to force the slave to fetch the statement that just happened on the master and replay it.  What you&#8217;re looking for doesn&#8217;t exist :-)  You have to kind of assemble the pieces yourself.</p>
<p>If your app is running in production on 5.0, I would not upgrade to 5.1 until you are more familiar with 5.0.  If you have not yet put the app into production, by all means upgrade and see how it goes.  I don&#8217;t have a lot of experience with it yet myself.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://www.xaprb.com/blog/2007/10/23/how-fast-is-mysql-replication/#comment-14306</link>
		<author>Mark</author>
		<pubDate>Tue, 18 Mar 2008 20:36:13 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2007/10/23/how-fast-is-mysql-replication/#comment-14306</guid>
		<description>So basically, to make sure your data that you are selecting  - is the data that just got inserted into the master, you have to select directly from the master? 

Or is there some way to quickly tell the slave to get the masters binary log, execute the insert/update statement (that just occurred form the user), then select from the slave, all on the same spot? Is there are feature for that?

It would be great if you could give me some links to some articles about this. I have only just set up my first replication and trying to tie it into a php app.

By the way, I am using MySQL 5.0 do you think it's a safe option to upgrade to the 5.1 beta to try the new row based replication. What is your thoughts on row based replication?

Cheers =)</description>
		<content:encoded><![CDATA[<p>So basically, to make sure your data that you are selecting  - is the data that just got inserted into the master, you have to select directly from the master? </p>
<p>Or is there some way to quickly tell the slave to get the masters binary log, execute the insert/update statement (that just occurred form the user), then select from the slave, all on the same spot? Is there are feature for that?</p>
<p>It would be great if you could give me some links to some articles about this. I have only just set up my first replication and trying to tie it into a php app.</p>
<p>By the way, I am using MySQL 5.0 do you think it&#8217;s a safe option to upgrade to the 5.1 beta to try the new row based replication. What is your thoughts on row based replication?</p>
<p>Cheers =)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Xaprb</title>
		<link>http://www.xaprb.com/blog/2007/10/23/how-fast-is-mysql-replication/#comment-14305</link>
		<author>Xaprb</author>
		<pubDate>Tue, 18 Mar 2008 12:09:30 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2007/10/23/how-fast-is-mysql-replication/#comment-14305</guid>
		<description>Oh -- when I say reads will go to the master, I mean THAT SESSION'S reads, not all reads.</description>
		<content:encoded><![CDATA[<p>Oh &#8212; when I say reads will go to the master, I mean THAT SESSION&#8217;S reads, not all reads.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Xaprb</title>
		<link>http://www.xaprb.com/blog/2007/10/23/how-fast-is-mysql-replication/#comment-14304</link>
		<author>Xaprb</author>
		<pubDate>Tue, 18 Mar 2008 12:08:43 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2007/10/23/how-fast-is-mysql-replication/#comment-14304</guid>
		<description>This is a great question.  As you know, replication is asynchronous, so a transaction on the master doesn't have to wait on the slave.  There are a variety of solutions to the resulting timing problems, including object versioning, read-write splitting based on whether your session has changed any data, timestamps, hierarchies, and many more.  There are also patches to make replication semi-synchronous, but most people don't need that.

The upcoming High Performance MySQL 2nd edition has probably the clearest and most comprehensive discussion of these strategies in print.  (Shameless plug).

To give you an idea how some of these things can work, if you write to the master you can simply mark the session as having written something.  Reads will then go to the master for some time thereafter.  This is a simple approach that's very effective.  If reading from the master is unacceptable, you can use more complex approaches.</description>
		<content:encoded><![CDATA[<p>This is a great question.  As you know, replication is asynchronous, so a transaction on the master doesn&#8217;t have to wait on the slave.  There are a variety of solutions to the resulting timing problems, including object versioning, read-write splitting based on whether your session has changed any data, timestamps, hierarchies, and many more.  There are also patches to make replication semi-synchronous, but most people don&#8217;t need that.</p>
<p>The upcoming High Performance MySQL 2nd edition has probably the clearest and most comprehensive discussion of these strategies in print.  (Shameless plug).</p>
<p>To give you an idea how some of these things can work, if you write to the master you can simply mark the session as having written something.  Reads will then go to the master for some time thereafter.  This is a simple approach that&#8217;s very effective.  If reading from the master is unacceptable, you can use more complex approaches.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://www.xaprb.com/blog/2007/10/23/how-fast-is-mysql-replication/#comment-14303</link>
		<author>Mark</author>
		<pubDate>Tue, 18 Mar 2008 11:41:48 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2007/10/23/how-fast-is-mysql-replication/#comment-14303</guid>
		<description>I can't seem to work out how anyone can rely on mysql replication or how they get it to work fast enough for applications. 

In alot of web applications (from what I have found), a user may enter an html form which gets inserted into the master, then they may, for example, get redirected to there account page which will be getting selected from the slave... occasionally the slave hasn't caught up from the data that just got inserted into master and you are trying to select that same data from the slave. It's just not fast enough for me. :(

How can this problem be resolved?</description>
		<content:encoded><![CDATA[<p>I can&#8217;t seem to work out how anyone can rely on mysql replication or how they get it to work fast enough for applications. </p>
<p>In alot of web applications (from what I have found), a user may enter an html form which gets inserted into the master, then they may, for example, get redirected to there account page which will be getting selected from the slave&#8230; occasionally the slave hasn&#8217;t caught up from the data that just got inserted into master and you are trying to select that same data from the slave. It&#8217;s just not fast enough for me. :(</p>
<p>How can this problem be resolved?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: How I built the NOW_USEC() UDF for MySQL at Xaprb</title>
		<link>http://www.xaprb.com/blog/2007/10/23/how-fast-is-mysql-replication/#comment-13585</link>
		<author>How I built the NOW_USEC() UDF for MySQL at Xaprb</author>
		<pubDate>Tue, 30 Oct 2007 12:58:10 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2007/10/23/how-fast-is-mysql-replication/#comment-13585</guid>
		<description>[...] Archives         &#171; How fast is MySQL replication? [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] Archives         &laquo; How fast is MySQL replication? [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pythian Group Blog &#187; Blog Archive &#187; Log Buffer #68: a Carnival of the Vanities for DBAs</title>
		<link>http://www.xaprb.com/blog/2007/10/23/how-fast-is-mysql-replication/#comment-13583</link>
		<author>Pythian Group Blog &#187; Blog Archive &#187; Log Buffer #68: a Carnival of the Vanities for DBAs</author>
		<pubDate>Fri, 26 Oct 2007 18:19:15 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2007/10/23/how-fast-is-mysql-replication/#comment-13583</guid>
		<description>[...] other MySQL news, Xaprb asks, how fast is MySQL replication? investigates, and provides answers: &#8220;Very fast, as it turns out&#8230; While writing the [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] other MySQL news, Xaprb asks, how fast is MySQL replication? investigates, and provides answers: &#8220;Very fast, as it turns out&hellip; While writing the [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy Cole</title>
		<link>http://www.xaprb.com/blog/2007/10/23/how-fast-is-mysql-replication/#comment-13579</link>
		<author>Jeremy Cole</author>
		<pubDate>Thu, 25 Oct 2007 03:08:09 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2007/10/23/how-fast-is-mysql-replication/#comment-13579</guid>
		<description>Hi Baron,

With two machines on the same subnet, you should be able to get them in sync with each other by way less than a millisecond.  They won't be that accurate to *reality* but syncing them to each other should be pretty damn close.  The latency on the same switch will be ~0.1ms, and you should be able to get them in sync by at very least that.</description>
		<content:encoded><![CDATA[<p>Hi Baron,</p>
<p>With two machines on the same subnet, you should be able to get them in sync with each other by way less than a millisecond.  They won&#8217;t be that accurate to *reality* but syncing them to each other should be pretty damn close.  The latency on the same switch will be ~0.1ms, and you should be able to get them in sync by at very least that.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
