Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Your comparison is not apt; an ORM can be used for any SQL flavor.


Having written an ORM myself back in 2000 and used Hibernate and JPA for many years, I'm now of the opinion that ORMs are an unnecessary, leaky abstraction in the modern day of dynamic languages.

One is better off talking directly to the data store and effectively streaming data out via a REST API.


Why would someone downvote this?

ORMs certainly are a leaky abstraction, and they certainly do come with a penalty in performance and expressiveness. Is it really downvote-worthy to add the opinion that they are unnecessary?


There are SQL libraries out there that make writing raw SQL unnecessary and also provide you with all the semantics of actual SQL, with no performance or expressiveness overhead. SQLAlchemy for Python is an example, there are others.


Yes, at one startup I worked on we had written one of those as well (https://github.com/akshell/docs/blob/master/guide/db.rst).

The problem is they are still an abstraction. You write these queries using chaining or whatever but when something goes wrong you still need to look at the generated SQL statements.

With MongoDB, the query you write in your app is exactly the same as the query you run from the MongoDB shell and I like that. I can prototype the query in the shell and then copy paste it into the application code. When the application code is producing unexpected results, I can easily debug it in the shell.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: