4 ms·
It feels like people keep getting burned by investing all their stock into an ORM and then overcompensate by never wanting to use any ORM again. ORM's are awes
by div 15y ago
It feels like people keep getting burned by investing all their stock into an ORM and then overcompensate by never wanting to use any ORM again.
ORM's are awesome to get things done quickly, but as stated in the article, and stated by those very same ORM's, you do sacrifice some performance.
As usual with these articles, there is a false dichotomy that one should choose between ORM or no ORM. It's a perfectly sound decision to use an ORM and hand-optimize whenever the need arises.
Also, ORM's usually _are_ optimized for the 90% use case, so going of on your own to write those in plain sql for your entire domain model is passing up on a huge amount of leverage.
- gaius 15y agoORM is like satnav in your car. Sometimes it will get you from A to B without you having to think too much. But sometimes it will send you off around the houses. Now a normal person would say "stupid satnav" but an ORM fan would say "stupid car" (blame the database for being slow).
- pyre 15y agoI don't see anyone arguing that the database is stupid for being slow. I see a bunch of anti-ORM people arguing that an ORM is never the right solution to any problem ever. I also see a bunch of people arguing that ORM mixed with SQL is perfectly fine and there is nothing 'broken' about it (which I think is the more moderate view). I don't see anyone here arguing the opposite extreme of "ORM is always the right approach to every problem." I view the "ORM fan" as a strawman for the most part in this whole discussion.
- gaius 15y agoMy experience as a DBA is that someone will develop using Hibernate, it'll go into production and run like a dog, and they'll go straight to their manager and say "It's the database". Because noooooo it couldn't be his perfect code, could it?
- pyre 15y agoSo ORM should never be used because it might be used by some incompetent programmer somewhere and frustrate his DBA?
- Ingaz 15y ago>>you do sacrifice some performance You sacrifice not only performance. You sacrifice power over data. ORMs - OK if CRUDs are your '90% uses cases'. ORMs - fail if you need something slightly more complicated.
- div 15y agoThere's still a relational database there that will respond just fine to any well-formed sql statements you can throw at it.