Mike Perham

On Ruby, software and the Internet

Entries Tagged as 'Rails'

Improved Deadlock Retry

February 7th, 2009 · 2 Comments

Anyone who’s built a reasonably complex web site on top of a database has seen database deadlock. MySQL will throw a timeout error after waiting for 30 seconds, thereby ending the deadlock in a brutal but effective manner. Rails has a plugin, known as deadlock_retry, which will catch those errors and simply retry [...]

[Read more →]

Tags: Rails

DataFabric 1.2 released

December 1st, 2008 · No Comments

DataFabric 1.2 supports ActiveRecord 2.2 and its overhauled connection handling. Believe me, this is a good thing. The old connection handling code was awful; the new code is much nicer.
How It Works
data_fabric 1.0 supported dynamic connections by proxying the connection stored in the global static connection hash. This is thread-unsafe and therefore [...]

[Read more →]

Tags: Rails

data_fabric 1.1.0 released

November 22nd, 2008 · No Comments

Justin Balthrop at Geni was nice enough to donate a few fixes to data_fabric. The major issue was that when the connection changed, the plugin established a brand new connection. With his changes, data_fabric will now cache the connection and reuse it. This can lead to a noticeable performance increase if your [...]

[Read more →]

Tags: Rails

Rails Plugins with Multi-Threading

November 13th, 2008 · 5 Comments

I tested tracknowledge with Rails 2.2 yesterday. The main problem was with plugins: two out of the six I use failed with the same issue when used with threadsafe!
The issue is that ActiveSupport’s autoloading is turned off once threadsafe! is executed because autoloading is inherently thread-unsafe. These plugins were not explicitly requiring their [...]

[Read more →]

Tags: Rails

EnvyCasts’ new Rails 2.2 screencast review

October 28th, 2008 · No Comments

The guys at EnvyCasts gave me the opportunity to take their new screencast for a test drive. They’ve produced a 44 minute video and accompanying 118-page PDF covering all the changes in Rails 2.2. They call it “The Ultimate Guide to Rails 2.2″ but is it marketing hype, solid as a rock, or [...]

[Read more →]

Tags: Rails · Software

Laziness Can Hurt

October 24th, 2008 · No Comments

I like Rails’s config.gem feature: it’s simple and gives you a lot of functionality for cheap, much like Rails itself.  I just spent half a day tracking down a problem because we were overusing it.
I tend to be fanatical about minimizing dependencies as it has bit me several times in the past.  In this case, [...]

[Read more →]

Tags: Rails · Software

Bulk Import

September 11th, 2008 · No Comments

Some quick performance numbers around bulk insert of data into MySQL.  This test inserts 1000 rows into a table.  Rails 2.1.0, ar-extensions 0.8.0 and MySQL 5.0.45 on a MacBook Pro running Leopard.  I tested a number of configurations but the interesting ones are plain old iteration calling save, using ar-extensions’ import method and bare metal [...]

[Read more →]

Tags: Rails

Upgrading tracknowledge.org

September 7th, 2008 · No Comments

I’m upgrading my Rails testbed, http://www.tracknowledge.org, with the latest and greatest.  The Rails world moves VERY quickly and staying on top of it can be challenging.  When I built it initially in April 2008, nginx + mongrel was the typical deployment model.  I stuck with Apache though since it was already installed on the machine; [...]

[Read more →]

Tags: Personal · Rails

Rails Bootup

June 30th, 2008 · No Comments

Damon Clinkscales, of Austin on Rails fame, has created a one-day workshop to take your Rails skills from 0-60 in 8 hours. While this might be abysmally slow for a car, it’s a rocket sled for software engineering! I’ll be there, teaching about ActiveRecord and how to bend the database to your will. [...]

[Read more →]

Tags: Rails · Ruby

The MVC Song

June 4th, 2008 · No Comments

MVC Song by Laura Balch
The FiveRuns crew have been humming this ditty under our collective breath for the last two days. Kudos to Laura for an addictive little tune!

[Read more →]

Tags: Rails