Those watching the NoSQL movement carefully over the past 10 years have observed a curious trend. Initially, NoSQL was a rejection of SQL. Over time, the movement transitioned into “Not Only SQL”. Today, many of the most popular NoSQL systems have added SQL or SQL-inspired query tools. In addition, a number of new SQL-Relational data stores are gaining acceptance and mindshare, including VoltDB.
This resurgence may not be a surprise to anyone who witnessed the same thing in the 1990s, when XML data stores were poised to take over the world. SQL won out then, as it has now, for many of the same reasons.
First, queries are mandatory for enterprise-scale systems. A few years ago, the NoSQL label was applied to a number of distributed key-value stores. The problem here is, at scale, it’s not enough to mutate data at a high rate; users want to understand how their data is changing, and what their data means in aggregate. The NoSQL systems and key-value stores that lacked the ability to run queries of one form or another have almost universally faded away.
Google says as much in its recent research. From the F1 Paper:
The system must provide full SQL query support and other functionality users expect from a SQL database. Features like indexes and ad hoc query are not just nice to have, but absolute requirements for our business.
So if you have to support queries, why SQL?
- SQL is a Standard
It’s easy to find people who know SQL. It’s easy to connect to standard tools. A multitude of resources are available to learn SQL. Bonus: your editor already has syntax highlighting.
- SQL is Declarative
With SQL, the query is written by specifying the form of the results declaratively. It is the job of the database software to understand the best way to access data, operate on it, and turn it into results. Declarative queries insulate the query-author from the underlying physical schema of the data. Compared to non-declarative processing, applications are much less fragile, and tolerate changes to the underlying schema, such as added columns or indexes, with no changes to the query itself.
- SQL Scales
“SQL doesn’t scale” was oft-cited as a key reason NoSQL exploded. Also frequently heard is, “To solve internet-scale problems, you need to abandon SQL.” Today, both Facebook and Google have publicly sung the praises of their SQL systems. Many NoSQL stores have added SQL or SQL-like query languages without crippling performance. New SQL systems such as VoltDB have shown that millions of SQL operations per second are within the reach of anyone with an Amazon Web Services (AWS) account.
- SQL is Flexible
While there are a number of SQL standards, vendors and open-source projects have liberally extended SQL. VoltDB supports UPSERT functionality, JSON extensions and other non-standard SQL our customers have requested, all while supporting all of the standard SQL operations familiar to developers.
In sum, SQL is a proven technology. It is the easiest way to write queries. It is the most familiar way to write queries. It is the most compatible way to write queries. It is the most powerful way to write queries.