{"id":6760,"date":"2019-05-26T23:50:29","date_gmt":"2019-05-27T06:50:29","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=6760"},"modified":"2025-06-13T17:32:38","modified_gmt":"2025-06-14T00:32:38","slug":"the-unreasonable-effectiveness-of-sql-in-nosql-databases","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/the-unreasonable-effectiveness-of-sql-in-nosql-databases\/","title":{"rendered":"The Unreasonable Effectiveness of SQL in NoSQL Databases"},"content":{"rendered":"<p><span style=\"font-weight: 400\">Business applications have requirements: take customer orders, deliver customer orders, track shipping, generate inventory report, end of the day\/month\/quarter business report, generate business dashboards and more. \u00a0These requirements evolve slowly. They remain even when you choose a <a href=\"https:\/\/www.couchbase.com\/resources\/why-nosql\/\">NoSQL database<\/a>.<\/span><\/p>\n<p><span style=\"font-weight: 400\">On NoSQL databases, challenges are addressed by a multitude of technologies and workarounds. Here are some of them:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Copying the data with a different key to make the scans easier.<\/span><\/li>\n<li>Fetch all of the data needed to the application and then generate reports<\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Load the data into relational databases to generate the report.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Products provide workarounds with <\/span><a href=\"https:\/\/docs.couchbase.com\/server\/4.1\/developer-guide\/views-intro.html\"><span style=\"font-weight: 400\">map-reduce views<\/span><\/a><span style=\"font-weight: 400\">, <\/span><a href=\"https:\/\/www.mongodb.com\/\"><span style=\"font-weight: 400\">APIs<\/span><\/a><span style=\"font-weight: 400\">, etc.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Finally, SQL itself has been <\/span><a href=\"https:\/\/www.couchbase.com\/blog\/unreasonable-effectiveness-of-sql\/\"><span style=\"font-weight: 400\">unreasonably effective<\/span><\/a><span style=\"font-weight: 400\"> for both structured and semi-structured data. NoSQL databases like <\/span><a href=\"https:\/\/www.couchbase.com\/\"><span style=\"font-weight: 400\">Couchbase<\/span><\/a><span style=\"font-weight: 400\">, <\/span><a href=\"https:\/\/cassandra.apache.org\/\"><span style=\"font-weight: 400\">Cassandra<\/span><\/a><span style=\"font-weight: 400\">, <\/span><a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/cosmos-db\/introduction\"><span style=\"font-weight: 400\">CosmosDB<\/span><\/a><span style=\"font-weight: 400\"> have extended SQL for JSON and wide-column data model.<\/span><\/li>\n<\/ol>\n<p>NoSQL has evolved from &#8220;NO SQL&#8221; to Not Only SQL.\u00a0 If you&#8217;re interested in some of the evolutionary background combined with a history of SQL evolution to support semi-structured data, I suggest the following interviews.<\/p>\n<ol>\n<li>Ravi Mayuram&#8217;s interview with Don Chamberlin[2017]:\u00a0 <a href=\"https:\/\/youtu.be\/-U_UjqnhMBI?t=3492\">https:\/\/youtu.be\/-U_UjqnhMBI?t=3492<\/a><\/li>\n<li>A panel discussion between Ravi Mayuram, Don Chamberlin and Prof. Mike Carey [2018]:\u00a0 <a href=\"https:\/\/www.youtube.com\/watch?v=LAlDe1w7wxc\">https:\/\/www.youtube.com\/watch?v=LAlDe1w7wxc<\/a><\/li>\n<\/ol>\n<p>A lot of NoSQL databases claim &#8220;SQL Support&#8221;. The <a href=\"https:\/\/docs.oracle.com\/database\/121\/SQLRF\/ap_standard_sql001.htm#SQLRF55514\"><span style=\"font-weight: 400\">SQL standard<\/span><\/a><span style=\"font-weight: 400\"> is wide and deep, covered in <\/span><a href=\"https:\/\/blog.ansi.org\/2018\/10\/sql-standard-iso-iec-9075-2016-ansi-x3-135\/#gref\"><span style=\"font-weight: 400\">nine voluminous books<\/span><\/a><span style=\"font-weight: 400\">. No one, neither <\/span><a href=\"https:\/\/docs.oracle.com\/database\/121\/SQLRF\/ap_standard_sql001.htm#SQLRF55514\"><span style=\"font-weight: 400\">Oracle<\/span><\/a><span style=\"font-weight: 400\"> nor <\/span><a href=\"https:\/\/www.microsoft.com\/en-us\/sql-server\/sql-server-2019\"><span style=\"font-weight: 400\">SQL Server<\/span><\/a><span style=\"font-weight: 400\">, supports everything in the standard despite decades of work. So, the NoSQL databases have a long way to go in catching up. So, a detailed evaluation of the SQL support is worth your while.\u00a0<\/span><\/p>\n<p>Here are the criteria you should use to evaluate the SQL support in NoSQL databases.<\/p>\n<ol>\n<li>Language support: What statements, data types, operations (joins, grouping, aggregation, windowing, pagination, etc)<\/li>\n<li>Indexing support:\u00a0 Indexes are key to performance, especially in the workloads for interactive applications.<\/li>\n<li>Optimizer: Query rewrite, choosing the right access path, creating the optimal query execution path is what makes SQL a successful 4GL.\u00a0 Some have a rule-based optimizer, some have a cost-based optimizer,\u00a0some others have both.\u00a0 Evaluating the quality of the optimizer is critical.\u00a0 Typical benchmarks (TPC-C, TPC-DS, YCSB, YCSB-JSON) won\u2019t help you here.<\/li>\n<li>As the saying goes: \u201d There are three things important in databases: performance, performance, and performance\u201d. It\u2019s important to measure the performance of your workload.\u00a0\u00a0<a href=\"https:\/\/github.com\/brianfrankcooper\/YCSB\">YCSB<\/a>\u00a0and the extended\u00a0<a href=\"https:\/\/dzone.com\/articles\/ycsb-json-benchmarking-json-databases-by-extending\">YCSB-JSON<\/a>\u00a0will make this evaluation easier.<\/li>\n<li>SDKs: Rich SDKs and language support speed up your development.<\/li>\n<li>\u00a0BI tool support: For large data analysis, support from BI tools usually via standard database connectivity drivers is important.<\/li>\n<\/ol>\n<p><span style=\"font-weight: 400\">In this article, I&#8217;ll compare and contrast the SQL language support in Cassandra, CosmosDB, Couchbase, and MongoDB via their respective implementations.\u00a0 To be sure, MongoDB doesn&#8217;t support SQL but have some <a href=\"https:\/\/docs.mongodb.com\/manual\/reference\/sql-comparison\/\">comparative commands<\/a>.<\/span><\/p>\n<p>I&#8217;ve divided the analysis into multiple sections.\u00a0 WordPress formatting makes these tables too big.\u00a0 Here is a PDF version that&#8217;s compact and easy to read. [Click on the image to view the PDF]<\/p>\n<div id=\"attachment_6989\" style=\"width: 310px\" class=\"wp-caption alignleft\"><a href=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2019\/05\/SQL-in-NoSQL-Databases.pdf\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-6989\" class=\"wp-image-6989 size-medium\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2019\/05\/Screen-Shot-2019-05-27-at-10.28.14-PM-300x173.png\" alt=\"\" width=\"300\" height=\"173\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/05\/Screen-Shot-2019-05-27-at-10.28.14-PM-300x173.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/05\/Screen-Shot-2019-05-27-at-10.28.14-PM-1024x589.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/05\/Screen-Shot-2019-05-27-at-10.28.14-PM-768x442.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/05\/Screen-Shot-2019-05-27-at-10.28.14-PM-1536x883.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/05\/Screen-Shot-2019-05-27-at-10.28.14-PM-2048x1178.png 2048w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/05\/Screen-Shot-2019-05-27-at-10.28.14-PM-20x12.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/05\/Screen-Shot-2019-05-27-at-10.28.14-PM-1320x759.png 1320w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-6989\" class=\"wp-caption-text\">Summary of the SQL Support in Cassandra, CosmosDB, Couchbase, and MongoDB.<\/p><\/div>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><b>SQL Support approach: \u00a0<\/b><\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400\">SQL<\/span><\/td>\n<td><span style=\"font-weight: 400\"> SQL is a declarative language, select-join-project operations serving as the foundation.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Cassandra<\/span><\/td>\n<td><span style=\"font-weight: 400\">CQL: SQL inspired language for Cassandra.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">CosmosDB<\/span><\/td>\n<td><span style=\"font-weight: 400\">Supports SQL along with MongoDB API, Gremlin (for the graph), etc. Simple select-from-where-order-by support. \u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Couchbase<\/span><\/td>\n<td><span style=\"font-weight: 400\">N1QL: SQL for JSON.\u00a0<\/span><\/p>\n<p>Couchbase has two implementations of N1QL: query service and analytics service.<\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">MongoDB<\/span><\/td>\n<td><span style=\"font-weight: 400\">Javascript based, simplified SQL command based query.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>INPUT and OUTPUT<\/strong><\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400\">SQL<\/span><\/td>\n<td><span style=\"font-weight: 400\">INPUT: Set of rows (tuples)<\/span><\/p>\n<p><span style=\"font-weight: 400\">OUTPUT: A set of rows (tuples)<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Cassandra<\/span><\/td>\n<td><span style=\"font-weight: 400\">INPUT: Sets of rows<\/span><\/p>\n<p><span style=\"font-weight: 400\">OUTPUT: Set of rows<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">CosmosDB<\/span><\/td>\n<td><span style=\"font-weight: 400\">INPUT: Sets of JSON<\/span><\/p>\n<p><span style=\"font-weight: 400\">OUTPUT: Set of JSON<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Couchbase<\/span><\/td>\n<td><span style=\"font-weight: 400\">INPUT: Sets of JSON<\/span><\/p>\n<p><span style=\"font-weight: 400\">OUTPUT: Set of JSON<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">MongoDB<\/span><\/td>\n<td><span style=\"font-weight: 400\">INPUT: Sets of JSON<\/span><\/p>\n<p><span style=\"font-weight: 400\">OUTPUT: Set of JSON<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><b>SELECT: FROM Clause<\/b><\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400\">SQL<\/span><\/td>\n<td><span style=\"font-weight: 400\">Specifies the datasource tables (relations)<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Cassandra<\/span><\/td>\n<td><span style=\"font-weight: 400\">FROM clause with only one table allowed. \u00a0Now joins, subqueries or expressions are allowed. \u00a0From clause interpretation is same as SQL.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">CosmosDB<\/span><\/td>\n<td><span style=\"font-weight: 400\">FROM clause supports a single collection and self joins (same as UNNEST in Couchbase). \u00a0\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Couchbase<\/span><\/td>\n<td><span style=\"font-weight: 400\">FROM clause with multiple keyspaces (subset of bucket), subqueries, expressions. \u00a0Same as SQL<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">MongoDB<\/span><\/td>\n<td><span style=\"font-weight: 400\">db.t1.find() for single table SELECT.<\/span><\/p>\n<p><span style=\"font-weight: 400\">db.t1.aggregate() is used as the generalized query framework. aggregate() can join with additional collections using $lookup operator.\u00a0 There can be multiple $lookup operators in the aggregation pipeline framework making it the closest cousin of the SQL FROM clause.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><b>SELECT: WHERE Clause<\/b><\/p>\n<table>\n<tbody>\n<tr>\n<td>SQL<\/td>\n<td>Criteria for selecting a row<\/td>\n<\/tr>\n<tr>\n<td>Cassandra<\/td>\n<td>Standard boolean expressions. No subqueries.<\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">CosmosDB<\/span><\/td>\n<td>Same as SQL<\/td>\n<\/tr>\n<tr>\n<td>Couchbase<\/td>\n<td>Standard boolean expressions and subqueries.<\/td>\n<\/tr>\n<tr>\n<td>MongoDB<\/td>\n<td>db.t1.find({x:10});<\/p>\n<p>aggregate() has the $match clause.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><b>SELECT: SELECT Clause<\/b><\/p>\n<table>\n<tbody>\n<tr>\n<td>SQL<\/td>\n<td>Projection clause<\/td>\n<\/tr>\n<tr>\n<td>Cassandra<\/td>\n<td>SELECT clause is same as SQL.<\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">CosmosDB<\/span><\/td>\n<td>SELECT clause is same as SQL.<\/td>\n<\/tr>\n<tr>\n<td>Couchbase<\/td>\n<td>SELECT clause is same as SQL.<\/td>\n<\/tr>\n<tr>\n<td>MongoDB<\/td>\n<td>db.t1.find({x:10}, {a:1, b:1})<\/p>\n<p>$project operator in the aggregation pipeline<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><b>SELECT: CTE &#8211; Common Table Expression<\/b><\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400\">SQL<\/span><\/td>\n<td><span style=\"font-weight: 400\">Dynamically defined data source (table, resultset)<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Cassandra<\/span><\/td>\n<td><span style=\"font-weight: 400\">Unsupported<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">CosmosDB<\/span><\/td>\n<td><span style=\"font-weight: 400\">Unsupported<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Couchbase<\/span><\/td>\n<td><span style=\"font-weight: 400\">WITH clause; same as SQL (in v6.5). Recursive CTE is unsupported<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">MongoDB<\/span><\/td>\n<td><span style=\"font-weight: 400\">Unsupported<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><b>SELECT: Subquery<\/b><\/p>\n<table>\n<tbody>\n<tr>\n<td>SQL<\/td>\n<td>Subquery: Subqueries in the FROM clause, WHERE clause, anywhere an expression is allowed.<\/td>\n<\/tr>\n<tr>\n<td>Cassandra<\/td>\n<td>Unsupported<\/td>\n<\/tr>\n<tr>\n<td>Cosmosdb<\/td>\n<td>Unsupported<\/td>\n<\/tr>\n<tr>\n<td>Couchbase<\/td>\n<td>Supports both correlated and non-correlated subqueries.<\/td>\n<\/tr>\n<tr>\n<td>MongoDB<\/td>\n<td>Unsupported in find(). Can add $match in the pipeline, but not exactly an equivalent of a subquery.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><b>SELECT: GROUP BY<\/b><\/p>\n<table>\n<tbody>\n<tr>\n<td>SQL<\/td>\n<td>Group the rows based on one or more expressions. Quite useful in reporting and aggregation for groups.<\/td>\n<\/tr>\n<tr>\n<td>Cassandra<\/td>\n<td>Supported; Same as SQL.<\/td>\n<\/tr>\n<tr>\n<td>Cosmosdb<\/td>\n<td>Unsupported. Can only do the aggregation on the whole resultset.<\/td>\n<\/tr>\n<tr>\n<td>Couchbase<\/td>\n<td>Supported; Similar as SQL.<\/td>\n<\/tr>\n<tr>\n<td>MongoDB<\/td>\n<td>$group operator in aggregate() pipeline<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><b>SELECT: HAVING clause<\/b><\/p>\n<table>\n<tbody>\n<tr>\n<td>SQL<\/td>\n<td>Filtering after the aggregation.<\/td>\n<\/tr>\n<tr>\n<td>Cassandra<\/td>\n<td>Unsupported<\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">CosmosDB<\/span><\/td>\n<td>Unsupported<\/td>\n<\/tr>\n<tr>\n<td>Couchbase<\/td>\n<td>HAVING clause; Same as SQL<\/td>\n<\/tr>\n<tr>\n<td>MongoDB<\/td>\n<td>$match after the grouping and aggregation.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><b>SELECT: ORDER BY Clause<\/b><\/p>\n<table>\n<tbody>\n<tr>\n<td>SQL<\/td>\n<td>The final order of the results produced by the query block<\/td>\n<\/tr>\n<tr>\n<td>Cassandra<\/td>\n<td>ORDER BY clause; Same as SQL.<\/td>\n<\/tr>\n<tr>\n<td>Cosmosdb<\/td>\n<td>ORDER BY clause; Same as SQL.<\/td>\n<\/tr>\n<tr>\n<td>Couchbase<\/td>\n<td>ORDER BY clause; Same as SQL.<\/td>\n<\/tr>\n<tr>\n<td>MongoDB<\/td>\n<td>db.t1.find().sort({a:1, b:-1});<\/p>\n<p>aggregate() has $sort to specify the result order.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><b>SELECT: LIMIT, OFFSET Clause<\/b><\/p>\n<table>\n<tbody>\n<tr>\n<td>SQL<\/td>\n<td>Used for pagination of the resultset<\/td>\n<\/tr>\n<tr>\n<td>Cassandra<\/td>\n<td>&#8220;LIMIT is supported.<\/p>\n<p>OFFSET is unsupported.&#8221;<\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">CosmosDB<\/span><\/td>\n<td>LIMIT (TOP) and OFFSET clause; Similar to SQL<\/td>\n<\/tr>\n<tr>\n<td>Couchbase<\/td>\n<td>LIMIT and OFFSET clause; Same as SQL<\/td>\n<\/tr>\n<tr>\n<td>MongoDB<\/td>\n<td>skip(), limit() methods with find(). $offset, $limit with aggregate().<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><b>SELECT: JOIN clause<\/b><\/p>\n<table>\n<tbody>\n<tr>\n<td>SQL<\/td>\n<td>INNER JOIN, LEFT\/RIGHT\/FULL outer joins.<\/td>\n<\/tr>\n<tr>\n<td>Cassandra<\/td>\n<td>Joins are unsupported. \u00a0Applications will have to model the data to avoid joins or do the joins in the application layer.<\/td>\n<\/tr>\n<tr>\n<td>Cosmosdb<\/td>\n<td>Only self JOINs. \u00a0No INNER\/LEFT\/RIGHT\/etc joins.<\/td>\n<\/tr>\n<tr>\n<td>Couchbase<\/td>\n<td>Supports INNER, LEFT OUTER, NEST, UNNEST and limited RIGHT outer. \u00a0Same syntax as SQL. FULL OUTER join is unsupported.<\/td>\n<\/tr>\n<tr>\n<td>MongoDB<\/td>\n<td>Limited LEFT OUTER JOIN only via $lookup operator. \u00a0No join on array elements or expressions.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><b>SELECT: Aggregation<\/b><\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400\">SQL<\/span><\/td>\n<td><span style=\"font-weight: 400\">Aggregation<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Cassandra<\/span><\/td>\n<td><span style=\"font-weight: 400\">Simple aggregation on the whole result is supported. \u00a0Aggregation with GROUP BY is unsupported.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">CosmosDB<\/span><\/td>\n<td><span style=\"font-weight: 400\">Simple aggregation on the whole result is supported. \u00a0Aggregation with GROUP BY is unsupported.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Couchbase<\/span><\/td>\n<td><span style=\"font-weight: 400\">SUM, AVG, COUNT, MAX, MIN, VARIANCE: same as SQL<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">MongoDB<\/span><\/td>\n<td><span style=\"font-weight: 400\">$sum, $count, $avg with grouping support<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><b>SELECT: aggregate functions<\/b><\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400\">SQL<\/span><\/td>\n<td><span style=\"font-weight: 400\"> Simple aggregation on the whole result is supported. \u00a0Aggregation with GROUP BY is unsupported.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Cassandra<\/span><\/td>\n<td><span style=\"font-weight: 400\">Unsupported<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Cosmosdb<\/span><\/td>\n<td><span style=\"font-weight: 400\">Unsupported<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Couchbase<\/span><\/td>\n<td><span style=\"font-weight: 400\">Supports SQL Standard window analytical functions in 6.5.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">MongoDB<\/span><\/td>\n<td><span style=\"font-weight: 400\">Unsupported<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><b>SELECT : Window (analytics\/aggregation) functions<\/b><\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400\">SQL<\/span><\/td>\n<td><span style=\"font-weight: 400\">Window functions for running totals using the OVER() clause<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Cassandra<\/span><\/td>\n<td><span style=\"font-weight: 400\">Unsupported<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">CosmosDB<\/span><\/td>\n<td><span style=\"font-weight: 400\">Unsupported<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Couchbase<\/span><\/td>\n<td><span style=\"font-weight: 400\">Supports SQL Standard window analytical functions in 6.5.<\/span><\/p>\n<p>See details: <a href=\"https:\/\/www.couchbase.com\/blog\/json-to-insights-fast-and-easy\/\">https:\/\/www.couchbase.com\/blog\/json-to-insights-fast-and-easy\/<\/a><\/p>\n<p><a href=\"https:\/\/www.couchbase.com\/blog\/get-a-bigger-picture-with-n1ql-window-functions-and-cte\/\">https:\/\/www.couchbase.com\/blog\/get-a-bigger-picture-with-n1ql-window-functions-and-cte\/<\/a><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">MongoDB<\/span><\/td>\n<td><span style=\"font-weight: 400\">Unsupported<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><b>INSERT: \u00a0Single row\/document insert.<\/b><\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400\">SQL<\/span><\/td>\n<td><span style=\"font-weight: 400\">Insert a single row<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Cassandra<\/span><\/td>\n<td><span style=\"font-weight: 400\">INSERT statement<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">CosmosDB<\/span><\/td>\n<td><span style=\"font-weight: 400\">API Insert<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Couchbase<\/span><\/td>\n<td><span style=\"font-weight: 400\">INSERT statement<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">MongoDB<\/span><\/td>\n<td><span style=\"font-weight: 400\">db.t1.save()<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><b>INSERT: \u00a0Multiple row\/document insert.<\/b><\/p>\n<table>\n<tbody>\n<tr>\n<td>SQL<\/td>\n<td>INSERT statement<\/td>\n<\/tr>\n<tr>\n<td>Cassandra<\/td>\n<td>Unsupported<\/td>\n<\/tr>\n<tr>\n<td>Cosmosdb<\/td>\n<td>Unsupported<\/td>\n<\/tr>\n<tr>\n<td>Couchbase<\/td>\n<td>INSERT with Multiple documents<\/td>\n<\/tr>\n<tr>\n<td>MongoDB<\/td>\n<td>db.t1.insert()<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><b>DELETE Statement<\/b><\/p>\n<table>\n<tbody>\n<tr>\n<td>SQL<\/td>\n<td>Delete one or more documents<\/td>\n<\/tr>\n<tr>\n<td>Cassandra<\/td>\n<td>DELETE statement; Same as SQL<\/td>\n<\/tr>\n<tr>\n<td>Cosmosdb<\/td>\n<td>API delete<\/td>\n<\/tr>\n<tr>\n<td>Couchbase<\/td>\n<td>DELETE statement; Same as SQL<\/td>\n<\/tr>\n<tr>\n<td>MongoDB<\/td>\n<td>db.t1.delete()<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><b>UPSERT statement<\/b><\/p>\n<table>\n<tbody>\n<tr>\n<td>SQL<\/td>\n<td>INSERT. \u00a0UPDATE if exists.<\/td>\n<\/tr>\n<tr>\n<td>Cassandra<\/td>\n<td>Unsupported<\/td>\n<\/tr>\n<tr>\n<td>Cosmosdb<\/td>\n<td>Unsupported<\/td>\n<\/tr>\n<tr>\n<td>Couchbase<\/td>\n<td>UPSERT statement.<\/td>\n<\/tr>\n<tr>\n<td>MongoDB<\/td>\n<td>Unsupported<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><b>UPDATE Statement<\/b><\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400\">SQL<\/span><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Cassandra<\/span><\/td>\n<td><span style=\"font-weight: 400\">UPDATE; Same as SQL<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">CosmosDB<\/span><\/td>\n<td><span style=\"font-weight: 400\">API update<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Couchbase<\/span><\/td>\n<td><span style=\"font-weight: 400\">UPDATE; Same as SQL<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">MongoDB<\/span><\/td>\n<td><span style=\"font-weight: 400\">db.t1.update()<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><b>MERGE: Merge one relation (set of rows) to another.<\/b><\/p>\n<table>\n<tbody>\n<tr>\n<td>SQL<\/td>\n<td>Merge a set of rows (documents) into another.<\/td>\n<\/tr>\n<tr>\n<td>Cassandra<\/td>\n<td>Unsupported<\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">CosmosDB<\/span><\/td>\n<td>Unsupported<\/td>\n<\/tr>\n<tr>\n<td>Couchbase<\/td>\n<td>MERGE statement, same as SQL.<\/td>\n<\/tr>\n<tr>\n<td>MongoDB<\/td>\n<td>Unsupported<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><b>PREPARE statement<\/b><\/p>\n<table>\n<tbody>\n<tr>\n<td>SQL<\/td>\n<td>Parse, analyze and create an execution plan.<\/td>\n<\/tr>\n<tr>\n<td>Cassandra<\/td>\n<td>Supported. \u00a0\u00a0I see excamples of preparedStatement() in Java SDK.dd<\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">CosmosDB<\/span><\/td>\n<td>Unsupported<\/td>\n<\/tr>\n<tr>\n<td>Couchbase<\/td>\n<td>Supported; PREPARE<\/td>\n<\/tr>\n<tr>\n<td>MongoDB<\/td>\n<td>Unsupported<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><b>EXECUTE<\/b><\/p>\n<table>\n<tbody>\n<tr>\n<td>SQL<\/td>\n<td>Execute an ad-hoc or prepared statement.<\/td>\n<\/tr>\n<tr>\n<td>Cassandra<\/td>\n<td>Supported in Java.<\/td>\n<\/tr>\n<tr>\n<td>Cosmosdb<\/td>\n<td>Unsupported<\/td>\n<\/tr>\n<tr>\n<td>Couchbase<\/td>\n<td>Supported, similar to SQL.<\/td>\n<\/tr>\n<tr>\n<td>MongoDB<\/td>\n<td>Unsupported<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><b>GRANT\/REVOKE<\/b><\/p>\n<table>\n<tbody>\n<tr>\n<td>SQL<\/td>\n<td>Grant\/REVOKE permissions for specific operation on the data set<\/td>\n<\/tr>\n<tr>\n<td>Cassandra<\/td>\n<td>GRANT, REVOKE<\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">CosmosDB<\/span><\/td>\n<td>API support<\/td>\n<\/tr>\n<tr>\n<td>Couchbase<\/td>\n<td>GRANT ROLE, REVOKE ROLE<\/td>\n<\/tr>\n<tr>\n<td>MongoDB<\/td>\n<td>TBD??<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><b>DESCRIBE statement<\/b><\/p>\n<table>\n<tbody>\n<tr>\n<td>SQL<\/td>\n<td>Describes the schema of a table<\/td>\n<\/tr>\n<tr>\n<td>Cassandra<\/td>\n<td>DESCRIBE<\/td>\n<\/tr>\n<tr>\n<td>Cosmosdb<\/td>\n<td>Unsupported<\/td>\n<\/tr>\n<tr>\n<td>Couchbase<\/td>\n<td>INFER describes the schema of the documents<\/td>\n<\/tr>\n<tr>\n<td>MongoDB<\/td>\n<td>Compass tool &#8212; graphical only.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><b>TRUNCATE statement<\/b><\/p>\n<table>\n<tbody>\n<tr>\n<td>SQL<\/td>\n<td>Truncates the data in the table without altering security or physical schema.<\/td>\n<\/tr>\n<tr>\n<td>Cassandra<\/td>\n<td>TRUNCATE<\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">CosmosDB<\/span><\/td>\n<td>Unsupported<\/td>\n<\/tr>\n<tr>\n<td>Couchbase<\/td>\n<td>FLUSH operation<\/td>\n<\/tr>\n<tr>\n<td>MongoDB<\/td>\n<td>Unsupported. \u00a0Workaround via remove collection, recreate with the same security settings.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><b>Value Logic (boolean values)<\/b><\/p>\n<table>\n<tbody>\n<tr>\n<td>SQL<\/td>\n<td>True, False, NULL (Unknown)<\/td>\n<\/tr>\n<tr>\n<td>Cassandra<\/td>\n<td>True, False, NULL (Unknown)<\/td>\n<\/tr>\n<tr>\n<td>Cosmosdb<\/td>\n<td>True, False, NULL (Unknown)<\/td>\n<\/tr>\n<tr>\n<td>Couchbase<\/td>\n<td>True, False, NULL (Unknown), Missing<\/p>\n<p><a href=\"https:\/\/docs.couchbase.com\/server\/4.0\/n1ql\/n1ql-language-reference\/booleanlogic.html\">https:\/\/docs.couchbase.com\/server\/4.0\/n1ql\/n1ql-language-reference\/booleanlogic.html<\/a><\/td>\n<\/tr>\n<tr>\n<td>MongoDB<\/td>\n<td>True, False, NULL (Unknown)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><b>Query Optimizer: Type of Optimizer<\/b><\/p>\n<table>\n<tbody>\n<tr>\n<td>SQL<\/td>\n<td>Rule-based and cost-based optimizer. \u00a0Does query rewrites, index selection, join ordering, join type selection and position of the tablers (inner\/outer, hash-table build\/probe)<\/td>\n<\/tr>\n<tr>\n<td>Cassandra<\/td>\n<td>Rule-based optimizer. \u00a0Index selection for the single table is done since there are no joins.<\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">CosmosDB<\/span><\/td>\n<td>Rule-based optimizer mainly does index selection.<\/td>\n<\/tr>\n<tr>\n<td>Couchbase<\/td>\n<td>Rule-based optimizer, index(es) selection. \u00a0Block Nested Loop join by default but supports hash join via user hint in the query.<\/td>\n<\/tr>\n<tr>\n<td>MongoDB<\/td>\n<td>\u201cShape-based\u201d optimizer according to the docs. \u00a0Each new query is matched with a query based on the \u201cshape\u201d. \u00a0The first time a query is run, the optimizer does index selection, but when there are multiple candidates, it\u2019ll run multiple queries concurrently to see who returns the results first.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><b>Query Optimizer: Index Selection<\/b><\/p>\n<table>\n<tbody>\n<tr>\n<td>SQL<\/td>\n<td>Yes<\/td>\n<\/tr>\n<tr>\n<td>Cassandra<\/td>\n<td>Yes<\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">CosmosDB<\/span><\/td>\n<td>Yes<\/td>\n<\/tr>\n<tr>\n<td>Couchbase<\/td>\n<td>Yes<\/td>\n<\/tr>\n<tr>\n<td>MongoDB<\/td>\n<td>Yes<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><b>Query Optimizer: Query Rewrite<\/b><\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400\">SQL<\/span><\/td>\n<td><span style=\"font-weight: 400\">Rewrite parts of the query to logical equivalent to better performance. E.g. Subquery rewrite, view folding, join type conversion, constant expression evaluation, etc.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Cassandra<\/span><\/td>\n<td><span style=\"font-weight: 400\">None<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Cosmosdb<\/span><\/td>\n<td><span style=\"font-weight: 400\">No known rewrites<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Couchbase<\/span><\/td>\n<td><span style=\"font-weight: 400\">Basic query rewrite. \u00a0LEFT OUTER to INNER when applicable, constant expression evaluation.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">MongoDB<\/span><\/td>\n<td><span style=\"font-weight: 400\">None<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><b>Query Optimization: JOIN Type <\/b><\/p>\n<table>\n<tbody>\n<tr>\n<td>SQL<\/td>\n<td>Choose the most efficient index, from the available join types.<\/td>\n<\/tr>\n<tr>\n<td>Cassandra<\/td>\n<td>Not applicable since joins are unsupported.<\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">CosmosDB<\/span><\/td>\n<td>Not clearly documented.<\/td>\n<\/tr>\n<tr>\n<td>Couchbase<\/td>\n<td>Nested loop by default. Hash join by user hint.<\/td>\n<\/tr>\n<tr>\n<td>MongoDB<\/td>\n<td>Just the nested loop is supported.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><b>TRANSACTION support. \u00a0<\/b><\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400\">SQL<\/span><\/td>\n<td><span style=\"font-weight: 400\">ACID support with multi-row and multi-statement support.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Cassandra<\/span><\/td>\n<td><span style=\"font-weight: 400\">No<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Cosmosdb<\/span><\/td>\n<td><span style=\"font-weight: 400\">Yes<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Couchbase<\/span><\/td>\n<td><span style=\"font-weight: 400\">No<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">MongoDB<\/span><\/td>\n<td><span style=\"font-weight: 400\">Yes, in 4.0<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><b>Indexes<\/b><\/p>\n<table>\n<tbody>\n<tr>\n<td>SQL<\/td>\n<td>Data structures maintained to speed up the query performance. \u00a0Indexes are<\/td>\n<\/tr>\n<tr>\n<td>Cassandra<\/td>\n<td>Supports primary, secondary, array-indexes. \u00a0Need to install and index the data on SOLR for a search index.<\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">CosmosDB<\/span><\/td>\n<td>Indexes everything by default: scalars, arrays. \u00a0No support for the search index.<\/td>\n<\/tr>\n<tr>\n<td>Couchbase<\/td>\n<td>Supports primary, secondary, composite, functional, adaptive, search, spatial, partitioned and replica index. \u00a0Indexes are eventually consistent.<\/td>\n<\/tr>\n<tr>\n<td>MongoDB<\/td>\n<td>Supports primary, secondary, composite, search, spatial, partitioned and replica index.\u00a0 The search index is simplistically created on a B-Tree.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><b>SQL: Datatype support.<\/b><\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400\">SQL<\/span><\/td>\n<td><span style=\"font-weight: 400\">Extensive numerical, character, date-time data type support.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Cassandra<\/span><\/td>\n<td><span style=\"font-weight: 400\">Numeric, decimal, double. Int, float, varint, Timestamp, collection (set, list) <\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">CosmosDB<\/span><\/td>\n<td><span style=\"font-weight: 400\">JSON data types: numeric, string, boolean, object, arrays<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Couchbase<\/span><\/td>\n<td><span style=\"font-weight: 400\">JSON data types: numeric, string, boolean, object, arrays<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">MongoDB<\/span><\/td>\n<td><span style=\"font-weight: 400\">JSON data types: numeric, string, boolean, object, arrays and custom extensions for the timestamp datatype.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Conclusion:<\/strong><\/p>\n<p>The popular NoSQL databases have tried to extend and support the declarative SQL for the respective data model and architectures. So, it&#8217;s important to understand the capabilities, limitations of the features and architecture during the evaluation.<\/p>\n<p><strong>References:<\/strong><\/p>\n<ol>\n<li><a href=\"https:\/\/www.couchbase.com\/blog\/unreasonable-effectiveness-of-sql\/\">The Unreasonable Effectiveness of SQL<\/a><\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Business applications have requirements: take customer orders, deliver customer orders, track shipping, generate inventory report, end of the day\/month\/quarter business report, generate business dashboards and more. \u00a0These requirements evolve slowly. They remain even when you choose a NoSQL database. On [&hellip;]<\/p>\n","protected":false},"author":55,"featured_media":6985,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1814,2294,1819,1812],"tags":[1886,2136,1261,1590,1309],"ppma_author":[8929],"class_list":["post-6760","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-application-design","category-analytics","category-data-modeling","category-n1ql-query","tag-cassandra","tag-cosmosdb","tag-json","tag-microsoft","tag-mongodb"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.0 (Yoast SEO v26.0) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>The Unreasonable Effectiveness of SQL in NoSQL Databases<\/title>\n<meta name=\"description\" content=\"Compare and contrast SQL language support in Cassandra, CosmosDB, Couchbase, and MongoDB via their respective implementations.\u00a0\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.couchbase.com\/blog\/the-unreasonable-effectiveness-of-sql-in-nosql-databases\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"The Unreasonable Effectiveness of SQL in NoSQL Databases\" \/>\n<meta property=\"og:description\" content=\"Compare and contrast SQL language support in Cassandra, CosmosDB, Couchbase, and MongoDB via their respective implementations.\u00a0\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/the-unreasonable-effectiveness-of-sql-in-nosql-databases\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2019-05-27T06:50:29+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-14T00:32:38+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/05\/Screen-Shot-2019-05-26-at-7.05.19-PM.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1244\" \/>\n\t<meta property=\"og:image:height\" content=\"1670\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Keshav Murthy\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@rkeshavmurthy\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Keshav Murthy\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/the-unreasonable-effectiveness-of-sql-in-nosql-databases\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/the-unreasonable-effectiveness-of-sql-in-nosql-databases\/\"},\"author\":{\"name\":\"Keshav Murthy\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/c261644262bf98e146372fe647682636\"},\"headline\":\"The Unreasonable Effectiveness of SQL in NoSQL Databases\",\"datePublished\":\"2019-05-27T06:50:29+00:00\",\"dateModified\":\"2025-06-14T00:32:38+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/the-unreasonable-effectiveness-of-sql-in-nosql-databases\/\"},\"wordCount\":2018,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/the-unreasonable-effectiveness-of-sql-in-nosql-databases\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/05\/Screen-Shot-2019-05-26-at-7.05.19-PM.png\",\"keywords\":[\"cassandra\",\"cosmosdb\",\"JSON\",\"Microsoft\",\"mongodb\"],\"articleSection\":[\"Application Design\",\"Couchbase Analytics\",\"Data Modeling\",\"SQL++ \/ N1QL Query\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/the-unreasonable-effectiveness-of-sql-in-nosql-databases\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/the-unreasonable-effectiveness-of-sql-in-nosql-databases\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/the-unreasonable-effectiveness-of-sql-in-nosql-databases\/\",\"name\":\"The Unreasonable Effectiveness of SQL in NoSQL Databases\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/the-unreasonable-effectiveness-of-sql-in-nosql-databases\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/the-unreasonable-effectiveness-of-sql-in-nosql-databases\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/05\/Screen-Shot-2019-05-26-at-7.05.19-PM.png\",\"datePublished\":\"2019-05-27T06:50:29+00:00\",\"dateModified\":\"2025-06-14T00:32:38+00:00\",\"description\":\"Compare and contrast SQL language support in Cassandra, CosmosDB, Couchbase, and MongoDB via their respective implementations.\u00a0\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/the-unreasonable-effectiveness-of-sql-in-nosql-databases\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/the-unreasonable-effectiveness-of-sql-in-nosql-databases\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/the-unreasonable-effectiveness-of-sql-in-nosql-databases\/#primaryimage\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/05\/Screen-Shot-2019-05-26-at-7.05.19-PM.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/05\/Screen-Shot-2019-05-26-at-7.05.19-PM.png\",\"width\":1244,\"height\":1670},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/the-unreasonable-effectiveness-of-sql-in-nosql-databases\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"The Unreasonable Effectiveness of SQL in NoSQL Databases\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"name\":\"The Couchbase Blog\",\"description\":\"Couchbase, the NoSQL Database\",\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"width\":218,\"height\":34,\"caption\":\"The Couchbase Blog\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/c261644262bf98e146372fe647682636\",\"name\":\"Keshav Murthy\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/4e51d72fc07c662aa791316deafffac4\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/af74df754db27152971d0aed2f323ead5a1f9fe5afd0209af91e12e784451224?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/af74df754db27152971d0aed2f323ead5a1f9fe5afd0209af91e12e784451224?s=96&d=mm&r=g\",\"caption\":\"Keshav Murthy\"},\"description\":\"Keshav Murthy is a Vice President at Couchbase R&amp;D. Previously, he was at MapR, IBM, Informix, Sybase, with more than 20 years of experience in database design &amp; development. He lead the SQL and NoSQL R&amp;D team at IBM Informix. He has received two President's Club awards at Couchbase, two Outstanding Technical Achievement Awards at IBM. Keshav has a bachelor's degree in Computer Science and Engineering from the University of Mysore, India, holds eleven US patents and has four US patents pending.\",\"sameAs\":[\"https:\/\/blog.planetnosql.com\/\",\"https:\/\/x.com\/rkeshavmurthy\"],\"url\":\"https:\/\/www.couchbase.com\/blog\/author\/keshav-murthy\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"The Unreasonable Effectiveness of SQL in NoSQL Databases","description":"Compare and contrast SQL language support in Cassandra, CosmosDB, Couchbase, and MongoDB via their respective implementations.\u00a0","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.couchbase.com\/blog\/the-unreasonable-effectiveness-of-sql-in-nosql-databases\/","og_locale":"en_US","og_type":"article","og_title":"The Unreasonable Effectiveness of SQL in NoSQL Databases","og_description":"Compare and contrast SQL language support in Cassandra, CosmosDB, Couchbase, and MongoDB via their respective implementations.\u00a0","og_url":"https:\/\/www.couchbase.com\/blog\/the-unreasonable-effectiveness-of-sql-in-nosql-databases\/","og_site_name":"The Couchbase Blog","article_published_time":"2019-05-27T06:50:29+00:00","article_modified_time":"2025-06-14T00:32:38+00:00","og_image":[{"width":1244,"height":1670,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/05\/Screen-Shot-2019-05-26-at-7.05.19-PM.png","type":"image\/png"}],"author":"Keshav Murthy","twitter_card":"summary_large_image","twitter_creator":"@rkeshavmurthy","twitter_misc":{"Written by":"Keshav Murthy","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/the-unreasonable-effectiveness-of-sql-in-nosql-databases\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/the-unreasonable-effectiveness-of-sql-in-nosql-databases\/"},"author":{"name":"Keshav Murthy","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/c261644262bf98e146372fe647682636"},"headline":"The Unreasonable Effectiveness of SQL in NoSQL Databases","datePublished":"2019-05-27T06:50:29+00:00","dateModified":"2025-06-14T00:32:38+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/the-unreasonable-effectiveness-of-sql-in-nosql-databases\/"},"wordCount":2018,"commentCount":1,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/the-unreasonable-effectiveness-of-sql-in-nosql-databases\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/05\/Screen-Shot-2019-05-26-at-7.05.19-PM.png","keywords":["cassandra","cosmosdb","JSON","Microsoft","mongodb"],"articleSection":["Application Design","Couchbase Analytics","Data Modeling","SQL++ \/ N1QL Query"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/the-unreasonable-effectiveness-of-sql-in-nosql-databases\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/the-unreasonable-effectiveness-of-sql-in-nosql-databases\/","url":"https:\/\/www.couchbase.com\/blog\/the-unreasonable-effectiveness-of-sql-in-nosql-databases\/","name":"The Unreasonable Effectiveness of SQL in NoSQL Databases","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/the-unreasonable-effectiveness-of-sql-in-nosql-databases\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/the-unreasonable-effectiveness-of-sql-in-nosql-databases\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/05\/Screen-Shot-2019-05-26-at-7.05.19-PM.png","datePublished":"2019-05-27T06:50:29+00:00","dateModified":"2025-06-14T00:32:38+00:00","description":"Compare and contrast SQL language support in Cassandra, CosmosDB, Couchbase, and MongoDB via their respective implementations.\u00a0","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/the-unreasonable-effectiveness-of-sql-in-nosql-databases\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/the-unreasonable-effectiveness-of-sql-in-nosql-databases\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/the-unreasonable-effectiveness-of-sql-in-nosql-databases\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/05\/Screen-Shot-2019-05-26-at-7.05.19-PM.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/05\/Screen-Shot-2019-05-26-at-7.05.19-PM.png","width":1244,"height":1670},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/the-unreasonable-effectiveness-of-sql-in-nosql-databases\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"The Unreasonable Effectiveness of SQL in NoSQL Databases"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/blog\/#website","url":"https:\/\/www.couchbase.com\/blog\/","name":"The Couchbase Blog","description":"Couchbase, the NoSQL Database","publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"The Couchbase Blog","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","width":218,"height":34,"caption":"The Couchbase Blog"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/c261644262bf98e146372fe647682636","name":"Keshav Murthy","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/4e51d72fc07c662aa791316deafffac4","url":"https:\/\/secure.gravatar.com\/avatar\/af74df754db27152971d0aed2f323ead5a1f9fe5afd0209af91e12e784451224?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/af74df754db27152971d0aed2f323ead5a1f9fe5afd0209af91e12e784451224?s=96&d=mm&r=g","caption":"Keshav Murthy"},"description":"Keshav Murthy is a Vice President at Couchbase R&amp;D. Previously, he was at MapR, IBM, Informix, Sybase, with more than 20 years of experience in database design &amp; development. He lead the SQL and NoSQL R&amp;D team at IBM Informix. He has received two President's Club awards at Couchbase, two Outstanding Technical Achievement Awards at IBM. Keshav has a bachelor's degree in Computer Science and Engineering from the University of Mysore, India, holds eleven US patents and has four US patents pending.","sameAs":["https:\/\/blog.planetnosql.com\/","https:\/\/x.com\/rkeshavmurthy"],"url":"https:\/\/www.couchbase.com\/blog\/author\/keshav-murthy\/"}]}},"authors":[{"term_id":8929,"user_id":55,"is_guest":0,"slug":"keshav-murthy","display_name":"Keshav Murthy","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/af74df754db27152971d0aed2f323ead5a1f9fe5afd0209af91e12e784451224?s=96&d=mm&r=g","author_category":"","last_name":"Murthy","first_name":"Keshav","job_title":"","user_url":"https:\/\/blog.planetnosql.com\/","description":"Keshav Murthy is a Vice President at Couchbase R&amp;D. Previously, he was at MapR, IBM, Informix, Sybase, with more than 20 years of experience in database design &amp; development. He lead the SQL and NoSQL R&amp;D team at IBM Informix. He has received two President's Club awards at Couchbase, two Outstanding Technical Achievement Awards at IBM. Keshav has a bachelor's degree in Computer Science and Engineering from the University of Mysore, India,  holds ten US patents and has three US patents pending."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/6760","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/users\/55"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/comments?post=6760"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/6760\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media\/6985"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media?parent=6760"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/categories?post=6760"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/tags?post=6760"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=6760"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}