Hey Folks, today I’m proud to announce my first release of the waz-blobs ruby gem, for interacting with Windows Azure Blob Storage from Ruby programming language.

Yes, it’s 100% organic Ruby code, there’s no strange Microsoft library that you need to consume and even better it was written and tested on Mac OS X and Ubuntu 8.10.  This post is about the motivation, and design process I’ve taken. Here you will find a minimal reference to the code, if you’re looking for the bits go straight to http://github.com/johnnyhalife/waz-blobs/ that includes the whole API documentation.

Motivation

Interoperability, fun and inspiration! Those three words are the base of this whole experience, from those OSS Fan thinking “why would I go for Windows Azure Storage? I’ve have my App written 100% ruby and runs on my custom built linux distro!”, here is the summary of the thinking I’ve been doing when I was trying to understand whether to write the API or not:

  • It’s solid. Although it’s on CTP, it has been out for almost a year and during the different version it has demonstrated some basic fundamentals covered on Distributed Storage and the speed it’s really good.
  • Ruby’s alternatives for serving static files isn’t great. I love Ruby, it has slowly became the language of my preference on the last year, but we have to admit that serving static files it’s better when outside our Ruby App server.
  • It works great from Heroku. I spend my spare time hacking on pure Ruby and most of my project end up on Heroku (by far the best Ruby Hosting Platform on the Clouds). As you can see on Heroku Docs, their recommendation is to go for AWS-S3, and I don’t like when my choices are limited, I wrote the gem just to have an alternative for S3 when hosting on Heroku.
I loved the experience, and I’m loving each moment I spend hacking on this code, it’s probably one of the most fun projects I’ve ever faced. As a .NET Developer, I figured out that even the Storage Client shipped with Azure SDK isn’t great (it’s not even fully implemented agains the API Spec), so instead of complaining I developed my own.

As summary: I did it for fun, I did it because I like having choices (not only S3) and because I wanted to see how real is Microsoft statement about interoperability for WAZ Services, which end up being completely true this time.

Getting started with the waz-blobs API

First of all, if you just want to use it just get it from the gems repository like the following:

gem install waz-blobs --source http://gemcutter.org

And here’s some basics

  require 'waz-blobs'

  # Save your configuration info
  WAZ::Blobs::Base.establish_connection!(:account_name => "name", :account_key => "key")

  # creates a container
  container = WAZ::Blobs::Container.create('my-container')

  # stores a blob with custom properties (metadata)
  blob = container.store('my-blob.txt',  'this is the content of my blob', 'plain/text')

  # return a specific blob from a container
  blob = container['my-blob.txt']

  # retrieves a blob value
  blob.value

The complete API reference and source code can be found at http://github.com/johnnyhalife/waz-blobs/, feel free to download, fork it, and submit patches.

Next Steps

During the next days, I’ll continue using this and probably refactoring or bug fixing. In the near future (don’t know how quick yet), I’ll get the WAZ Queues API too.

While I work on Queues, fork me on GitHub and consider yourself invited to submit as many patches as you want.

thanks and read you soon,
~johnny

4 Responses to “Consuming Windows Azure Blob Storage from Ruby”

  1. JC Cimetiere Says:

    Hi Johnny,
    Thanks for sharing this, this is very cool to see bridges like this to Windows Azure.
    JC

  2. Twitter Trackbacks for Johnny Halife’s Blog » Blog Archive » Consuming Windows Azure Blob Storage from Ruby [southworks.net] on Topsy.com Says:

    [...] Johnny Halife’s Blog » Blog Archive » Consuming Windows Azure Blob Storage from Ruby blogs.southworks.net/jhalife/2009/10/06/consuming-windows-azure-blob-storage-from-ruby – view page – cached Hey Folks, today I’m proud to announce my first release of the waz-blobs ruby gem, for interacting with Windows Azure Blob Storage from Ruby programming language. — From the page [...]

  3. progg.ru Says:

    Consuming Windows Azure Blob Storage from Ruby…

    Thank you for submitting this cool story - Trackback from progg.ru…

  4. Johnny Halife’s Blog » Blog Archive » Windows Azure Queues exposed directly to pure Ruby! Says:

    [...] on the previous post I wrote about the Blobs API,  this post isn’t about API documentation. It’s about all [...]

Leave a Reply