33
Martin Fowler: ORM Hate
(martinfowler.com)
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Follow the wormhole through a path of communities !webdev@programming.dev
ORMs are a pain and so is hand rolling SQL queries and doing the mapping manually.
I definitely think there's scope for NoSQL databases where the database "shape" matches the normal struct style of programming languages. Kind of like how JSON does and XML doesn't.
But it seems like all we got was MongoDB and Firebase which are both shit.
Are there any good NoSQL databases? MongoDB and Firebase don't even have schemas.
Postgres jsonb?
The real problem is that most data is inherently relational, and trying to force it into a document database is just as problematic as ORMs are.
I don't see why you couldn't have relations in a object model database. Just allow fields that are references to other objects or their keys.
Mongoose solves the schema part, or typegoose is you want it to generate types on the go as well.
My problem with mongo is that I always end up realising the advantages of SQL down the line, but I guess many of those projects wouldn't have gotten that far without mongo being so damn nice in the beginning.