Gregg Pollack’s third installment of “On the Edge” is now available on RailsLab as part of the Scaling Rails series. In this episode, Gregg takes a look at three more Ruby libraries to help scale your Rails apps. First up is ‘rubber,’ a Capistrano/Rails plugin that makes it easier to deploy, manage and scale to Amazon EC2. After installing the plugin, just run the ‘vulcanize’ command to specify what components you want inside your EC2 instances. You can use templates such as the ‘complete_passenger_mysql’ cluster, create custom templates, or specify individual components. The vulcanize command creates a rubber directory inside your config directory that contains deploy info (Capistrano tasks) and configuration files. Once these config files are generated and your EC2 credentials are set, you can run Capistrano commands, which can actually instantiate EC2 instances–i.e. configure and deploy clusters. Gregg finishes with a description of the specific benefits of rubber compared to other tools.
Next is ‘cloud-crowd,’ which allows you to manage parallel processing through background jobs. The folks over at Document Cloud are creating an app that will allow you to upload docs such as PDFs and make them viewable and searchable. But how to quickly parse through a PDF and get that information online? They used cloud-crowd. A job is submitted to a central server, which dispatches work to different nodes. Each nodes has processes that complete their job and saves files to S3 (Amazon Simple Storage Service), then tells the central server when they’re done. The server tells the web app the job is complete, then the app fetches the data. That’s the anatomy of a cloud-crowd cluster. Gregg gives a demo and shows just how easy it is to use this plugin. Plus, it’s simple and purposely hackable so that it can easily be customized.
Lastly, Gregg introduces a program for managing email subscriptions and dealing with client requests. ‘MadMimi’ is a Rails-based email app that lets you easily schedule and track emails, as well as add or remove users to a mail list individually or in bulk. When it comes to change requests from your client (they want to change the email template for example), MadMimi let’s you store a bunch of email templates for anytime use. And you can use it to send emails from your Rails app. MadMimi provides a gem that allows you to write code that specifies the user mailer, the ‘to’ field, the ‘from’ field, the subject line, and the promotion name. You just send out a delivery command and MadMimi takes care of the rest. Now you’ve offloaded your emails to a web service, freeing your server from the task. It even supports dynamic content that you can program in and send to MadMimi, which in turn populates it inside each email.
- ‘rubber’ by Matt Conway http://wiki.github.com/wr0ngway/rubber
- ‘cloud-crowd’ by DocumentCloud http://wiki.github.com/documentcloud/cloud-crowd
- ‘MadMimi’ email service http://madmimi.com/
RailsLab on iTunes
Don’t forget to subscribe to the RailsLab podcast on iTunes where you’ll find the Scaling Rails series as well as our other RailsLab episodes. Download one, or the whole series and play them on your iPhone or computer.