ActiveRecord adapter for Amazon's SimpleDB possible?

19 views
Skip to first unread message

Eaden McKee

unread,
Dec 14, 2007, 9:28:56 PM12/14/07
to rails-...@googlegroups.com
Hi there,
I've been notified by amazon today of the announcement of a limited
beta for their new SimpleDB service.
http://www.amazon.com/gp/browse.html?node=342335011

It seems to be inspired by REST, and for some applications could be
used instead of a RDMS.

Considering ActiveRecord has viewed databases such as MySQL a 'hash in
the sky' by not supporting many features such as foreign key
restraints etc etc, maybe it would be possible to create an active
record adapter for SimpleDB?

I'm not an AR hacker, but hoping someone on this list is, and can
provide some insight about the possibility...

Best Regards
Eaden McKee
--
Webforce Ltd. | www.webforce.co.nz

tobyhede

unread,
Dec 15, 2007, 7:36:39 AM12/15/07
to Ruby on Rails Oceania
It is certainly doable, but complicated by a couple of things.

SimpleDB has no schema ... you can PUT any Attributes in a Domain.
This means that you would have to have your schema described outside
of SimpleDB. There's no way of grabbing the attributes from a Domain -
attributes are always tied to an Item, but an Item doesn't have to
have attributes, so there is no guarantee that all possible attributes
will be returned with an Item.

Apart from the schema issue, I don't really see any particular
problems. AR is already abstracted from the underlying datastore, so
moving to SimpleDB should be relatively straight forward.



On Dec 15, 1:28 pm, "Eaden McKee" <eaden.mc...@gmail.com> wrote:
> Hi there,
> I've been notified by amazon today of the announcement of a limited
> beta for their new SimpleDB service.http://www.amazon.com/gp/browse.html?node=342335011

Nathan de Vries

unread,
Dec 16, 2007, 7:22:17 PM12/16/07
to rails-...@googlegroups.com
On Sat, 2007-12-15 at 04:36 -0800, tobyhede wrote:
> ...an Item doesn't have to have attributes, so there is no guarantee

> that all possible attributes will be returned with an Item.

It does if you store a schema version at the "Item" level, and perform
schema updates (attribute additions, modifications, deletions) on Items
which are below the minimum acceptable schema version.

--
Nathan de Vries

Martin Rehfeld

unread,
Jan 20, 2008, 5:48:08 PM1/20/08
to Ruby on Rails Oceania
Well, a full-featured ActiveRecord adapter seems hard to achieve. I
recently completed work on a proxy server allowing ActiveResource
models to use SimpleDB as a datastore. Find the results here:

http://inside.glnetworks.de/2008/01/20/bridging-rails-to-amazon-simpledb-using-activeresource/

Cheers,
Martin

On 15 Dez. 2007, 03:28, "Eaden McKee" <eaden.mc...@gmail.com> wrote:
> Hi there,
> I've been notified by amazon today of the announcement of a limited
> beta for their new SimpleDB service.http://www.amazon.com/gp/browse.html?node=342335011
Reply all
Reply to author
Forward
0 new messages