5 ms·
be careful with ActiveRecord What alternative ORM would you recommend that is mature enough?
by 1gor 17y ago
be careful with ActiveRecord
What alternative ORM would you recommend that is mature enough?
- cschneid 17y agoIt really depends on your needs. My comment was in regards to the memory footprint. There was an Engineyard blog post about that recently. Basically if you do some non-obvious things, you can just explode out the size of ram, and because of how ruby works, it'll never get given back to the OS. Edit: http://www.engineyard.com/blog/2009/thats-not-a-memory-leak-its-bloat/ http://www.engineyard.com/blog/2009/thats-not-a-memory-leak-...
- mikeryan 17y agoPoor use of an ORM (or pretty much any robust full-featured library) has its risks. I'm not sure how you provide features that AR includes without putting your memory at risk of overuse. Model.find(:all) is going to be problematic across the board, there will always be a risk when you start playing with things like including children (there's a great benefit as well). You need to know what you're doing with any ORM.
- trevorturk 17y agoI've heard good things about sequel, but have never used it personally: http://sequel.rubyforge.org/ http://sequel.rubyforge.org/
- chasingsparks 17y agoI use Sequel when I am doing projects in Sinatra. It's elegant.
- jhancock 17y agoThe sequel approach is unique. I worked with it a year or so ago and was happy.
- cscotta 17y agoDatamapper (http://www.datamapper.org http://www.datamapper.org) is a great alternative as well. It's not as full-featured as ActiveRecord, but then it's also not nearly as heavy!
- tptacek 17y agoI love that Datamapper will build a working database from nothing just given the class definitions; no migrations, no schema definitions, just a URL to the database instance. Database access with Datamapper is completely frictionless, unlike with AR.
- davidmathers 17y ago"I'll come out of the closet about this and just say what everyone knows: If the DataMapper community had more of a focus on addressing known, ticketed, reproducible bugs and less on pouring thousands of man-hours into writing specs it would be usable today. Frankly, I would recommend against considering it for your next project in the strongest terms possible. Considering I created the project, nursed it through it's first couple years of development, and invented patterns like Strategic Eager Loading and Lazy Loading Contexts, which no other O/RM has to this day to my knowledge, that should say something. It's an epic fail of a project at this point." -- Sam Smoot http://robots.thoughtbot.com/post/162764036/why-do-rubyists-test-so-completely#comment-14834614 http://robots.thoughtbot.com/post/162764036/why-do-rubyists-...
- jhancock 17y agowow, that's a tough quote from Smoot. I use datamapper for an app in production and have no problems, but to be fair, my RDB access is very straightforward and I don't use any of the relations DSL stuff. Although I think a lot of Sam's work, his boast of inventing patterns of "Strategic Eager Loading and Lazy Loading Contexts" is hard to take. I wrote stuff like this in Samlltalk in the early 90s and again in Java in the late 90s. From my perspective, I don't trust any of the ruby ORMs. I constantly watch the SQL they generate thinking any day I'll catch an error. This isn't to berate the developers, but to acknowledge that the approach to solving this problem domain is too "magical" for my tastes. This is one reason with my new app I'm going with mongodb. I get a less trusted DB, but my ruby code accessing it is closer to the metal.