2

For decades, SQL (Structured Query Language) has dominated the field of data query languages and has become almost "synonymous" for databases, and anyone who wants to retrieve information from a database must learn SQL. But as times change, SQL's dominance of data retrieval is waning.

It's no secret that the rest of the world uses lowercase letters, but SQL users are still typing words like SELECT or WHERE, which is a "regression" in itself. Because of this, there are now a number of new databases in completely new languages on the market.

Recently, InfoWorld selected 8 data query languages "beyond" SQL, which not only provide more elegance, simplicity and flexibility for modern use cases, some are even better to use, let's take a look!

GraphQL

The name GraphQL can be a bit confusing at first, as it's not a language that exploits all the possibilities in a graph database, but more like an elegant shorthand for querying data stored in a nested JSON-like format.

The GraphQL data query language is just a quick description of the resulting query, looking through the backend for that list of fields that might have constraints on values, and trying to find a matching result. SQL generally specifies how the database should complete the request, whereas GraphQL users only need to provide a list of fields.

Especially for some JSON databases, the GraphQL language is a natural matching language, and GraphQL is also becoming more and more popular when searching relational databases using tabular schemas. Smart backends can convert nested requests into schema-compliant connection schemas .

Originally built by Facebook, GraphQL is a query language for APIs that allows developers to choose the type of requests they want to make and receive the required information in a single request. After being released as a separate open source project, developers started working on the GraphQL backend.

PRQL

PRQL is an acronym for Pipelined Relational Query Language (pronounced "Prequel"). Queries in this language are structured as a series of small commands that produce results using only the required data.

Similar to many modern programming languages, the thinking model of PRQL queries adopts a functional approach, and simple features such as variables can reduce repetition and simplify the process. The result of one line feeds into the next line in a long chain, if you want to remove a step you usually just comment out this line and the rest of the pipeline will still work.

The code for PRQL is written in Rust as a transport tool for converting PRQL to SQL, so the basic structure is extensible, and this simple experimentation ensures rapid development of the language.

WebAssembly

Many developers see WebAssembly (abbreviated Wasm) as a tool for creating fast applications that run in a web browser, and when Redpanda started building a dataflow tool to replace Kafka, they wanted to add a mechanism that not only Data can be passed around and occasionally transformed in the process, and WebAssembly is the way to go.

Of course, WebAssembly is even more powerful and lower-level than stored procedures in some databases. Not all developers want to write byte-level code. But this option opens the flow of data, enabling complex transformations far beyond what SQL can achieve.

GQL

Graph Query Language (GQL) is a proposed standard that combines declarative programming languages like Cypher, PGQL, and GSQL.

Developers create queries by specifying a specific model for a set of nodes, and the database is then responsible for finding matches. GQL uses a more complex property graph that allows pairs of nodes to share multiple distinct connections.

Gremlin

Gremlin, one of the original languages for searching graphs, requires a set of steps to be performed to search for connections between nodes, hence what some call a "path-based" or "graph traversal" language.

Every query in the Gremlin language is built based on steps, and each step may involve mapping the current node, filtering the list, or tabulating the results in some way.

The Gremlin language is often just a starting point, such as when extending Gremlin to embed a Python interpreter in it so that queries can contain Python code. Others have embedded Gremlin in standard programming languages such as Java to exploit the power of Gremlin from the language.

Originally built for Apache's TinkerPop project, Gremlin has been adopted by major transactional distributed graph databases such as Amazon's Neptune and graph processing frameworks using Apache Spark or Hadoop.

N1QL

N1QL (pronounced "nickel") is designed to make it easier for SQL native users to work with JSON objects that might be stored in Couchbase. Like SQL, the basic query has several parts specified by the keywords SELECT, FROM, and WHERE, and the details of specifying the path to the data structure from which the data will come will be adjusted and adjusted according to the nested world of JSON objects.

For years, database software company Couchbase has been searching for the best way to query general documents. In the beginning, the query is written as a JavaScript function and then handed off to the database for execution. Although this is a good, general solution, it sometimes takes a long time to generate results, so the developers created N1QL.

To encourage experimentation, N1QL provides a query workbench with a visual interface for testing and optimizing queries. In addition, Couchbase provides a general-purpose full-text search option that runs independently for queries that search text terms rather than structured data.

Malloy

The creators of Malloy have said that the problem with SQL is the syntax details - expressing even the simplest queries takes time because the language is verbose and full of hidden performance pitfalls. So they created a modern programming language with natural defaults and simpler syntax - Malloy, that compiles to SQL so no one needs to revamp the stock database.

The result is a more powerful GraphQL-like syntax, with queries more like a model or vision of the result, including any restrictions, matches, or defaults. Malloy handles some optimizations in the background, such as automatically generating smarter joins to avoid some performance hitches; subqueries can aggregate to save time, and indexes can be added as needed. So writing a query is more like writing modern code, where punctuation keeps the structure clean.

Malloy's open source core is built in TypeScript for code included in Node.js, and VS Code plugins simplify development.

Basis

Most query languages are tied directly to a specific database, and Basis is building more pipelines that can extract data from various sources before filtering with a mix of SQL and Python, before delivering the data to various standard options Do output, from running code to AI algorithms to charts and dashboards.

Basis is just one example of newer data pipeline tools that are opening up query processes, pulling data from multiple sources, filtering in multiple languages, and delivering data in multiple forms.

Overview

The emergence of the above 8 new data query languages does not mean that SQL is becoming less popular. If anything, more SQL is being written than ever before, and the world of data storage is evolving at a faster rate, and these developments and growth are spurring more new experiments and new extensions.

Of course, not all of these new types of languages are better than SQL, not all of them are what developers are looking for, but they all present a new opportunity to think differently Massive bytes on some servers, expect you to find a new way to articulate what you need, no?


MissD
955 声望41 粉丝