<?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: Codeigniter: Separating reads and writes for scaling MySQL</title>
	<atom:link href="http://thinkapi.com/blog/codeigniter-separating-reads-and-writes-for-scaling-mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://thinkapi.com/blog/codeigniter-separating-reads-and-writes-for-scaling-mysql/</link>
	<description>An interface to tech thoughts</description>
	<lastBuildDate>Sat, 17 Dec 2011 07:37:55 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Brad Proctor</title>
		<link>http://thinkapi.com/blog/codeigniter-separating-reads-and-writes-for-scaling-mysql/comment-page-1/#comment-76</link>
		<dc:creator>Brad Proctor</dc:creator>
		<pubDate>Sat, 17 Dec 2011 07:37:55 +0000</pubDate>
		<guid isPermaLink="false">http://thinkapi.com/blog/?p=173#comment-76</guid>
		<description>You really need to be careful with this.  What happens if you make an insert and the user is redirected to see the results and a select is occurs of what was just inserted, but the the master hasn&#039;t replicated yet.  The user sees nothing.  To fix this, that select needs to occur on the master.</description>
		<content:encoded><![CDATA[<p>You really need to be careful with this.  What happens if you make an insert and the user is redirected to see the results and a select is occurs of what was just inserted, but the the master hasn&#8217;t replicated yet.  The user sees nothing.  To fix this, that select needs to occur on the master.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MySQLレプリケーション環境下での負荷分散手法のまとめ &#124; epidemic.jp</title>
		<link>http://thinkapi.com/blog/codeigniter-separating-reads-and-writes-for-scaling-mysql/comment-page-1/#comment-73</link>
		<dc:creator>MySQLレプリケーション環境下での負荷分散手法のまとめ &#124; epidemic.jp</dc:creator>
		<pubDate>Sat, 11 Jun 2011 08:31:37 +0000</pubDate>
		<guid isPermaLink="false">http://thinkapi.com/blog/?p=173#comment-73</guid>
		<description>[...] CakePHPと似たような方法で対応可能なようです。 (参考URL) http://thinkapi.com/blog/codeigniter-separating-reads-and-writes-for-scaling-mysql/ [...]</description>
		<content:encoded><![CDATA[<p>[...] CakePHPと似たような方法で対応可能なようです。 (参考URL) <a href="http://thinkapi.com/blog/codeigniter-separating-reads-and-writes-for-scaling-mysql/" rel="nofollow">http://thinkapi.com/blog/codeigniter-separating-reads-and-writes-for-scaling-mysql/</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fanxuan</title>
		<link>http://thinkapi.com/blog/codeigniter-separating-reads-and-writes-for-scaling-mysql/comment-page-1/#comment-71</link>
		<dc:creator>fanxuan</dc:creator>
		<pubDate>Wed, 23 Mar 2011 10:54:02 +0000</pubDate>
		<guid isPermaLink="false">http://thinkapi.com/blog/?p=173#comment-71</guid>
		<description>thanks Sukumar.This is what I am searching for. My project needs it. thank you..</description>
		<content:encoded><![CDATA[<p>thanks Sukumar.This is what I am searching for. My project needs it. thank you..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Naren</title>
		<link>http://thinkapi.com/blog/codeigniter-separating-reads-and-writes-for-scaling-mysql/comment-page-1/#comment-70</link>
		<dc:creator>Naren</dc:creator>
		<pubDate>Sun, 06 Mar 2011 09:55:33 +0000</pubDate>
		<guid isPermaLink="false">http://thinkapi.com/blog/?p=173#comment-70</guid>
		<description>Very interesting take. Why don&#039;t you create a database helper/extend the database class to abstract away the need to keep track of which DB you&#039;re supposed to write to, and read from.</description>
		<content:encoded><![CDATA[<p>Very interesting take. Why don&#8217;t you create a database helper/extend the database class to abstract away the need to keep track of which DB you&#8217;re supposed to write to, and read from.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sukumar</title>
		<link>http://thinkapi.com/blog/codeigniter-separating-reads-and-writes-for-scaling-mysql/comment-page-1/#comment-59</link>
		<dc:creator>Sukumar</dc:creator>
		<pubDate>Wed, 14 Jul 2010 04:42:23 +0000</pubDate>
		<guid isPermaLink="false">http://thinkapi.com/blog/?p=173#comment-59</guid>
		<description>@Stinky Tofu

Yes, that would be quite a good approach and can be implemented just by extending the database model.

My preference is slightly different though. I like to use fat controllers and thin models (most of the logic is in the controller). Because of this, I have a base model where I have all the commonly used methods defined (different way of CRUD) and all other models just extend from it. This way I don&#039;t need to decide what query goes where everyday but, just at the time of writing the model.</description>
		<content:encoded><![CDATA[<p>@Stinky Tofu</p>
<p>Yes, that would be quite a good approach and can be implemented just by extending the database model.</p>
<p>My preference is slightly different though. I like to use fat controllers and thin models (most of the logic is in the controller). Because of this, I have a base model where I have all the commonly used methods defined (different way of CRUD) and all other models just extend from it. This way I don&#8217;t need to decide what query goes where everyday but, just at the time of writing the model.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stinky Tofu</title>
		<link>http://thinkapi.com/blog/codeigniter-separating-reads-and-writes-for-scaling-mysql/comment-page-1/#comment-58</link>
		<dc:creator>Stinky Tofu</dc:creator>
		<pubDate>Wed, 14 Jul 2010 04:19:38 +0000</pubDate>
		<guid isPermaLink="false">http://thinkapi.com/blog/?p=173#comment-58</guid>
		<description>This is an interesting approach.  Just wondering though, if you have a master db that is for writes only and a slave db for reads only, then instead of asking the programmer to specify which database to read/write from/to in their code, why not set it up so that whenever I call $db-&gt;insert, $db-&gt;update, or $db-&gt;delete, then automatically use the master db to perform the write, if I am calling $db-&gt;query, then the code should be smart enough to connect to the slave db for the reads.

Would this be a safer approach?  It would help prevent human error.  Curious to find out what you think about this approach.</description>
		<content:encoded><![CDATA[<p>This is an interesting approach.  Just wondering though, if you have a master db that is for writes only and a slave db for reads only, then instead of asking the programmer to specify which database to read/write from/to in their code, why not set it up so that whenever I call $db-&gt;insert, $db-&gt;update, or $db-&gt;delete, then automatically use the master db to perform the write, if I am calling $db-&gt;query, then the code should be smart enough to connect to the slave db for the reads.</p>
<p>Would this be a safer approach?  It would help prevent human error.  Curious to find out what you think about this approach.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

