<?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: JRuby: The Future of Scalable Rails?</title>
	<atom:link href="http://www.codecommit.com/blog/java/jruby-the-future-of-scalable-rails/feed" rel="self" type="application/rss+xml" />
	<link>http://www.codecommit.com/blog/java/jruby-the-future-of-scalable-rails</link>
	<description>(permanently in beta)</description>
	<lastBuildDate>Mon, 09 Jan 2012 20:21:24 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Taylor Gautier</title>
		<link>http://www.codecommit.com/blog/java/jruby-the-future-of-scalable-rails/comment-page-1#comment-2136</link>
		<dc:creator>Taylor Gautier</dc:creator>
		<pubDate>Thu, 23 Aug 2007 08:44:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.danielspiewak.com/java/jruby-the-future-of-scalable-rails#comment-2136</guid>
		<description>James,

That sounds really great.  Was it hard to setup?  Is there any way you can make any part of what you did available to the community?  And of course I have to ask, did you try to cluster that Map with Terracotta?</description>
		<content:encoded><![CDATA[<p>James,</p>
<p>That sounds really great.  Was it hard to setup?  Is there any way you can make any part of what you did available to the community?  And of course I have to ask, did you try to cluster that Map with Terracotta?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Spiewak</title>
		<link>http://www.codecommit.com/blog/java/jruby-the-future-of-scalable-rails/comment-page-1#comment-2047</link>
		<dc:creator>Daniel Spiewak</dc:creator>
		<pubDate>Tue, 24 Jul 2007 20:46:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.danielspiewak.com/java/jruby-the-future-of-scalable-rails#comment-2047</guid>
		<description>@James

Very interesting.  Did you try storing references to RObject within the session?  So, rather than converting the Ruby objects into Java objects, just store the JRuby internal representation?  Honestly, I don&#039;t know enough about JRuby internals to know if this avoids the problem or not.  :-)</description>
		<content:encoded><![CDATA[<p>@James</p>
<p>Very interesting.  Did you try storing references to RObject within the session?  So, rather than converting the Ruby objects into Java objects, just store the JRuby internal representation?  Honestly, I don&#8217;t know enough about JRuby internals to know if this avoids the problem or not.  <img src='http://www.codecommit.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Norton</title>
		<link>http://www.codecommit.com/blog/java/jruby-the-future-of-scalable-rails/comment-page-1#comment-2046</link>
		<dc:creator>James Norton</dc:creator>
		<pubDate>Tue, 24 Jul 2007 20:01:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.danielspiewak.com/java/jruby-the-future-of-scalable-rails#comment-2046</guid>
		<description>I realize I&#039;m a little bit late to the party, but I thought I&#039;d kick in my 2 cents from having used this approach (storing common resources in Java classes to be used across Rails instances).  I have developed a JRuby application (deployed on Tomcat) that utilizes a large map of Java objects initialized from a database.  This data structure is too large to keep a separate copy per instance - additionally it must be updated from the database when the underlying records change.

Using a Java class (with Java thread synchronization) to hold this data in memory and manage updates outside of any particular Rails instance eliminates these two problems and scales well.  Thanks for the tip.  The only caveat I would add is that you can&#039;t store instances of Ruby objects in the Java class (except simple things like strings or numbers that get converted to Java objects).  The references to the objects don&#039;t mean anything between sessions.  I got burned on this at first, because I was developing using Webrick, which isn&#039;t multithreaded.  When I would deploy to Tomcat things would break because of the invalid object references between rails instances.</description>
		<content:encoded><![CDATA[<p>I realize I&#8217;m a little bit late to the party, but I thought I&#8217;d kick in my 2 cents from having used this approach (storing common resources in Java classes to be used across Rails instances).  I have developed a JRuby application (deployed on Tomcat) that utilizes a large map of Java objects initialized from a database.  This data structure is too large to keep a separate copy per instance &#8211; additionally it must be updated from the database when the underlying records change.</p>
<p>Using a Java class (with Java thread synchronization) to hold this data in memory and manage updates outside of any particular Rails instance eliminates these two problems and scales well.  Thanks for the tip.  The only caveat I would add is that you can&#8217;t store instances of Ruby objects in the Java class (except simple things like strings or numbers that get converted to Java objects).  The references to the objects don&#8217;t mean anything between sessions.  I got burned on this at first, because I was developing using Webrick, which isn&#8217;t multithreaded.  When I would deploy to Tomcat things would break because of the invalid object references between rails instances.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Spiewak</title>
		<link>http://www.codecommit.com/blog/java/jruby-the-future-of-scalable-rails/comment-page-1#comment-2048</link>
		<dc:creator>Daniel Spiewak</dc:creator>
		<pubDate>Sat, 16 Jun 2007 16:56:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.danielspiewak.com/java/jruby-the-future-of-scalable-rails#comment-2048</guid>
		<description>Hmm, I think that is what I mean when I said it, I just wasn&#039;t able to go into as much depth as you did.

The other thing I was thinking was that using this model, you could scale the shared storage beyond the app servers.  Huge sites (like the Diggs, Slashdots and Facebooks of the net) have massive farms of memcached servers separate from their actual app servers.  So the model I had in mind was you separate out the resources devoted to the clustered SharedCache and make all of that work (and storage) take place on a whole separate set of servers (thanks to the magic of Terracotta).  This way, you&#039;re free to cluster and load-balance and really do whatever you want with the app server without fear of interfering with your caching and storage.

So pretty much, what you said.  :-)</description>
		<content:encoded><![CDATA[<p>Hmm, I think that is what I mean when I said it, I just wasn&#8217;t able to go into as much depth as you did.</p>
<p>The other thing I was thinking was that using this model, you could scale the shared storage beyond the app servers.  Huge sites (like the Diggs, Slashdots and Facebooks of the net) have massive farms of memcached servers separate from their actual app servers.  So the model I had in mind was you separate out the resources devoted to the clustered SharedCache and make all of that work (and storage) take place on a whole separate set of servers (thanks to the magic of Terracotta).  This way, you&#8217;re free to cluster and load-balance and really do whatever you want with the app server without fear of interfering with your caching and storage.</p>
<p>So pretty much, what you said.  <img src='http://www.codecommit.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Taylor Gautier</title>
		<link>http://www.codecommit.com/blog/java/jruby-the-future-of-scalable-rails/comment-page-1#comment-2057</link>
		<dc:creator>Taylor Gautier</dc:creator>
		<pubDate>Sat, 16 Jun 2007 02:09:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.danielspiewak.com/java/jruby-the-future-of-scalable-rails#comment-2057</guid>
		<description>I&#039;m confused again - I could swear that&#039;s what you meant when you said:

&quot;As the application scaled and the shared data requirements increased, the SharedCache class (as we’ll christen it) could be modified to cluster, using Terracotta&quot;

Basically, to be clear, what I see is that per app-server you have a single WAR.  Via the JRuby-extras project you can run some n Rails instances from that WAR (as depicted in your diagram).  But a single app-server can only handle so many Rails instances, so then you need to deploy another app-server with another application WAR that can handle another n Rails instances.  In the single app-server case the SharedCache datastructure lived in the process/heap space of the JVM hosting the app-server and (and therefore) the Rails instances, thus data consistency wasn&#039;t a problem, but now across app-servers it is.

This is where Terracotta kicks in.   Right?  (And specifically, the class doesn&#039;t have to be modified to be clustered by Terracotta, but that&#039;s beside the point).  I jumped on the thread because I agree it is very useful and would be happy to help out getting a prototype done.</description>
		<content:encoded><![CDATA[<p>I&#8217;m confused again &#8211; I could swear that&#8217;s what you meant when you said:</p>
<p>&#8220;As the application scaled and the shared data requirements increased, the SharedCache class (as we’ll christen it) could be modified to cluster, using Terracotta&#8221;</p>
<p>Basically, to be clear, what I see is that per app-server you have a single WAR.  Via the JRuby-extras project you can run some n Rails instances from that WAR (as depicted in your diagram).  But a single app-server can only handle so many Rails instances, so then you need to deploy another app-server with another application WAR that can handle another n Rails instances.  In the single app-server case the SharedCache datastructure lived in the process/heap space of the JVM hosting the app-server and (and therefore) the Rails instances, thus data consistency wasn&#8217;t a problem, but now across app-servers it is.</p>
<p>This is where Terracotta kicks in.   Right?  (And specifically, the class doesn&#8217;t have to be modified to be clustered by Terracotta, but that&#8217;s beside the point).  I jumped on the thread because I agree it is very useful and would be happy to help out getting a prototype done.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Spiewak</title>
		<link>http://www.codecommit.com/blog/java/jruby-the-future-of-scalable-rails/comment-page-1#comment-2056</link>
		<dc:creator>Daniel Spiewak</dc:creator>
		<pubDate>Sat, 16 Jun 2007 01:24:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.danielspiewak.com/java/jruby-the-future-of-scalable-rails#comment-2056</guid>
		<description>@Parallel shared nothing: Yeah, pretty much.  I just wasn&#039;t able to put it so eloquently.  :-)

Hmm, I hadn&#039;t actually thought too much about the possibilities of separate JRuby instances using the same SharedCache, but I suppose that would really be a useful thing to have.  Easier too than clustering the JRuby instance since you&#039;re actually doing it in raw Java.  Seems there&#039;s a lot more to this concept than I initially considered.  :-)

Maybe you&#039;re right and this would be worth a full-blown project.  When I was writing the article, I had in mind just a singleton class with thread safety built in.  The Terracotta thing was mainly because it seemed to be a really neat way to scale the shared data-handler further.  But you&#039;re right that this would be far more useful as a more capable solution that was designed to cluster.</description>
		<content:encoded><![CDATA[<p>@Parallel shared nothing: Yeah, pretty much.  I just wasn&#8217;t able to put it so eloquently.  <img src='http://www.codecommit.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Hmm, I hadn&#8217;t actually thought too much about the possibilities of separate JRuby instances using the same SharedCache, but I suppose that would really be a useful thing to have.  Easier too than clustering the JRuby instance since you&#8217;re actually doing it in raw Java.  Seems there&#8217;s a lot more to this concept than I initially considered.  <img src='http://www.codecommit.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Maybe you&#8217;re right and this would be worth a full-blown project.  When I was writing the article, I had in mind just a singleton class with thread safety built in.  The Terracotta thing was mainly because it seemed to be a really neat way to scale the shared data-handler further.  But you&#8217;re right that this would be far more useful as a more capable solution that was designed to cluster.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Taylor Gautier</title>
		<link>http://www.codecommit.com/blog/java/jruby-the-future-of-scalable-rails/comment-page-1#comment-2054</link>
		<dc:creator>Taylor Gautier</dc:creator>
		<pubDate>Sat, 16 Jun 2007 00:45:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.danielspiewak.com/java/jruby-the-future-of-scalable-rails#comment-2054</guid>
		<description>I wasn&#039;t arguing that you don&#039;t need more Rails instances, that&#039;s exactly what this solution allows - to run each JRuby instance in it&#039;s own interpreter space, roughly equivalent to threads / jvm.  When you run out of processing power for this model, you need to add more nodes, and it&#039;s at this point that the clustered version of the SharedCache via Terracotta kicks in (until that point, concurrent access to the SharedCache is mediated by Java&#039;s built in concurrency controls).

Actually clustering the data / using clustered concepts inside of the JRuby instances is really interesting, but as far as I understand it, it&#039;s not the model that Rails is built on so it&#039;s not necessary to build scale-out for a Rails app.

That&#039;s what you were saying when you stated that Rails is a parallel shared-nothing model, right?</description>
		<content:encoded><![CDATA[<p>I wasn&#8217;t arguing that you don&#8217;t need more Rails instances, that&#8217;s exactly what this solution allows &#8211; to run each JRuby instance in it&#8217;s own interpreter space, roughly equivalent to threads / jvm.  When you run out of processing power for this model, you need to add more nodes, and it&#8217;s at this point that the clustered version of the SharedCache via Terracotta kicks in (until that point, concurrent access to the SharedCache is mediated by Java&#8217;s built in concurrency controls).</p>
<p>Actually clustering the data / using clustered concepts inside of the JRuby instances is really interesting, but as far as I understand it, it&#8217;s not the model that Rails is built on so it&#8217;s not necessary to build scale-out for a Rails app.</p>
<p>That&#8217;s what you were saying when you stated that Rails is a parallel shared-nothing model, right?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Spiewak</title>
		<link>http://www.codecommit.com/blog/java/jruby-the-future-of-scalable-rails/comment-page-1#comment-2049</link>
		<dc:creator>Daniel Spiewak</dc:creator>
		<pubDate>Fri, 15 Jun 2007 19:16:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.danielspiewak.com/java/jruby-the-future-of-scalable-rails#comment-2049</guid>
		<description>@Taylor
Yeah, this probably would allow you to avoid clustering JRuby for a little while, but this only takes care of memory/storage requirements.  If you&#039;re starting to run out of processor space for the extra Rails instances, you still probably need to cluster the JRuby instance.</description>
		<content:encoded><![CDATA[<p>@Taylor<br />
Yeah, this probably would allow you to avoid clustering JRuby for a little while, but this only takes care of memory/storage requirements.  If you&#8217;re starting to run out of processor space for the extra Rails instances, you still probably need to cluster the JRuby instance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Taylor Gautier</title>
		<link>http://www.codecommit.com/blog/java/jruby-the-future-of-scalable-rails/comment-page-1#comment-2050</link>
		<dc:creator>Taylor Gautier</dc:creator>
		<pubDate>Fri, 15 Jun 2007 18:38:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.danielspiewak.com/java/jruby-the-future-of-scalable-rails#comment-2050</guid>
		<description>Now this is incredibly interesting, because in fact if I am reading the implementation correctly, it&#039;s not required to cluster JRuby at all, but just this class/implemenation providing virtual storage.

In other words, this implementation can go forward today, without having to worry about the complexities of clustering JRuby (which while cool to the nth degree, is still in the experimental phase, no offense to Jonas).

Could we start this project as a labs at http://www.terracotta.org/confluence/display/labs/Home?

If there is any interest, please email me at tgautier - at - terracotta.org.</description>
		<content:encoded><![CDATA[<p>Now this is incredibly interesting, because in fact if I am reading the implementation correctly, it&#8217;s not required to cluster JRuby at all, but just this class/implemenation providing virtual storage.</p>
<p>In other words, this implementation can go forward today, without having to worry about the complexities of clustering JRuby (which while cool to the nth degree, is still in the experimental phase, no offense to Jonas).</p>
<p>Could we start this project as a labs at <a href="http://www.terracotta.org/confluence/display/labs/Home?" rel="nofollow">http://www.terracotta.org/confluence/display/labs/Home?</a></p>
<p>If there is any interest, please email me at tgautier &#8211; at &#8211; terracotta.org.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Spiewak</title>
		<link>http://www.codecommit.com/blog/java/jruby-the-future-of-scalable-rails/comment-page-1#comment-2051</link>
		<dc:creator>Daniel Spiewak</dc:creator>
		<pubDate>Fri, 15 Jun 2007 15:50:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.danielspiewak.com/java/jruby-the-future-of-scalable-rails#comment-2051</guid>
		<description>@Nick
Oh now seriously, that&#039;s about as cool as it gets.  I didn&#039;t know about that or I would have included it in the article.  Way, way, way cool!  :-)</description>
		<content:encoded><![CDATA[<p>@Nick<br />
Oh now seriously, that&#8217;s about as cool as it gets.  I didn&#8217;t know about that or I would have included it in the article.  Way, way, way cool!  <img src='http://www.codecommit.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

