RightScale Blog

Cloud Management Blog
Cloud Management Blog

RightAws Release 1.7.0, Including ActiveSDB Alpha

We released a new version of our Ruby library gem for accessing AWS Services, including EC2, S3, SQS, and SDB: RightAws 1.7.0 is now available on RubyForge.  This version includes enhancements of the EC2 interface to support elastic IP addresses, selectable kernels, and availability zones.  It also contains the first alpha release of ActiveSDB, which is a new ActiveResource-like interface for Amazon SDB. If you try out ActiveSDB please let us know what you think!


Good news! Does it happen to include support for signature version 0 to overcome the UTF8 problems in SDB?
Juergen, I'm afraid not. We've been busy absorbing all the changes... A patch would be very welcome though ;-)
Alright, I see what I can do. Currently I have simply overwritten the method in question to <em>always</em> use signature version 0. I try to make it more configurable.
I posted this on rubyforge also. Feel free to respond in either place (but please cc: my email if your forum comments here won't do that automagically). -- Hi, Just testing out ActiveSDB. I am wondering if my usage pattern is the most efficient? I setup my table like this: RightAws::ActiveSdb.establish_connection("KEY", "SECRET_KEY", :logger =&gt; Merb.logger) Post.create_domain Post.create :title =&gt; 'An SDB Blog Title', :body =&gt; 'Some really nice body text.', :created_at =&gt; Time.now In my posts controller I have something like this (I am using Merb BTW). I did it this way since it was the only way I figured out to get the collection in a way that I could actually access it in my views: app/controllers/posts.rb -- def index @posts = [] Post.find(:all).each do |post| post = post.reload @posts&lt;&lt; post end display @posts end Is this the best way to send a collection of found items to the view? This #reload method is not really clear to me (and feels like something that should be handled by the lib instead of called every time. no?). Also, When accessing this collection from the view it feels very clunky. The strings I stored (see above) are returned (always) as an array. Is this fundamental to SDB? I find I have to do things like this in my view to access an attribute which is not very pretty: post['title'][0] And lastly when accessing an object should'nt I be able to also get it with a symbol like: post[:title][0] This fails with an error (its returns a nil)... Please set me right if I am missing something. :-) Thanks, Glenn
Posted by Glenn Rempe (not verified)   Ι   April 15, 2008   Ι   04:44 PM
Hi. I heard your good news(http://gigaom.com/2008/04/23/rightscale-takes-45m-for-the-cloud/). I'm using your gem for SimpleDB, and wrote this post(http://flyingmate.net/46). Although it's written in Korean, you can understand the code of ActiveItem(named temporarily) at the middle of the post. That code snippet helps using SimpleDB similar to ActiveRecord, for example, you don't need to change controller codes and view codes for using RightAws::ActiveSdb. It wraps your attribute method like [] and []= with accessor method like #{attribute_name} and #{attribute_name}= for convenience. Action View's form_for helper use #{attribute_name}= style methods in default, and can not recognize []= style methods. If developer use form_for method without changing form_for helper with RightAws::ActiveSdb, undefined method #{attribute_name}= error occurs. So I suggest that implement your code with #{attribute_name} style method. In advance, I hope RightAws::ActiveSdb supports validations and associations like ActiveRecord. Thanks Sung Hoon

Post a comment