3 ms·
While everything, including the Wikipedia definition of SQL defines it as tied to relational databases, one of our industry's biggest flaws is not realizing tha
by sixdimensional 8y ago
While everything, including the Wikipedia definition of SQL defines it as tied to relational databases, one of our industry's biggest flaws is not realizing that the basic concept of a Structured Query Language is that it can handle nearly all types of structures, including non-relational ones.
Take a look at the most recent versions of the SQL standard, say SQL:2016, and you see it handles document type data (JSON) pretty well too. The syntax isn't what we're used to, but it works pretty well.
I know that SQL can do more when you separate its conceptual foundation from relational databases. It's an expression language, an interface language to structured data.
I used to work on a platform that could translate SQL into NoSQL databases and SQL databases alike, it involves translating the expression into something that fits the native data model. For something similar look at Apache Drill, Dremio, Hive or PrestoDb and how they hide different types of databases behind interfaces that make them compatible with SQL.
I can admit, shoehorning SQL as it is onto a non-relational source (ex. Graph databases or search) isn't totally clean. But I believe it can evolve further as a standard to address that.
It requires more work in middleware to interface between SQL expressions and heterogeneous technology. And getting creative with the language constructs themselves. The power of data projection, data shaping and filtering alone, not to mention aggregation, etc. is undeniable in my opinion.
Disclaimer: I used to work for a company that built data federation software which supported SQL in front of heterogeneous sources. So what I am saying I know to be factual in most cases (although difficult!).
- smsm42 8y agoBut why? Yes, you can make all languages start queries with SELECT. In fact, for graph DBs you have SPARQL (which looks exactly like SQL if you squint a bit), and Elastic has its own SQL interface. But what happened to best tool for the job? Why try to shoehorn a relational database language into dealing with data that are not relational tables in their nature, instead of using approaches that work better? I mean, I understand there's a use case where it can be useful, such as SQL query builders or APIs that support only SQL, but in general case when you don't need one interface to rule them all, what's the use of shoehorning everything into SQL?
- TheAceOfHearts 8y agoToo bad normal people can't read the SQL standard without spending a huge amount of money. I just looked it up, and it looks like picking up all the ISO/IEC 9075 2016 specs would end up costing CHF1762 ($1819.09 in USD). Developers are also unable to become involved or voice their concerns in any meaningful way without spending an even larger amount of money to participate in their committees. Oh, and AFAIK all development happens behind closed doors, so good luck figuring out why certain design decisions were made.
- sixdimensional 8y agoThis is true.