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.
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.
The code looks great. The mapping features seem strong (thanks in part to the power of ActiveModel). However, by restricting the adapter interface to a simple key/value store, don't you lose access to many of the features that make each backend distinct?
I think Redis, Cassandra, MongoDB, etc. are great, but to me it't the differences amongst them which are interesting, not the similarities.
So John in the above link was talking about how when you scale, you end up looking at bottlenecks, which are usually slow data accesses, and moving them into some sort of key-value store--that usually are based on a key-value access pattern. So by the time you're well into scaling your app, you noticed that much of your data access has turned into limiting yourself to doing key lookups to attain the performance you need.
Since (according to his experiences scaling) most of the performance bottlenecks seem to have this pattern, he asked, "what if you restricted your data access to just using key-value pairs from the very beginning?" That way you avoid some of the data access headaches later on. In answering that question, this is what they got.
If it's simple "stuff it in, pull it out" stuff, sure. Having things like validations and callbacks and association sugar and the like are really nice, though, in cases beyond the very simple. I think the point is to let you focus more on writing business logic, and less on mucking about with your underlying datastore. If it works as promised, then it could very certainly result in a productivity gain.
[+] [-] JonnieCache|15 years ago|reply
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.
[+] [-] kotrin|15 years ago|reply
[+] [-] tomafro|15 years ago|reply
The code looks great. The mapping features seem strong (thanks in part to the power of ActiveModel). However, by restricting the adapter interface to a simple key/value store, don't you lose access to many of the features that make each backend distinct?
I think Redis, Cassandra, MongoDB, etc. are great, but to me it't the differences amongst them which are interesting, not the similarities.
[+] [-] iamwil|15 years ago|reply
http://railstips.org/blog/archives/2011/01/27/data-modeling-...
So John in the above link was talking about how when you scale, you end up looking at bottlenecks, which are usually slow data accesses, and moving them into some sort of key-value store--that usually are based on a key-value access pattern. So by the time you're well into scaling your app, you noticed that much of your data access has turned into limiting yourself to doing key lookups to attain the performance you need.
Since (according to his experiences scaling) most of the performance bottlenecks seem to have this pattern, he asked, "what if you restricted your data access to just using key-value pairs from the very beginning?" That way you avoid some of the data access headaches later on. In answering that question, this is what they got.
[+] [-] tjpick|15 years ago|reply
Why does one need an object-relational mapper?
[+] [-] antirez|15 years ago|reply
[+] [-] koudelka|15 years ago|reply
[+] [-] netherland|15 years ago|reply
[+] [-] netghost|15 years ago|reply
[+] [-] j2d2j2d2|15 years ago|reply
DictShield: https://github.com/j2labs/dictshield
[+] [-] mariusmg|15 years ago|reply
[+] [-] cheald|15 years ago|reply
[+] [-] rapind|15 years ago|reply
Anyways, I'll definitely check it out. Maybe I'm missing something.
[+] [-] jrockway|15 years ago|reply
[+] [-] unknown|15 years ago|reply
[deleted]
[+] [-] unknown|15 years ago|reply
[deleted]
[+] [-] wildmXranat|15 years ago|reply