Wednesday, February 18, 2009

MemCache Session Store with JRuby on Rails

The JRuby MemCache Client Plugin has been replaced by the JRuby MemCache Client Gem. Details can be found at JRuby MemCache Client Gem

We realized a few weeks ago that we spent a fair amount of time writing Project Kenai's sessions to our database. We already had decided to start using fragment caching and we were exploring different options on the client side.

Project Kenai's front end is a Ruby on Rails web application that is deployed to Glassfish and running under JRuby. We do have multiple JRuby runtimes per domain. There are issues with running the Ruby MemCache client with a JRuby on Rails application, so we paid some attention to Ikai Lan's jruby-memcache-client library. It is a wrapper around a Java based MemCache client that support connection pooling back to the memcached servers.

I quickly discovered that Ikai had focused on the Rails cache store but hadn't put work on the session store. I forked his project and started adding support for a session store.

Using the jruby_memcache_client plugin

Here are the steps to install the client:

  1. Run "script/plugin install git://github.com/fredjean/jruby_memcache_client.git" in the root of your Rails application. This will install my forked copy of the plugin.
  2. Configure the MemCache client by following the instructions located at http://wiki.rubyonrails.org/rails/pages/HowtoChangeSessionStore .
  3. Finally, change the config.action_controller.session_store to use :j_mem_cache_store instead of :mem_cache_store

Make sure that you have a memcached server running and start your rails application.

Making sure that it is running

You can verify that the sessions are sent to the MemCache store by restaring memcache with a more verbose setting. You should then be able to see sessions being put into and retrieved from the session store.

Tuesday, February 10, 2009

Cloud Computing in Plain English

From WHAT THE HECK IS CLOUD COMPUTING?

I think it does a great job of introducing the concept of Cloud Computing without going into the technical details that makes it tick.

Advice for Uncertain Times

Here are two things that you can do to help yourself and your career in these uncertain times:

  1. Upgrade your skills. Continuing to educate yourself is going to be key in standing out from the herd and adding value to your current or future employer. Now is a great time to learn a new language or get exposure to a new technology. The best part is that it doesn't have to be expensive. There are plenty of resources that are low cost or even free on the Internet or in books that will give you a head start on upgrading your skills.
  2. Network. Seek out other people in your industry that share similar interests. Find places where great programmers or designers meet in order to exchange information and tips. Don't wait to need a job to network either. It's never too early to establish relationships with individuals outside of your organization or company.

Users Groups in general give you the ability to do both. You do have a chance to meet other individuals that are willing to take some time to learn about technology and to network with other individuals of like mind. They are usually free and will often bribe you to attend with food (Pizza being a favorite around here) or door prizes. Many groups do go out for drinks afterward, extending the networking opportunity.

The Boulder JUG and the Denver JUG are going to host Scott Davis of ThirstyHead.com who will present on Lizard Brain Web Design and how to implement DSLs using Groovy. Make your way down to either meetings, learn a new thing or two and network with some of the brightest and motivated developers in the Denver area.