5 Reasons DataMapper Will Deprecate ActiveRecord 5
Merb brought much attention to the ActiveRecord alternative ORM DataMapper and I feel like it’s going to put a serious hurting on ActiveRecord. My reasoning is based on the fact that alternate data storage technologies are gaining serious traction. The latest and greatest (couchdb, dynomite, cassandra, thrudb) are offering distributed document / object databases that will make creating highly scalable websites even easier and faster, oh yeah and they’re all free. With that in mind, I’m expecting a paradigm shift in data stores (big variable huh?). At the very least I expect Maglev to come true and the free/open source clones to follow. The model storage shift then becomes, how to you write the validations, callbacks, plugins and relationships for first class Ruby objects… DataMapper basically has all the pieces there already. With that in mind here are 5 reasons DataMapper will rule Ruby object data storage.
#1 Rails 3
(this is the big one) Rails 3 (Merb) will open Rails up to ORM alternatives like DataMapper. This will fuel uptake of DataMapper and others.
#2 property
This is a core difference in how DataMapper and ActiveRecord work. DataMapper allows the developer to define the property (attribute/column) in the class. Defining your attributes is better than letting the data store define it. This will become more apparent with the adoption of document/object databases that don’t define a hard schema.
#3 It’s Ruby
Defining properties in terms of real Ruby classes is the hotness. Take any ruby class then, include DataMapper::Resource… done.
#4 Laziness + Strategic Eager Loading
Yeah, one of DataMapper’s core features is it’s ability to iterate over associations without causing the n + 1 query problem. Whether dealing with SQL or Memcache or something new this will always be an issue. It’s 1 vs. many selects, io, or network hits it will never not be an issue. DataMapper handles this gracefully.
#5 Mapping Data vs. Record Handling
ActiveRecord is based on the assumption your storage is a database record. The entire library is written with that in mind. DataMapper is extensible and modular. Don’t need SQL? OK great, but you still need validations, properties, callbacks, and relationships. DataMapper has this covered whether it’s SQL, REST, CouchDB, or anything else. It’s easy to create something new.
Hartford.rb on Merb 2
So after the last Hartford.rb meeting we started talking about the need for a web page. I volunteered and started working on it a few nights ago. I’ve been working with Merb and I’ve got to say that in the 2 months I’ve been away a lot has changed. I’m using haml and while it feels a bit different it does kind of make sense. So far the requirements are for pages, events and I think a way to upload documents and notes from meetings. I’m working on pages right now, slow going while I relearn Merb but happy to be working on something interesting and new.
What do other Ruby Brigades have on their websites?
"5 Reasons My Next App Is Going to Be In Assembly".gsub('Assembly', 'Merb') 2
1. Rails: So Easy A Caveman Can Do It!
I’m doing Rails over three years now, right around the time all the bullshit PHP clones started cropping up. I switched to Ruby on Rails from PHP because Rails is brilliant. ActiveRecord makes dealing with the database a so easy a caveman can do it. I’m 100% certain Rails’ uptake can be attributed to AR. That’s awesome and all but Rails has seriously gotten bloated in it’s chase to be enterprisey. ActiveResource, Timezones, mass-assignment, i18n… next bloat will be full text search mark my words.
2. You Miss PHP Don’t You?
The niceties of Rails are great but don’t you miss the simplicity and control of PHP? I certainly don’t miss the PHP because it sucks. I came for the Rails and stayed for the Ruby – writing non-Rails Ruby apps for a while now and loving Ruby. I’m crushing on Merb and Halcyon lately. I love Merb because I can screw with it!
3. I hacked Merb
In 20m I hacked the caching system to use memcached (the gem). In 10 minutes I dropped in a custom JSON-P rack handler. 30 minutes with Merb and I’ve boosted API performance 250%! All while dropping a shitload of bloat I don’t need and tightening my own code.
4. Merb Is A Sexy
It gives me the feeling I have control again and whats sexier than dominating Merb? Merb started out as a hack – just a few lines of Ruby on top of Mongrel… OK it’s not assembly – close enough.
5. Merb for Job Security
When the bubble 2.0 bursts you’re going to be fighting for a job with thousands of “Rails developers” that have read the Agile book and think they know Rails. I’ve interviewed probably a dozen candidates that “have Rails experience” but have nothing to show than internal app used by 20 people (if that). Writing Web apps is much more than CRUD. Get over it already.
Older posts: 1 2

