<?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>Fri, 16 Jul 2010 01:59:12 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<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>
