Ashish's running commentary ...
Archives
« April 2007
SunMonTueWedThuFriSat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
25
26
27
28
29
     
       
Today
Click me to subscribe
Search

Links
 

Today's Page Hits: 11

« Previous month (Mar 2007) | Main | Next month (May 2007) »
Monday Apr 30, 2007
Ruby on Rails meets GlassFish High Availability
One of the key features of GlassFish v2 release is its cluster support. Various GlassFish server instances can be grouped together to form a single virtual entity - a cluster. One of the salient services offered via clustering is high availability, which is implemented as in-memory replication of state across participating server instances.

Since, I've been looking at getting Ruby on Rails applications running as web applications in a Java EE container, I was asked a couple of weeks ago if RoR applications could run in a GlassFish cluster. Well, with Rails-Integration 1.1.1, you can ! Its relatively straightforward to enable failover support for a web application in GlassFish and is no different for RoR (as a web application). The hard part, or so it seems at first, is setting up the GlassFish cluster.

For the easy part first, the only changes needed to enable failover session support for a web application are :

One important fact that I learned during this process, was that a load balancer facade is not necessarily needed for development/testing scenario. In other words if server instances, that share application state, are listening on the same host (different port), then failover can be simulated by simply sending requests to the other node (port).
Now, the part about setting up a GlassFish cluster. The references below give detailed information about the clustering architecture and setup steps but the takeaway is a lot simpler.

That's all there is to it !

References
http://wiki.glassfish.java.net/gfwiki/Wiki.jsp?page=GlassFishV2Architecture
http://developers.sun.com/appserver/reference/techart/load-balancing.html
https://glassfish.dev.java.net/javaee5/build/GlassFish_LB_Cluster.html
http://wiki.glassfish.java.net/gfwiki/attach/OnePagersOrFunctionalSpecs/memory-replication-one-pager.html

Posted at 05:05PM Apr 30, 2007 by Ashish Sahni in General  | 

Tuesday Apr 24, 2007
Rails-Integration 1.1.1
rails-integration 1.1.1 has just been released !
Source and binaries can be downloaded from http://rubyforge.org/frs/?group_id=2014
rails-integration details can be found at http://www.headius.com/jrubywiki/index.php/Rails_Integration

The fundamental change in this release as compared to 1.0, is performance and compatibility. When used in standalone mode, rails-integration 1.0 had this hack wherein it performed installation of JRuby and the rails libraries at runtime (during web application initialization i.e., once per web container process lifetime). Not only was this ugly, but it also caused compatibility problems with GlassFish since it expected the web application constituents after deployment (implementation dependent)in a particular format. No runtime installation needed with 1.1.1 !
Aiding to the performance improvements is JRuby 0.9.9 which has made great strides in improving performance as compared to its previous versions.
Also, this release is compatible with rails 1.2.x, solves session related and other issues that plagued 1.0.

All in all, a great release that blends the two architectures - RoR and Java EE - giving you the best of both worlds - the development convenience of RoR and the enterprise level features of the Java EE platform. No longer do you have to pick and choose one !

Many thanks to all the folks involved in getting the release out !

Posted at 09:10AM Apr 24, 2007 by Ashish Sahni in Java  |