|
|
|
|
|
by imtringued
1714 days ago
|
|
I don't know why but there is this myth that ORMs remove the need to understand what a database is. I've used an ORM that supports both RDBMS and Mongodb and the biggest difference is that the RDBMS lets you write joins in your ORM queries. You still need to understand that the data you are interacting with is in a difference process or even on a different server that you are connected over a network. ORM is a nice acronym to throw around but people got the impression that it does more than that. Not having to learn SQL... What is that even supposed to mean? You still need to know how to write queries in an ORM. Most ORMs come with very nice query builders for that reason. I personally enjoy writing dynamic queries for extended search functionality. Supporting 3 dozen different fields to filter is much easier when you don't have to concatenate SQL or use boolean flags to toggle individual clauses of a huge static SQL query. Yeah they do suck at reporting, performance and supporting old organically grown schemas that weren't designed with the limitations of your ORM in mind. Whenever I need to insert thousands of rows, it's much faster without the ORM. I've never thought, oh the last 10% can't be done with the ORM, throw the entire thing away. Just be pragmatic and do what is most effective. I personally am tired of writing raw insert/update/delete queries that only touch a single row. For me there is nothing to be gained by not using an ORM when you can. My biggest pet peeve with JVM ORMs is that they don't work with GraalVMs native image feature. They create proxies and use reflection. I want a good out of the box experience so I don't use native image very often. It's a shame. |
|