Having said that, if you're using an established ORM like Doctrine then the possibility of ever needing to understand the underlying database structure and complexities is almost null. The time saving benefits, pooling, support for transactions, security best practices for your queries and caching features alone make an ORM worthwhile in the end. I think ORM's are great if you dig deeper and explore how the ORM works, it doesn't mean you have to write straight-up queries, but it pays in-case you are ever in a situation where an ORM isn't allowed by a manager or senior developer and you're asked to write a native query.
* I have little need to switch databases
* ORMs provide little support for things like
views, stored procedures, custom types
* I like to see the SQL in context of my code.
I've come to these conclusions for myself after having run the gauntlet of several Symfony projects. There was simply too much abstraction from the actual code that "did the work." I found myself creating and extending classes (or annotating) to simply add a type or make code do simple joins.I also found that using the ORM was having a detrimental impact on performance and scalability in a subtle way that had nothing to do with the ORM itself: It's that I got used to operating so far from the database layer that I wasn't really aware of what was going on down there. Last time I did a conversion of a project away from ORM, the number of forehead-slapping moments when I noticed a simple way to improve an operation's performance by at least one order of magnitude was downright embarrassing.
That said, that's where I depart on the third point. I've also moved to using stored procedures for everything. I don't know if the situation is quite the same for MySQL users, but in Microsoft-land the amount of tooling SQL Server and SQL Server Management Studio provide to help with managing, analyzing, and refactoring SQL code is really pretty impressive. . . and if you divorce your SQL code from its native environment by demoting it to being nothing more than string resources that are subservient to the application code, you're letting go of a lot of those tools. Or at the very least, creating a lot of unnecessary friction when it comes to getting at them.
However, as a RAD kit I think ORMs are fantastic. They can, as the article highlights, do a lot to protect someone with limited skills in database work from getting themselves into trouble. But they're still just a RAD kit, and like any RAD kit they have their limitations.
The primary benefit is the lazy (proxy) loading of entities and mapping data onto complex graphs, not to mention updates that span multiple entities in a single transaction.
Performance-wise, we've reduced lazy loading via eager selects, result caches, and one instance of mapping SQl results back to an object.
All in all, it feels better working with objects than it does with raw data, and it is very reliable in my experience.
As a tool, it seems to work extremely well, despite academic objections to it.