Live data from Hacker News

Toy Store: ORM for Riak, Redis, Cassandra, Memcached, darn near anything

thechangelog.com

1–10 of 21 posts

Re: Toy Store: ORM for Riak, Redis, Cassandra, Memcached, darn near anything

#4
post #2

This NoSQL stuff has me confused. I didn't think those systems were considered relational. Why does one need an object-relational mapper?

I believe the de-facto nomenclature for a NoSQL database's equivalent of an ORM is an "ODM", Object Document Mapper.

Re: Toy Store: ORM for Riak, Redis, Cassandra, Memcached, darn near anything

#6
post #2

This NoSQL stuff has me confused. I didn't think those systems were considered relational. Why does one need an object-relational mapper?

NoSQL systems are not SQL, but this does not mean they are unable to model relations. For instance in Redis you often have something like:

    user:1000
That is an hash with a few attributes, and among this attribs you can have 'group_id", that is an integer, for instance 50. Then if you access

    group:50
You have another data structure representing the group the user is associated with.

Re: Toy Store: ORM for Riak, Redis, Cassandra, Memcached, darn near anything

#10
And it's ActiveModel-based! Hallelujah!

For those not of a rails persuasion, ActiveModel is basically all the non-datastore stuff abstracted out from ActiveRecord, rails' ORM.

So, this Toy Store lib will share all its validation, accessor etc. apis with ActiveRecord and so will already automatically be compatible with the huge range of rails libraries out there. A good example is simple_form, a rails gem for doing lovely forms without any markup. In theory you should be able to hook this into Toy Store and therefore all those key/value stores with zero effort.

https://github.com/plataformatec/simple_form

ActiveModel is on course to become Rack for data objects. When this idea is fully explored it's gonna make so many things so easy.

Soon we're all going to be auto-generating javascript client-side validation code from our server-side activemodel validation definitions, without ever having to think for a second about how or where the data is actually stored.

Post reply on HN