| As somebody who loves databases, I think the real issue that folks are meaning to critique isn’t actually using a “model.” It’s using an ActiveRecord-style ORM (or any ORM) without grokking what lies beneath. A database layer IS a model. It’s just not a class or an object. ActiveRecord is a really nice trick when it works … but it can create some really performance-killing side effects. Ruby’s Datawrapper ORM and its siblings in other languages requires understanding both sides (the object system and RDBMS) but can let you get your class/object semantics to play nicely with your database. And just passing around database connections and arrays of hashes can get you awfully far. But, if you want to not think about the database layer, ActiveRecord-style ORMs are a real win for developer ergonomics. And that’s part of the win of Rails/Django/etc. You can live in a single mental model (classes/objects with references to each other) and ignore the database layer. Except when you can’t. One reason (not a criticism) that NoSQL can be such a win is that the semantics are closer to class/object semantics. So you’re not trying to manipulate data with an abstraction that doesn’t quite fit. But most of our projects aren’t Twitter or FaceBook or Google or anything else functioning at galactic scale. |