Simple_record for amazon simpledb

I got  lucky by for trying amazon simpledb. Amazon SimpleDB is a web service providing the core database functions of data indexing and querying in the cloud.

Some basics about it:

Model:

class User < SimpleRecord::Base
has_strings :first_name, :is_monkey
has_ints :age
end

Controller:

@user = User.new(:first_name => “kranthi”, :is_monkey=>true)

@user.save

And we have the user created. We must try to do a batch save to reduce the number of hits so as to save our monies :p

After the basic is done may be we can move into creating relationships. One of the important things would be that right now I could not some how get the part of many-many relation. But I could get the belongs_to and has_many working with the current simple record.

One of the solutions(may be not very elegant) could be the use of multiple attributes which save the ids and retrieve them as required.

I have also noticed that simple record support dirty saving which quite impressive, buts the virtual attributes are not yet into full implementation.

As I get going with this… I’ll be updating my blog..

Advertisements
  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: