Hacker News new | ask | show | jobs
by jiggy2011 4523 days ago
The problem is how do we define "from scratch", the common definition seems to be "Whatever I had to do when I started".

Even if you throw out of the ORM and go with writing SQL queries by hand, do we need to understand how the database will parse the SQL, how it stores the data on disk and how it executes the query?

The main reason to understand SQL when building a web application is really that the ORM doesn't provide a full abstraction due to the differences between the relational model and the OO model. If we could solve that then we could happily never use SQL again.

1 comments

Agreed. There is always a limit when it comes to going low level. Yes it probably is an overkill to understand how a db parses an actual SQL but helpful to understand how an ORM converts to a SQL query. This is again contextual. If you are writing your own database, then may be you do want to understand the parsing. But for web dev, may be not.
> Yes it probably is an overkill to understand how a db parses an actual SQL

Yes, I've thought that, too, but it turns out that, beyond a certain relatively low level of complexity, that's a great way to produce SQL queries which take a half hour to complete.

> but helpful to understand how an ORM converts to a SQL query.

Certainly, because there's a degree of complexity beyond which your ORM's going to start getting pathological and you're going to have to fall back on querying the database directly, which see point one.