San Francisco September Ruby meetup 1

Posted by Pelle Wed, 19 Sep 2007 20:27:42 GMT

Bosco giving the Welcome

Bosco threw another great San Francisco Ruby Meetup last night. It was held at the offices of RapLeaf, whom I have been following in a long time.

There were 2 official talks and a couple of smaller talks by the RapLeaf guys.

Bala Paranj talking about Ruby Idioms

First up was Bala Paranj who gave a fun talk on Ruby idioms with lots of audience participation. He managed to show several that I hadn’t heard about before. He will post the pdf on his blog shortly.

Tim Burks presenting his new language 'nu'

Tim Burks presented his cool new language Nu, which had all of us reliving the 6 month wait of the iPhone announcement and the eventual release.

Everyone wants to get their hand on Nu. Basically in a nutshell it is a kind of ruby/lisp clone built on top of the Objective C object model. It is fully multi threaded and will allow you to write parts of your app in Objective C and parts in Nu. While I was never a fan of the Lisp syntax it looks really cool. With that I might actually start to do some Cocoa programming.

As an added bonus he has the coolest sounding utilities nubile which does realtime code beautification in Textmate and his rake clone nuke. He has introduced them here in The Nu World Order.

Jeremy Lizt from Rapleaf

Jeremy from Rapleaf briefly explained some of the cool stuff they are doing in Ruby. They are working with huge amounts of data so they have created RapReduce a Ruby implementation of Googles MapReduce. At the moment it’s for internal use only but it sounds cool. They have a new blog Engineering Rapleaf where they cover some of the stuff they are working on and releasing.

Brian also from Rapleaf (Sorry forgot to take a picture) explained about their Mysql Replication Adapter gem, which enables you to fairly transparently use slave databases when you need to by patching ActiveRecords find method.

You have to specifically add it to your find method like this:

MyModel.find(:all, :use_slave => true)

A question was asked about why not to make it automatic? Brian explained that it’s much safer to use it explicitly or it might be very easy to have unintended consequences. I think that makes a lot of sense. For example in a index or show action, where you know it’s safe. You wouldn’t want it to ever be used in a before_save model callback for example.

One question I do have, which I didn’t think about last night is what about associated models that you haven’t explicitly included in the find? Also can you use :use_slave=>true in specific association queries? Such as @bob.agreements.find(:all,:use_slave=>true)? My guess is that the last example should work.

Anyway I don’t need to use it for any projects at the moment. We use EngineYard and am currently happily ignorant on how they do it. I should ask I guess.

Create a simple NDA with zero legalese in no time at all and for free at our service Agree2.

Trackbacks

Use the following link to trackback from your own site:
http://stakeventures.com/articles/trackback/255

Comments

Leave a response

  1. Avatar
    Bryan Duxbury Wed Sep 19 18:44:15 -0400 2007

    About MysqlReplicationAdapter and association finds:

    If you pass :use_slave => true in @model.some_association.find, then it will work as intended. The options passed to Association#find delegate to the regular #find, so it still gets the slave balanced magic.

    Another way you can take advantage of :use_slave is with eager loading. The query that is generated by rails will still be sent to one of several slave servers, so you can pull up a lot of stuff all at once.

Comments

(sorry javascript required)