News for hackers. Stuff that matters.
Re:How I Reduced My DB Server Load by 80% by zip1234 on Monday October 09, 2017 @12:54PM (#15435472)
ORMs are a great idea and can save a lot of time and prevent a lot of errors. However, they are not a silver bullet. If you have performance bottlenecks you still need to know SQL and should be looking at the SQL that the ORM generates. There is also a 'mixed-mode' ORM or a lightweight ORM such as Dapper. Dapper allows you to write the queries in SQL but it makes it trivially easy to convert those to actual objects and allow you to parameterize them.
Re:How I Reduced My DB Server Load by 80% by StavrosK on Monday October 09, 2017 @01:16PM (#15435635)
I don't really understand why people throw the baby out with the bathwater like that. What's the problem of using an ORM for 99% of your queries and doing the other 1% in raw SQL? Many ORMs (like Django's) even help you by mapping the results back into models automatically[1].

[1] https://docs.djangoproject.com/en/1.11/topics/db/sql/#mappin...

Re:How I Reduced My DB Server Load by 80% by dpark on Monday October 09, 2017 @02:52PM (#15436433)
I use something like Dapper on one of my services. I don’t consider it “throwing the baby out with the bath water”. My experience with ORMs is that they waste far more time debugging odd behavior and working around quirks and poor generated queries than they save in coding effort. I’ve never felt that ORMs actually saves me that much effort except for the boilerplate of deserializing into objects. Everything else I feel is a net negative. Writing SQL generally isn’t that hard. For the cases where it is hard, ORM generally does a poor job anyway.
Re:How I Reduced My DB Server Load by 80% by zaptheimpaler on Monday October 09, 2017 @09:55PM (#15438745)
The search for the holy grail continues..