SDS and Ruby

A couple of months ago my good buddy Ryan Dunn contacted me about writing some Ruby samples for the new SQL Data Services that is part of the recently announced Windows Azure. (at the time it was called SSDS). I completed the samples about a month or so ago but we had to wait to announce them until PDC. I wanted to create more than just a sample, I wanted to create something that would actually be useful.

The first step to using SDS from Ruby was to write a simple library to make working with the REST interface simpler. SDS has a very nice REST interface but its much easier to work with a Ruby library that wraps the XML format and calls. In this library I also included an ActiveResource "adapter" that makes working with SDS as easy as working with an regular active resource object. This library is hosted on github (http://github.com/sdsteam/sds-rest) and is published as a gem (gem install sds-rest).

Next I wanted to create a simple Rails application that used the sds-rest library and the activeresource "adapter", I created a simple task application that is also hosted on github: http://github.com/sdsteam/sds-tasks. This application shows how simple and easy the sds-rest library makes working with SDS from Rails.

Lastly we wanted to modify an existing application to work with SDS, this proved to be a little more challenging. I decided to try and convert Radiant CMS to work with SDS, but due to the nature of Rails and how tightly the Model are coupled to Active Record it would have been almost a compelte re-write to get it working with SDS using the ActiveResource adapter. Instead I elected to create an active record adapter that worked with SDS. The problem of course is that Active Record is designed to work with a relational database and SDS isn't one of those. While the active record adapter works for this example, I haven't published as a separate gem because it definitely isn't a fully functioning active record adapter. This version of Radiant is also hosted on github: http://github.com/sdsteam/sds-radiant.

If you are interested in Ruby and SDS please check these out and let me know what you think. Each sample includes step by step instructions on getting it setup and working (even if you haven't used Ruby or Rails before).

I plan on writing much more about the process of writing these samples, it definitely presented a number of interesting challenges.

-James

Comments

#1 Curtis Mitchell on 10.28.2008 at 9:30 PM

That's awesome! I can't wait to checkout the code and SDS.

Leave a Comment