Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API

From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
12bitfloat10300182dORMs are one of those things that sound like a really great idea on paper and then become the biggest pains in the ass imaginable
-
Root77464182dThe biggest problem with ORMs is that most devs think they’re amazing and thus use them excessively, especially when and where they shouldn’t.
-
lorentz15201182dThe biggest issue with ORMs is that they work well until you add the first bulk update or arbitrary SQL query, which usually happens too far into development to remove every reference to the - now permanently unreliable - caching layer.
-
lorentz15201182dYou can map a remote object to cached rw local objects if you can guarantee exclusive write access. Otherwise writes should be commands that are asynchronous, fallible, and failure or success is determined before the local object - which may be shared - is updated with their speculative outcome.
-
Lensflare19057182dThe biggest issue with ORMs is they solve a problem that shouldn’t even exist.
Not every use case needs a relational database.
Use a nosql db and you don’t need fucking ORMs. -
12bitfloat10300182d@Lensflare I mean even then, unless you're using javascript, I can understand the want for a layer that translates your native classes/objects into sql
The problem is that sometimes you'll get a little more than you've bargained for with these abstractions... -
Lensflare19057181d@retoor it’s about using the right tool for the right job. SQL isn’t always the right tool and I suspect that there is a shockingly large number of devs deciding to use sql by default, not even thinking about if nosql makes more sense or not.
-
Lensflare19057180d@retoor yes, everything has structure and nosql doesn’t mean no structure.
A nosql db will actually better reflect the structure of the data in code because in code it’s a hierarchy or a graph and sql can’t have hierarchies or graphs. Sql is relational and expresses hierarchical relations via data, not structure. You need to introduce extra tables to be able to express relations between entities which are organized in graphs or hierarchies.
The main point of an ORM isn’t just bringing the db entities into the code, but mapping the relations (it’s in the name ORM).
The biggest issue with Orms is that they lie
rant