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

Although SQL sucks, it is a higher-level facility for getting and setting data than ORMs are. ORMs don't exist to abstract away SQL; that is counterproductive. ORMs exist so you can store your objects in a relational database, which is not a problem you can solve in SQL.

I suspect that a big part of the problem with SQL is that it's too abstract: it is both hard to predict how fast a query will run and hard to predict whether the query will continue to run fast as the database changes. A big part of the appeal of things like memcached and Redis is that their performance is not only fast, but also predictable.



> it is a higher-level facility for getting and setting data than ORMs are

No, it's a higher level facility for querying data when you want different result sets back randomly, it sucks most common operations of inserting or updating data.

Forcing me to write a very long statement to insert a row isn't in any way more abstract that saying anObject.save().

SQL continually forces one to write the same boring code over and over. As soon as you start automating the generation of the boring bits, you've started to build an ORM. ORMs exist because programmers get tired of writing the same code again and again.

While SQL is good at what it does, it doesn't do the thing programmers need done most, which is store data structures easily without making them write a bunch of mapping code to translate it first. SQL isn't confusing, it's just frustratingly boring and repetitive.


In the comment you are replying to, I said, "ORMs exist so you can store your objects in a relational database, which is not a problem you can solve in SQL." It sounds like you're saying the same thing?




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

Search: