Archive

Posts Tagged ‘railsconfeurope2008’

JRuby with Thomas Enebo

September 3rd, 2008

This morning I attended another JRuby talk, this time with Thomas Enebo. It turned out to be, almost default, Sun JRuby talk.

There was one interesting difference, though. Normally we are shown how to run Ruby on Java and how to use Java components in our Ruby apps. Thomas took JMonkeyEngine (a java 3d scenegraph/game engine) and showed that he coded a simple game in Ruby, steering clear of the rather complex Java code.

This is, of course, another great feature of JRuby, you can code a “Java” app, and in certain places actually use Ruby to write cleaner or “easier” code.

Well worth the time!

General

Panel Discussion with DHH and Rails Core Members

September 3rd, 2008

Yesterday evening we attended a panel discussion with DHH and Rails Core Members Jeremy Kemper and Michael Koziarski.

DHH elaborated on default choices (like database, templating system and test suite) after being asked if Rails would switch over to RSpec instead of TestUnit. The answer was that Rails offers several defaults, which should suffice for new and basic users, who don’t know about all options and just want to get started. More experienced users will generate a taste for different components and Rails should provide for easy integration of these components if needed.

All in all there wasn’t any really new stuff to be heard, but a nice gathering non the less.

General

JRuby with Nick Sieger

September 2nd, 2008

Welcome to RailsConfA tutorial on JRuby with Nick Sieger holding your hand is just great. This guy knows JRuby inside-out and he has an answer to even the most difficult of questions.

After a short 15 minute introduction, Nick left us with our Rails app to start it with JRuby on a mongrel. I’ve been toying around with JRuby a bit before, and this was rather easy. Some people, however, encounter some issues with their apps because of incompatible gems, like OpenSSL or RMagic which are not available for the Java platform. Luckily, there are some nice Java alternatives like JRuby OpenSSL and ImageVooDoo. My app didn’t suffer from these issues, but from what I’ve heard, these alternatives work great.

Next for the big work: creating a WAR file and deploying it. I’ve done this before, and it’s dead easy. In stall the Warble gem, warble your Rails app and deploy the resulting WAR file.

Nick also talked about the differences between using the JVM and Unix. The biggest differences are memory management and the creation of new threads/processes.

There are quite a few things that Rails and a Java app server have in common, like logging and session handling. In his sheets (I’ll link to those later), you can see how you can tune your Rails app to make use of these features and improve your apps performance (by not logging and keeping sessions in two different places).

Continuing on the performance of Glassfish/JRuby, Nick shows several graphs on how well JRuby performs. A lot of attention goes to Rails 2.2, which will be thread-safe and what it means for JRuby.

JRuby can run with 1 runtime and fill your CPU with threads to handle requests using native Java threads. To handle database connections, Nick Sieger has written a connection pooling component for ActiveRecord (to prevent every thread having it’s own connection to your database). An unreleased version of warbler was distributed that will allow you to set max_instances to 1. This will create 1 Rails instance and use threading in Glassfish. Of course, this is only useful with Rails 2.2.

This was altogether a great tutorial afternoon. Besides the basic warble-your-app-and-deploy-it, Nick provided a lot of interesting facts and tips about deploying to Glassfish. I already was enthusiastic about JRuby, but now I really have to get my hands on a decent server that will run Glassfish comfortably. This means at least at least 1Gb of RAM, so I think I have found at least one drawback of using JRuby.

General , ,

RailsConfEurope: The first tutorial

September 2nd, 2008

Today, RailsConfEurope 2008 started! Well, at least if you signed up for Tutorial Day.

The first tutorial I’m attending is about Hacking Rails Internals. At first I thought about this as a great way to enhance my own apps and be able to easily integrate other apps like Radiant or Mephisto. However, the more I saw of the demo (it really is more a demo than a tutorial really), the more I disliked hacking Rails Internals.

Basically, you hook your own application code directly into the Rails code to make it jump through hoops. But, this comes at a big price. First of all, your app code is very dependent on a specific version of Rails, so upgrading Rails will most likely break your app and cost a lot of time (and money) to upgrade.

Next, you *are* overriding internal Rails code. You just don’t know if any other code (either yours, Rails or a plugin) depends on the behaviour of that code. So you should probably expect strange stack traces.

So, although hacking Rails to include your own or others code directly is great, it has some major drawbacks you should consider. To quote the presenter “It’s brutish, but it’s how to do it”.

I’m really looking forward to Nick Sieger and his JRuby tutorial this afternoon. I’m all set with Glassfish installed and my Rails app ready.

General

Leaving for RailsConf Europe 2008

September 1st, 2008

Today a delegation of Kabisa is leaving for RailsConf Europe 2008! We’re going by train this year and we hope to arrive this afternoon around 5.

I’ll keep regular updates here on Ariejan.net about RailsConf and all the things I’ve seen and done.

If you’re going to visit RailsConf Europe yourself, feel free to seek us out and have a chat!

See you at RailsConf!

General