Rails and Amazon: Libraries and Plugins for EC2, S3, SimpleDB, SQS, FPS and DevPay Integration

Unless you've been hiding somewhere, you're probably aware that Amazon has built up a comprehensive cloud computing infrastructure featuring a raft of pay-as-you-go services. What you may not know is just how easy it is to integrate most of these services with Rails. Between Rails-specific plugins and Ruby projects, you can quickly take advantage of the services that Amazon offers. Here's a survey of the available integration pieces.

EC2 is Amazon's Elastic Compute Cloud - the overall image-based supplier of computing power. One way to manage these images is with the amazon-ec2 gem, which gives you full access to the EC2 API. This lets you control server resources on demand right from your application code. Alternatively, if you're looking for administrative control as part of a deployment process, take a look at capsize, a Capistrano extension for managing EC2 instances.

S3 is the Simple Storage Service - a web services interface that can be used to store and retrieve data to arbitrary buckets. There are a number of projects - such as Paperclip - that can optionally use S3 storage. For glue, many of them use the aws-s3 gem, which wraps S3 for any Ruby application. You might also find a use for s3storage, a dedicated plugin to put anything from Rails to S3. Another way to get at S3 data is with cliaws, a command-line client that speaks to both S3 and SQS.

SimpleDB is the core database functionality provided by Amazon, using a flat dataset (instead of relational) approach. amazon-sdb is a Ruby wrapper around SimpleDB. Because Amazon provides a RESTful API, the wrapper is fairly straightforward, although the project itself may have gone quiet before actually getting finished. aws-sdb is another attempt at a SDB wrapper that appears to be somewhat more up to date.

SQS, the Simple Queue Service, is the messaging infrastructure that can be used to communicate between EC2 and other web services. There's a gem, rufus-sqs, the lets you write to and read from SQS queues.

Flexible Payments Service (FPS) is Amazon's e-commerce infrastructure, letting you manage everything from micropayments to straight credit card and bank account billings. On the Rails side, amazon_fps_foo integrates FPS, though this is a new project that will need to develop a bit more to be really usable. An alternative is remit, which provides a general REST wrapper for FPS in Ruby code.

DevPay is Amazon's other billing project. DevPay uses Amazon Payments as the backend for an online billing system, letting users move from your site into the Amazon pipeline. If you want to use DevPay from Rails, check out the devpay plugin, which makes the whole process simple.

If you're considering payments, you should also know about Simple Pay, which is yet another way that Amazon helps you take in money. It's not part of the AWS system, coming from the Payments folks instead. Rails developers can get to Simple Pay via the simplepay plugin.

Finally, if you're seriously interested in using the Amazon Web Services infrastructure, check out the PoolParty project. It gives you a slick configuration file based way to build out your cloud and integrate with other services.

Tweet This Post