DataMapper Review and Impressions
On the first day, DHH made ActiveRecord, and ActiveRecord was good. Sure it wasn't originally thread safe and it created monster SQL queries updating every single column on a save even if only one value changed. Sure it may have used a ton of RAM and made you write a bit more SQL than you would have liked. But it worked and was good.
Today, there is a lot of buzz around Merb + DataMapper. I will review Merb later but I would like to let people know a few things about DataMapper.
DataMapper has a lot of promise. It is thread safe, smart about SQL updates, has a better interface for generating conditions for SQL queries. Unfortunately, it is in a very strange place right now.
DataMapper's gem is at 0.3.1. Unfortunately, the entire 0.3 release is all but completely unsupported by any community. Everyone in the DM community is working on the 0.9 release. That would be fine except for the fact that 0.9 is currently so far from working that you couldn't use it in production even if you wanted to.
So DM 0.3 is unsupported... that's ok as long as it works right? Well unfortunately, DM 0.3 has various very severe bugs that I can't get anyone in the DM community to care about... even though I have submitted patches to their bug tracking system.
- When you declare an :order in a has_many association, it does not work at all... it re-orders the entire collection arbitrarily
- The belongs_to association does not work if you have changed your primary key names
- External database contexts do not work at all even though there are examples of them on the home page
- DM 0.3 claims to be backwards compatible with ActiveRecord, yet you can not use your :from, :joins, or :group conditions when composing SomeClass.find(...) calls
And these are only the ones I found within 1 week of using DataMapper.
The thing that really scares me is that nobody seems to care. Any time I mention anything like this in the IRC channel, the standard response is: sorry, we are all working on 0.9, we have no idea about 0.3.
So in short, 0.3 is unstable with no supporting community behind it and 0.9 is completely unusable. Unfortunately, that is a bad combination in my book. I have branched 0.3 so that I can keep a stable version for myself, and if anyone wants to contribute you can find it at github. I am using it because I like it and know my way around the 0.3 source code so I can fix the large issues I encounter, however I would not recommend DM unless you are a seasoned Ruby developer who is not afraid to roam on your own inside of an ORM framework.

3 Comments:
Lucas, what you say is true, the support for 0.3.x could be better than it is. Most people, including myself, who are doing dev on DM are working on the next release: 0.9.
Not to make excuses for this, but the main reason it appears this way is that DM 0.3 was created by a tiny team of regular contributors. To my knowledge those people still commit fixes to DM 0.3. A couple of days ago a DM 0.3.1 was released for example. Many of those people are using 0.3 in production.
The ground up rewrite of DM 0.3 was decided upon because of some limitations in the architecture that would make it difficult for DM to support anything beyond traditional RDBMs.
However, after Yehuda's excellent presentation a whole new batch of developers started contributing to DM. Combining this with moving to github, with the 30+ forks & branches the DM community is much stronger now than previously. The huge volume of development being done on the 0.9 branch vs the 0.3 branch can make it look like all dev on 0.3 has stopped by comparison. While I agree it has slowed alot for 0.3, it is still happening just not at the pace many would like.
I totally agree with you though, we need to figure out how to best work on new versions of DM without letting maintenance on older versions suffer as it has with 0.3
2:22 PM, April 21, 2008
Lucas,
Sorry, I didn't mean to ignore your patches. Once I noticed how active the patching was on LH, I put some of my team on applying them.
I have to say though, please give DM 0.9 a shot. Yes, there are undocumented differences. We're active and hopefully helpful. Yes habtm is MIA (bad me!) but if you can live without it, DM 0.9 is sooo much better than the 0.3.x line.
DataMapper 0.3.x had 300-something specs. DataMapper 0.9.x (dm-core and dm-more) has over 1700 specs.
1700! :-D
I'm not saying people won't run into road-bumps with DM 0.9.x, but they'll soon be sorted, and the more people we have taking it for a spin, the sooner that'll happen.
As far as features go, once has_many:through support makes it in, DM 0.9.0 becomes an official release and we're off to the races. ;-)
1:44 PM, May 14, 2008
i dumped dm in favor activerecord because activerecord's associations are sooo much more powerful and rich. i really missed it when i was using datamapper.
4:17 PM, June 15, 2008
Post a Comment
<< Home