<?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"
	>
<channel>
	<title>Comments on: Magic Multi-Connections: A &#8220;facility in Rails to talk to more than one database at a time&#8221;</title>
	<atom:link href="http://drnicwilliams.com/2007/04/12/magic-multi-connections-a-facility-in-rails-to-talk-to-more-than-one-database-at-a-time/feed/" rel="self" type="application/rss+xml" />
	<link>http://drnicwilliams.com/2007/04/12/magic-multi-connections-a-facility-in-rails-to-talk-to-more-than-one-database-at-a-time/</link>
	<description>Ruby makes Rails, Javascript makes Ajax, Dr Nic makes Magic</description>
	<pubDate>Sun, 20 Jul 2008 08:50:27 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: James N. Sears</title>
		<link>http://drnicwilliams.com/2007/04/12/magic-multi-connections-a-facility-in-rails-to-talk-to-more-than-one-database-at-a-time/#comment-95622</link>
		<dc:creator>James N. Sears</dc:creator>
		<pubDate>Tue, 10 Jun 2008 06:08:25 +0000</pubDate>
		<guid isPermaLink="false">http://drnicwilliams.com/2007/04/12/magic-multi-connections-a-facility-in-rails-to-talk-to-more-than-one-database-at-a-time/#comment-95622</guid>
		<description>&lt;strong&gt;Multiple Database Connections in Ruby on Rails...&lt;/strong&gt;

I've been doing a lot of work in Ruby on Rails lately and absolutely love it. In the past few days I've needed to port an existing database over to a new schema for comparisons and benchmarking. It took a......</description>
		<content:encoded><![CDATA[<p><strong>Multiple Database Connections in Ruby on Rails&#8230;</strong></p>
<p>I&#8217;ve been doing a lot of work in Ruby on Rails lately and absolutely love it. In the past few days I&#8217;ve needed to port an existing database over to a new schema for comparisons and benchmarking. It took a&#8230;&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Closer To The Ideal &#187; Blog Archive &#187; Why do people sometimes feel attacked, even though no one is attacking them?</title>
		<link>http://drnicwilliams.com/2007/04/12/magic-multi-connections-a-facility-in-rails-to-talk-to-more-than-one-database-at-a-time/#comment-93507</link>
		<dc:creator>Closer To The Ideal &#187; Blog Archive &#187; Why do people sometimes feel attacked, even though no one is attacking them?</dc:creator>
		<pubDate>Mon, 02 Jun 2008 01:29:17 +0000</pubDate>
		<guid isPermaLink="false">http://drnicwilliams.com/2007/04/12/magic-multi-connections-a-facility-in-rails-to-talk-to-more-than-one-database-at-a-time/#comment-93507</guid>
		<description>[...] rough territory, but someone goes and does something nice (Woo hoo!). Dr Nic writes a plugin to use multiple databases with Rails. Way cool. Really way cool. Awesome job Nic. This is the part of open source that I love, when [...]</description>
		<content:encoded><![CDATA[<p>[...] rough territory, but someone goes and does something nice (Woo hoo!). Dr Nic writes a plugin to use multiple databases with Rails. Way cool. Really way cool. Awesome job Nic. This is the part of open source that I love, when [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: GW</title>
		<link>http://drnicwilliams.com/2007/04/12/magic-multi-connections-a-facility-in-rails-to-talk-to-more-than-one-database-at-a-time/#comment-92809</link>
		<dc:creator>GW</dc:creator>
		<pubDate>Fri, 30 May 2008 00:51:43 +0000</pubDate>
		<guid isPermaLink="false">http://drnicwilliams.com/2007/04/12/magic-multi-connections-a-facility-in-rails-to-talk-to-more-than-one-database-at-a-time/#comment-92809</guid>
		<description>I too am looking for a solution to allow multiple users per database. In order to apply principle of least privilege to database actions, I prefer to set up a few database users, each with specific duties relative to read/write/delete and table access rights.

I'll have a look at the plugin code and see if I can decipher a way to use it / extend it, but I think this is also one of those "obvious" lackings in the Rails connection interface.</description>
		<content:encoded><![CDATA[<p>I too am looking for a solution to allow multiple users per database. In order to apply principle of least privilege to database actions, I prefer to set up a few database users, each with specific duties relative to read/write/delete and table access rights.</p>
<p>I&#8217;ll have a look at the plugin code and see if I can decipher a way to use it / extend it, but I think this is also one of those &#8220;obvious&#8221; lackings in the Rails connection interface.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eduludi</title>
		<link>http://drnicwilliams.com/2007/04/12/magic-multi-connections-a-facility-in-rails-to-talk-to-more-than-one-database-at-a-time/#comment-75073</link>
		<dc:creator>eduludi</dc:creator>
		<pubDate>Tue, 19 Feb 2008 13:24:09 +0000</pubDate>
		<guid isPermaLink="false">http://drnicwilliams.com/2007/04/12/magic-multi-connections-a-facility-in-rails-to-talk-to-more-than-one-database-at-a-time/#comment-75073</guid>
		<description>Is there a way to use this technique to connect multiple database users/roles to the same database? what about performance? Could I simulate a multi-thread connection?</description>
		<content:encoded><![CDATA[<p>Is there a way to use this technique to connect multiple database users/roles to the same database? what about performance? Could I simulate a multi-thread connection?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kyle</title>
		<link>http://drnicwilliams.com/2007/04/12/magic-multi-connections-a-facility-in-rails-to-talk-to-more-than-one-database-at-a-time/#comment-52888</link>
		<dc:creator>Kyle</dc:creator>
		<pubDate>Thu, 01 Nov 2007 19:52:50 +0000</pubDate>
		<guid isPermaLink="false">http://drnicwilliams.com/2007/04/12/magic-multi-connections-a-facility-in-rails-to-talk-to-more-than-one-database-at-a-time/#comment-52888</guid>
		<description>Has anyone used this in a real production environment. I used a similar gem http://rubyfurnace.com/gems/mysql_replication_adapter (Mysql_replication_adapter), but found it to make our write database hang for a long time for queries. I'll blame it on myself for not knowing the inner workings of the gem prior to rolling it out on the test clusters, but I'm wondering if there are any other options to accomplish this.

Perhaps using a load balanced pool of connections to the slave with 3rd party hardware / software could be the most fool proof solution here. Where it intercepts which are read and writes. Although I like having control over which connection a query gets sent to, and this really can help you solve performance problems right in the butt.

I'd love to hear about any experience though in a real world high load production environment (1mil + connections a day) and rails internals doing the slave db-load balancing for you.

Also the more connections you have open for a server deamon such as mysqld the slower it will run.</description>
		<content:encoded><![CDATA[<p>Has anyone used this in a real production environment. I used a similar gem <a href="http://rubyfurnace.com/gems/mysql_replication_adapter" rel="nofollow">http://rubyfurnace.com/gems/mysql_replication_adapter</a> (Mysql_replication_adapter), but found it to make our write database hang for a long time for queries. I&#8217;ll blame it on myself for not knowing the inner workings of the gem prior to rolling it out on the test clusters, but I&#8217;m wondering if there are any other options to accomplish this.</p>
<p>Perhaps using a load balanced pool of connections to the slave with 3rd party hardware / software could be the most fool proof solution here. Where it intercepts which are read and writes. Although I like having control over which connection a query gets sent to, and this really can help you solve performance problems right in the butt.</p>
<p>I&#8217;d love to hear about any experience though in a real world high load production environment (1mil + connections a day) and rails internals doing the slave db-load balancing for you.</p>
<p>Also the more connections you have open for a server deamon such as mysqld the slower it will run.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: GSIY &#8230; Ruby-Rails Portal</title>
		<link>http://drnicwilliams.com/2007/04/12/magic-multi-connections-a-facility-in-rails-to-talk-to-more-than-one-database-at-a-time/#comment-46516</link>
		<dc:creator>GSIY &#8230; Ruby-Rails Portal</dc:creator>
		<pubDate>Sat, 22 Sep 2007 21:38:21 +0000</pubDate>
		<guid isPermaLink="false">http://drnicwilliams.com/2007/04/12/magic-multi-connections-a-facility-in-rails-to-talk-to-more-than-one-database-at-a-time/#comment-46516</guid>
		<description>[...] Remember that point about Rails lacking an easy-to-use way of dealing with multiple read/write databases? Strike that. Nic Williams has released Magic Multi-Connections. It makes it dead easy to use a cluster of databases to scale read and write speeds higher than a single connection would ever allow. [...]</description>
		<content:encoded><![CDATA[<p>[...] Remember that point about Rails lacking an easy-to-use way of dealing with multiple read/write databases? Strike that. Nic Williams has released Magic Multi-Connections. It makes it dead easy to use a cluster of databases to scale read and write speeds higher than a single connection would ever allow. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Twitter on Rails &#124; tactical web development</title>
		<link>http://drnicwilliams.com/2007/04/12/magic-multi-connections-a-facility-in-rails-to-talk-to-more-than-one-database-at-a-time/#comment-45228</link>
		<dc:creator>Twitter on Rails &#124; tactical web development</dc:creator>
		<pubDate>Mon, 10 Sep 2007 16:04:06 +0000</pubDate>
		<guid isPermaLink="false">http://drnicwilliams.com/2007/04/12/magic-multi-connections-a-facility-in-rails-to-talk-to-more-than-one-database-at-a-time/#comment-45228</guid>
		<description>[...] Gespannt verfolgte damals die Blog-Gemeinde die Anfeindungen zwischen signal37.com und Twitter; und jeder wußte es nun besser. Jeder fragte sich, warum die Twitter-Entwickler so blauäugig auf Ruby on Rails gesetzt hatten, warum man bestimmte Probleme nicht so, sondern so gelöst hätte und überhaupt (möglicherweise war das hier der entscheidende Hinweis?) [...]</description>
		<content:encoded><![CDATA[<p>[...] Gespannt verfolgte damals die Blog-Gemeinde die Anfeindungen zwischen signal37.com und Twitter; und jeder wußte es nun besser. Jeder fragte sich, warum die Twitter-Entwickler so blauäugig auf Ruby on Rails gesetzt hatten, warum man bestimmte Probleme nicht so, sondern so gelöst hätte und überhaupt (möglicherweise war das hier der entscheidende Hinweis?) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Peuchert</title>
		<link>http://drnicwilliams.com/2007/04/12/magic-multi-connections-a-facility-in-rails-to-talk-to-more-than-one-database-at-a-time/#comment-32866</link>
		<dc:creator>Alex Peuchert</dc:creator>
		<pubDate>Fri, 15 Jun 2007 14:31:31 +0000</pubDate>
		<guid isPermaLink="false">http://drnicwilliams.com/2007/04/12/magic-multi-connections-a-facility-in-rails-to-talk-to-more-than-one-database-at-a-time/#comment-32866</guid>
		<description>Hi DrNic! me again... I had some thoughts about this multiple-database-thing and came up with an idea about it. Why not change the database connection inside the controller action? Maybe you think this could be interesting and want to read more about it at:

http://scriptserver.blogspot.com/2007/06/uploaded-dynamicdatabasechanger-plugin.html

-alex</description>
		<content:encoded><![CDATA[<p>Hi DrNic! me again&#8230; I had some thoughts about this multiple-database-thing and came up with an idea about it. Why not change the database connection inside the controller action? Maybe you think this could be interesting and want to read more about it at:</p>
<p><a href="http://scriptserver.blogspot.com/2007/06/uploaded-dynamicdatabasechanger-plugin.html" rel="nofollow">http://scriptserver.blogspot.com/2007/06/uploaded-dynamicdatabasechanger-plugin.html</a></p>
<p>-alex</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: links, ideas and geek stuff &#187; Blog Archive &#187; links for 2007-06-12</title>
		<link>http://drnicwilliams.com/2007/04/12/magic-multi-connections-a-facility-in-rails-to-talk-to-more-than-one-database-at-a-time/#comment-32516</link>
		<dc:creator>links, ideas and geek stuff &#187; Blog Archive &#187; links for 2007-06-12</dc:creator>
		<pubDate>Tue, 12 Jun 2007 16:20:11 +0000</pubDate>
		<guid isPermaLink="false">http://drnicwilliams.com/2007/04/12/magic-multi-connections-a-facility-in-rails-to-talk-to-more-than-one-database-at-a-time/#comment-32516</guid>
		<description>[...] Dr Nic » Magic Multi-Connections: A “facility in Rails to talk to more than one database at a time” [...]</description>
		<content:encoded><![CDATA[<p>[...] Dr Nic » Magic Multi-Connections: A “facility in Rails to talk to more than one database at a time” [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dr Nic</title>
		<link>http://drnicwilliams.com/2007/04/12/magic-multi-connections-a-facility-in-rails-to-talk-to-more-than-one-database-at-a-time/#comment-32304</link>
		<dc:creator>Dr Nic</dc:creator>
		<pubDate>Sun, 10 Jun 2007 16:37:40 +0000</pubDate>
		<guid isPermaLink="false">http://drnicwilliams.com/2007/04/12/magic-multi-connections-a-facility-in-rails-to-talk-to-more-than-one-database-at-a-time/#comment-32304</guid>
		<description>@alex - I think #2+#3 would be implemented by your #conn method implementation. In the example above it was a pure random selection of original connections. You could do health checking there, etc.

But more importantly, this code is just an idea/proof of concept to show how you could modify an ActiveRecord (or any class) via a Module.</description>
		<content:encoded><![CDATA[<p>@alex - I think #2+#3 would be implemented by your #conn method implementation. In the example above it was a pure random selection of original connections. You could do health checking there, etc.</p>
<p>But more importantly, this code is just an idea/proof of concept to show how you could modify an ActiveRecord (or any class) via a Module.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
