I think there are scenarios here.
- What if you are married to a dialect?
- What if you want it flexible?
I think there are scenarios here.
For further actions, you may consider blocking this person and/or reporting abuse
Abir -
Pranav Bakare -
Oliver Bennet -
Ashish Prajapati -
Top comments (13)
We used this on the example of large projects. It is convenient to use, but there are serious problems with memory and query speed. So, for example, in yii2, exporting data to csv format when using activerecord models gave out timeout or allowed memory ... While pure SQL solved the problem 100%. From my own experience, I can say that for small projects orm and activerecord are very good tools, but for large projects it is already necessary to deal with serious optimization.
What if you are married to ORM library?
Which library, which language, in your case?
Any library, any language.
The library might lose support, you might need to upgrade to a higher version with breaking changes.
Or perhaps you want to use some of the functionalities in different services with different languages or even reimplement the backend layer in a different language.
Those things are extremely hard if not even impossible when using ORM.
So pick the right ORM, one that is flexible, and which lets you feed it (parts of) SQL queries when necessary.
I prefer raw sql queries but then it increases the risk of SQL injection
I think ORM does translate to SQL queries, except that it isn't maintained by you.
Yes, but the execution of raw sql queries are faster.
What about native NoSQL for a small projects? I mean how fast would it be with MongoDB & GraphQL. How many of those pairs u're able to setup simultaneously?
You can do what you want, but the real strength of MongoDB lies in Aggregation framework.
Otherwise, it doesn't even matter which database you choose.
Well. The only thing do DATA-base stand 4 - the data. I mean types, memory allocation, responsiveness, etc. Any frameworks is stand for frame. So, no any relations. But my point was about GraphQL as ORM replacement. If it possible to say so. Just an analogy.
The way I usually use ORM is to attach Properties / Methods to Objects (in Object * Model).
GraphQL goes by a different paradigm.
I was in the SQL query gang until I saw this video: youtu.be/ya1fwxnmlQs