Skip to main content

JRuby-on-Rails deployed on GlassFish - Success Story

Posted by arungupta on January 29, 2008 at 6:32 AM PST

There are several reasons you may deploy JRuby-on-Rails application on href="http://glassfish.java.net">GlassFish:

  • Java EE is a long tested deployment platform and GlassFish
    is Java EE 5 compliant.
  • GlassFish "green" deployment model - just create a WAR and
    dump it in
    autodeploy directory. Typical Rails deployment requires to spawn
    multiple Mongrels, front-ended by Apache and then manage them through
    Capistrano.
  • Java EE and Ruby-on-Rails applications can be easily
    integrated in one container. This allows to host JRuby-on-Rails
    applications in organization who have already made investment in Java
    EE.
  • GlassFish comes with out-of-the-box clustering and
    high-availability support. Rails applications can certainly benefit
    from them.
  • GlassFish offers database connection pooling allowing you
    to reuse your database connections.
  • Last, but not the least, JRuby-on-Rails can leverage the
    extensive set of Java libraries.

I'm working on an article that will explain each of these in detail. In
the meanwhile here is a live success story.



mediacast.sun.com
(provides a public place for Sun
employees to store large media files) released their version 2.0 -
completely rewritten using JRuby-on-Rails and deployed on GlassFish.
Igor has good details is his href="http://blog.igorminar.com/2008/01/jruby-on-rails-rewrite-of.html">blog.
Here are some excerpts:



Development environment: NetBeans
6
, href="http://wiki.netbeans.org/MercurialVersionControl">Mercurial
plugin, href="http://wiki.rubyonrails.org/rails/pages/WEBrick">WEBrick,
GlassFish v2 UR1,
MySQL

Deployment environment: 2 Load-balanced href="http://www.sun.com/servers/coolthreads/t2000/">T2000,
Solaris
10
, href="http://www.sun.com/software/products/appsrvr/index.xml">Sun
Java System Application Server 9.1 U1, href="https://jdk6.dev.java.net/">JDK 6, href="http://www.mysql.com/">MySQL



He has explained the pain points and areas of improvements very
clearly. We are aware of the performance problems and already working
on them!



Let us know if you have had success with deploying href="http://wiki.glassfish.java.net/Wiki.jsp?page=JRuby">JRuby-on-Rails
on
GlassFish. Read all GlassFish
success stories
.



UPDATE (Feb 8):
Mediacast deployment diagram is now available href="http://blog.igorminar.com/2008/02/mediacast-deployment-diagram.html">here.

Technorati:  href="http://technorati.com/tag/glassfish">glassfish
netbeans
jruby href="http://technorati.com/tag/rubyonrails">rubyonrails
mediacast

Related Topics >>

Comments

I wonder if you could talk specifically about threading. Once you're in Glassfish, how are multiple simultaneous requests handled?

JRuby/GlassFish process models are explained in detail at: http://blogs.sun.com/arungupta/entry/ruby_jruby_process_models_explained For each request received, JRuby runtime is spawned which delegates the request to Rails and then process the response.

Hi Arun. Great job... I've been waiting for Sun to release something on JRoR. We released a JRoR app back in November (at Oracle). Not sure if you've read about it yet -> http://oracleappslab.com/2007/11/21/mix-jruby-on-rails-small-teams-agile... This is the year for JRuby on Rails!