Yes to ORM, No to custom queries. Here’s a bullet list:
- You’d probably end up writing your own ORM anyway.
- Doing so, you’d spend a lot of money writing library level code instead of your business logic.
- The time tested ones are likely to be better than yours.
- Beware, you’d have to figure out some complex issues: connection pooling, concurrency/locking, caching, transactions, updates, versioning, documentation etc.
If you find yourself ORM is falling short of what you need, you’re either presenting information overload or using a transactional database as a reporting store.
In this article, I mean ORM to be an object database mapping, so it applies to both SQL/NoSQL databases.
Disagree? I’d like to find your opinion in the comments.