REF: unreasonable-effectiveness-of-sql

[TOC]

Article summary

SQL has inspired query language design for non-relational databases: SQL for object databases, SQL for object-relational, SQL for XML, SQL for spatial, SQL for search, SQL for JSON, SQL for timeseries, SQL for streams and so on

随着SQL的发展,主键支持了相当多的技术:OLTP,OLAP,对象数据库,关联数据库,甚至是菲关系型数据库。SQL已经鼓舞了非关系型数据库的查询语言的设计。事实上,SQL成为了最成功的第四代语言。

SQL is a device whose mystery is only exceeded by its power. -- Lukas Eder

Now, there are more SQL projects in NOSQL databases than SQL databases.

Data models/formatsSQL implementation
JSONCouchbase N1QL: SQL for JSON
Wide columnCassandra CQL
Hadoop/Big DataHIve, Impala, Drill, BigSQL
Timeseriesinfluxdb
GraphSQL Graph Database, Oracle Graph
NoSQL databaseApache Phoenix
SpatialOracle Spatial
SearchElastic SQL

为什么SQL这么成功

可声明的

You declare the output and the query engines figure out the optimal way to execute the query.

你声明了数据对象,同时查询引擎找出执行这些查询的最优方式。

不只是用来查询

SQL was used not just for "querying", but to update the data, doing transactions.

SQL不只是用来查询,还能更新数据,做一些事物操作。

SQL已经是有延展性的

It has been standardized many times, each time adding a book full of features, a store full of syntaxies, and a dictionary full of keywords. For sure, not all SQL is the same.

它已经标准化了很多次,每次会增加很多功能,语法和关键词。当然,不是所有SQL都一样的。

SQL对新想法保持开放

SQL, like the english language it borrowed from. has been open to new ideas and extensions for new data types, access methods, use cases.

如果英语一样,对新的想法和扩展保持开放,支持新的数据类型,存取方法和用例。

SQL的独立性

SQL's independence from the data representation has allowed itself to be used on non-relational data: CSV, JSON, and all the big data format.

SQL数据层面的独立性已经允许它在无关联性数据中使用。例如CSV,JSON和所有大数据。