Newsletters




SQL Survives and Thrives in the Post-NoSQL Era


The SQL language served as a universal language for data­base manipulation from the mid-1980s until NoSQL data­bases started gaining strength about 12 years ago. However, after a short period in the wilderness, SQL is back and possibly more vital than ever.

SQL’s Evolution

SQL emerged from the relational model defined by Edgar Codd back in 1970, though SQL itself was not a part of that model. Codd argued for a “database sublanguage” to navigate and mod­ify relational data, though his proposed language, “Alpha,” never took off. However, Alpha influ­enced the QUEL language used by the creators of Ingres—an early relational database system developed at the University of California, which influenced the open source Post­greSQL database.

Meanwhile, researchers at IBM were developing System R, a pro­totype DBMS based on Codd’s relational model. They created the SEQUEL language as the data sublanguage for the project. SEQUEL eventually was renamed SQL and was rapidly adopted by commer­cial databases such as Oracle and IBM’s Db2. By the end of the 1970s, SQL had won out over QUEL as the relational query language and became an ANSI (American National Standards Institute) standard language in 1986.

The relative ease of use that SQL provided expanded the audi­ence of database users dramatically. You no longer needed to be a highly experienced database programmer to retrieve data from a database; SQL could be taught to casual users of databases, such as analysts and statisticians. It’s fair to say that SQL brought data­bases within reach of business users.

However, when the “NoSQL” database movement emerged in the late-2010s, SQL became associated with yesterday’s data­bases. New databases, such as MongoDB and Cassandra, pro­vided only token support for SQL, and developers, in general, seemed to prefer non-SQL programming models.

Combined Strengths

But, the power and ubiquity of SQL were not easy to dismiss, and, increasingly, NoSQL databases came under pressure to add significant SQL support. Fur­thermore, new database systems emerged that com­bined the strengths of SQL and the relational model with the best ideas from NoSQL.

For instance, Snowflake provides rich SQL sup­port with the ability to process unstructured data, which previ­ously had been a sweet spot for Hadoop. CockroachDB combines the power of SQL and strong consistency with the elastic scalabil­ity that is often associated with NoSQL databases such as Cassan­dra and DynamoDB.

New Alternatives

However, even though SQL is here to stay, a few alternatives are lurking in the wings. Graph query languages, such as Gremlin and Cypher, offer a more productive language for issuing queries against graph structures. SQL is notoriously unwieldy for these sorts of queries and, despite attempts to add graph operators, probably will never be a match for these graph-specific languages.

Pipelined Relational Query Language (PRQL, pronounced “Prequel”) is an interesting variation on a SQL-equivalent lan­guage. Similar to Hadoop’s PIG language, it represents operations as a pipeline of transformations. This can result in less repetition and improved readability. It also gives the programmer more con­trol over the sequence of execution.

GraphQL is more of a means for implementing API endpoints and, as such, competes more naturally with REST than with SQL. But it does allow programmers to construct queries against back-end data sources, typically for manipulating JSON structures. It represents an alternative to SQL when creating APIs that offer query services.

Stronger Than Ever

SQL is one of the most long-lived programming languages and, by almost any measure, immensely successful. Having sur­vived a recent assassination attempt, SQL has emerged stronger than ever.


Sponsors