Couchbase is rolling out a new SQL query language that gives developers the ability to combine JSON data modeling with declarative SQL queries for NoSQL data.
The NoSQL database platform provider announced a beta of the N1QL language as part of Couchbase Server 4.0. According to Couchbase CEO Bob Wiederhold, N1QL is a NoSQL query language based on SQL used to query JSON-based document databases. N1QL also enables developers to integrate Couchbase data with third-party business intelligence and reporting tools.
“The N1QL query language allows us to expand the use cases we can support for Web, mobile and IoT applications,” said Couchbase CEO Bob Wiederhold. “N1QL makes it easier to access and manipulate the data stored in Couchbase with ad hoc and complex queries for developers to build those kinds of capabilities into their applications.”
(Related: MongoDB creates BI connector, new tool to create rules, validations)
Wiederhold explained that the NoSQL movement was designed to get away from relational databases, not from SQL. N1QL is intended to act as a SQL-based language for the NoSQL space much the same as players in the Hadoop space leverage SQL queries, he said.
Couchbase also developed the language in collaboration with the University of California, San Diego’s (UCSD) computer science department, aligning the language to UCSD’s SQL++ query language specification. SQL++ is a formally defined SQL backward-compatible declarative language for semi-structured data.
N1QL is the first query language aligned with the academic standard, according to Wiederholder.
N1QL’s developer features and road map
Aside from the query language’s JSON data capabilities, Wiederholder drew attention to N1QL features developers should pay attention to as they build applications within frameworks.
“Couchbase will be plugged into a developer’s framework, and they’ll experience this rich ability to be able to query the database, combine and manipulate data,” he said. “You’ll be able to do joins, to nest and un-nest information in the documents to build much richer applications much more quickly.”
- Joins: A relational database capability designed for document databases to combine the information in two separate NoSQL documents.
- Nest/un-nest capabilities: JSON documents contain what Wiederholder explained were nested constructs for more dynamic data than in relational databases. N1QL allows developers to reverse the nesting constructs to avoid the process of flattening all the data in a document.
- Multi-dimensional scaling: A high-performance index building capability used in tandem with N1QL for building high-performance enterprise applications.
- Third-party integrations: Couchbase is announcing reporting, business intelligence and tool integrations with companies like Databricks, Informatica, Looker, Metanautix, Simba Technologies and Tableau. Developers will have access to APIs, ODBC and JDBC drivers to integrate these services.
N1QL has been in development for about two and a half years, according to Wiederholder. As Couchbase is an open-source company, the full N1QL implementation is available as open source for developers. He said he hopes the language will greatly expand the Couchbase ecosystem.
“This is a full implementation of SQL,” said Wiederholder. “It’s not like we picked 60% of the capabilities and implemented them. We’ve built a language that has a mathematical basis; it has an algebra that can describe the grammar of the language.”
The N1QL beta is available today with the release of Couchbase Server 4.0, and the SQL-based query language will be generally available later this summer.