Hacker News new | past | comments | ask | show | jobs | submit login

I think you missed the line, "SQL feels horribly verbose, right until you compare it with equivalent procedural code."

Having written SQL of varying complexity, and having rewritten it both directions between SQL and procedural, I'm in a good position to compare. And SQL is very good for its purpose. This is why nothing has replaced it.




> This is why nothing has replaced it.

I don't buy this logic. It's like saying Facebook is a good social network and this is why nothing has replaced it.

SQL obviously is an industry standard, the first thing you learn at IT bootcamp or CS classes, the first thing you've being asked at a job as a junior, etc. Decades of experience made most popular SQL engines stupidly effective. Yet, SQL as a query language was designed long time ago, when the data was orders of magnitude smaller and assumptions about data queries needs were way different from today.

Let me put it this way – if data query language was designed today from scratch, with all the knowledge and experience we have now - it'll look very different from SQL. I mean, it's just obvious that with more time and real-world practice we get more understanding of how to shape our tools. And then they shape us, of course.


SQL would have looked different back in the 1970s if it had been designed from scratch. In fact it was. One example was QUEL, the query language for Ingres, which was an influential RDBMS developed at UC Berkeley by Stonebraker and Wang. [0, 1] So far none of the many attempts to develop a different language has succeeded.

IMHO the only way SQL will be replaced is if some variant becomes dominant because of a strong implementation that extends the language in useful ways, kind of how Latin turned in to French in the Middle Ages. Open source databases like MySQL and ClickHouse that ignore SQL standards BS and just put in useful features have shown the way.

[0] https://en.wikipedia.org/wiki/QUEL_query_languages

[1] https://en.wikipedia.org/wiki/Ingres_(database)


Do you have ANY sense of the history here?

Query languages existed long before SQL was invented in the 1970s. For example IMS, still widely used for financial transactions was created in the 1960s. Even if you limit yourself to relational databases, there was long a competitor named QUEL. (Postgres originally used a dialect of QUEL as its query language.) Query languages continue to regularly be introduced. Practically every "NoSQL" system out there has one. Most object-relational mappers at some point introduce a query language that they think is better than SQL.

I long ago lost count of how many query languages I've had to do something with for environments as different as MongoDB to Redis to custom languages for doing MapReduce on distributed systems. Some of those last indefinitely - both MongoDB and Redis are doing well. Other tools eventually sprout SQL layers like Postgres and Google BigQuery did. And SQL systems often sprout alternate layers as well, for example multiple projects exist to allow your SQL database to turn into a GraphQL one instead.

The influence of SQL is not an artifact of history. It is due to the fact that, in a dynamic ecosystem filled with competition, nothing has managed to dethrone SQL since it successfully swam to the top and became dominant back in the 1980s. And ever since then, the end of SQL has been predicted. The next big thing is always around the corner. Maybe https://www.codemag.com/article/0305091/XQuery-the-Query-Lan... is right and XQuery will finally slay the SQL dragon. Mind you I read articles like that 10 years ago and SQL is still standard. I also read articles 20 years ago like that with the same result. So it is probably a good idea to hedge your bets and learn SQL just in case history repeats itself.


Thanks for the mentions of IMS and QUEL – I didn't know about them.

I guess the main point I disagree with you here is about "dynamic ecosystem filled with competition". I totally agree that SQL won the battle of dominance, and that's the main reason why SQL stays popular and not so much competitors even emerge (sorry, MongoDB query language is a joke).

Take QWERTY as an example. It's been proven countless times that it is suboptimal layout. It was designed with suboptimal trade-offs and with different goal in mind (minimize jamming of a typewriter). But it got it success and become dominant because of commercial success of typewriters with this keyboard layout. The rest is a pure network effect.

So when I read your comments on SQL I hear something like "QWERTY is objectively the best layout, because nobody managed to dethrone it in a highly competitive settings, and because I type 800+ chars per minute with it". So that's true that SQL is dominant, but is it objectively the best we can do? I don't think so.

Also, what's your experience with EdgeQL? I know it's a layer on top of existing SQL, but I had incredibly positive experience with it (after 20+ years with SQL). And I can totally see it as a standard for data query by itself. I would love to have something serverless like EdgeQLIte, in fact.


First of all you might want to refresh your memory on the QWERTY layout. As it happens, in grad school a group of us bought into the Dvorak myth, and spent several months retraining on Dvorak. We didn't see great results. And then by chance one of us ran across https://reason.com/1996/06/01/typing-errors/ and we realized that, based on research we had not known existed, there was in fact every reason to believe that QWERTY is superior in practice to Dvorak.

And this brings us to the subject of network effects. It is easy to see, and experience, that network effects are real. And certainly they contribute to why existing networks dominate, and alternate ones struggle. However, on multiple lines of evidence, network effects are far smaller than people suppose. In fact they scale as O(n log(n)), see http://www.dtc.umn.edu/~odlyzko/doc/metcalfe.pdf for multiple lines of evidence supporting that estimate. This is a big barrier to getting modest adoption. But if a better technology gets there, it isn't a barrier to dethroning the leader. And so, despite network effects clearly favoring Perl at the dawn of the web, Perl got overtaken by PHP got overtaken by node.js got overtaken by Python. Lock-in to popularity is clearly less of a factor than it may seem. (And none of those technologies actually went away. It is likely that more people program in Perl today than in 1998.)

And there are no shortage of potential competitors out there. The number of query tools that I have had to learn and use is a testament to that. And, just in case I needed more evidence, you bring up another. As it happens, I have not used EdgeQL. After reading a bit about it, I'm not sure why I'd want to. But if it gains any popularity, then some day I'm sure I'll have to.

But looking at it, I'm reminded of a fact about programming languages. The perfect is the enemy of the good. Different people have different notions of what perfection looks like. And therefore attempts to create a perfect system inevitably splinter into a million fragments, none of which can gather the critical mass to overcome network effects. Look at the history of Lisp to see this in operation.

And yet the best ideas do tend to emerge. Back when I first learned JavaScript, closures were a weird feature that books didn't even want to try to explain because programmers wouldn't understand them. (JavaScript has them because it was created by a Lisp hacker.) Today they are considered standard, and even languages like Java have been forced to add them.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: