Articles by Mike Perham

Mike Perham

Mike Perham

Configuration for Rails, the Right Way

I still see people promoting various gems and plugins to handle miscellaneous configuration elements for your application. One little known secret is that Rails 3 allows you to define your own configuration elements trivially. In this case, I wanted to use the nifty wkhtmltopdf utility to create a PDF. I was able to call the

Mike Perham

Mike Perham

Up and Running with Clojure

For the last three years or so, Clojure has been a language that I admired from afar: the design of the language is wonderful but I’ve never really used it to build anything and haven’t looked closely at the language in a while. Recently we had a Carbon Five tech showdown between Node.js and Ruby

Mike Perham

Mike Perham

A Modern Guide to Threads

I spoke recently at Rubyconf 2011 on some advanced topics in threading. What surprised me was how little experience people had with threads so I decided to write this post to give people a little more background on threads. Matz actually recommends not using threads (see below for why) and I think this is a

Mike Perham

Mike Perham

Improving Resque’s memory efficiency

Resque is a very popular message queueing system for Rails applications.  Here’s how I recently improved the memory efficiency of a Carbon Five customer’s resque processing farm by 68x! The Problem This customer has an existing investment in Resque and is a heavy user of a third-party Java API so they need to run their

Mike Perham

Mike Perham

Think Globally, Stage Locally

Or: how to create and deploy to a staging environment running locally! Staging: an environment that duplicates production as closely as possible to find any lingering bugs before you update production. Most of the Rails community develops on OSX but deploys to Linux; this can be fragile since it is common to forget Linux-specific environment

Mike Perham

Mike Perham

Asynchronous Processing with girl_friday

I want to introduce you to my new gem, girl_friday. The problem: current asynchronous processing tools with Ruby are too inefficient and too complex. Efficiency It’s sad to admit but commonly with Ruby if you want to process 5 messages at the same time you have to spin up 5 processes, each of which boots

Mike Perham

Mike Perham

Concurrency with Actors

Programming concurrent code with threads and shared state is hard to get right.  Actors are an attempt to build a safer concurrency model for application developers to use.  Erlang uses the actor model as the basis for its concurrency and while Ruby doesn’t have actors built into it, actors can be layered on top of

Mike Perham

Mike Perham

Node.js, Part III: Full Stack Application

In my previous posts, I introduced you to Node.js and walked through a bit of its codebase. Now I want to get a simple, but non-trivial Node.js application running. My biggest problem with Node.js so far has been the lack of substantial examples: if I see one more Hello World or Echo Server, I’ll flip

Mike Perham

Mike Perham

Node.js, Part II: Spelunking in the Code

In my last post, I gave a quick overview of Node.js and showed you how to install and smoke test it. Now let’s dive deeper and learn what it provides and how it works.

Mike Perham

Mike Perham

Node.js Overview

I was a Java guy for 10 years and I’ve been a Rubyist for the last 5 years. Over the years, I’ve tried to develop expertise in a particular area of technology that will both pay the bills and make me happy as a programmer while also watching for upcoming changes in the tech world.