Menu
Back to Discussions

Are ORMs always the best choice, or is raw SQL sometimes better?

Fabiola Valdivia
Fabiola Valdivia
·4915 views
Lately, I've really been pondering ORMs. I mean, they're great for making database interactions quicker and simpler, getting rid of a bunch of repetitive code. You get things like type safety, simpler migrations, and usually, code that's easier to read. But I've definitely hit snags too, where the ORM query builder just couldnt make the exact SQL I wanted. Or it churned out something super inefficient. Sometimes, honestly, writing a tricky join or a specific optimization in raw SQL just seems like the only path to good performance. So, what's everyone's take? Does the ORM abstraction ever just get in the way instead of helping? And for certain apps or query types, would you just go straight for raw SQL, even if an ORM is right there?
2 comments

Comments

Loading comments...