As NoSQL adoption grows, developers and enterprises alike require a general purpose database to replatform their mission-critical applications and services. These databases are no longer used only by backend services that need sub-second access to the data, but also by enterprise applications with query requirements subject to complex business rules.
MongoDB™, an early entrant in the NoSQL database space, provides a procedural method to query data. While their approach is effective for targeted queries (i.e., to find documents with specific filter conditions), it can become complex for queries that require document joins and aggregations. To enable such queries, MongoDB provides an elaborate aggregation framework that supports more advanced requirements. The challenge with this approach is that it requires a specific procedural programming knowledge that is better suited to the developer community than it is to other data consumer roles, such as data analysts and data scientists.
Here are some of the inhibitive characteristics of the MongoDB query framework:
- Proprietary – MongoDB’s query method and aggregation framework use a proprietary construct that requires users to learn a new language.
- Complex – While the MongoDB query method is relatively straightforward for a simple query to find a specific document, the aggregation framework is quite complex.
- Limited expressive power – MongoDB has limited support for JOINs and for joining sharded collections. See this blog comparing JOIN support in Couchbase and MongoDB.
- Limited query optimization – Because the aggregation pipeline is procedural and lacks expressive power, applications need to compensate by doing complex data processing on the client side. This results is complexity and poor performance.
Couchbase came to the NoSQL market a few years after MongoDB and took a different approach. Couchbase adopts a more open standard of SQL and extends the SQL language to support its JSON database. Couchbase’s SQL-based language for JSON (N1QL), brings the expressive power of SQL to the Couchbase Data Platform. It has support for ANSI join constructs, as well as advanced query optimization and indexing capabilities that scale to support the performance requirements of today’s critical business applications.
Download this whitepaper to learn more about Couchbase N1QL and its lightning-fast performance.