카우치베이스 서버

Couchbase 6.5의 MongoDB MQL과 N1QL 기능 비교

이 글은 릴리즈 블로그에서 강조된 MongoDB MQL 언어 기능을 간략하게 검토한 글입니다: MongoDB 4.4: 사용자 중심 엔지니어링. 준비 완료. MongoDB 4.4 릴리스에는 MQL 언어에 대한 여러 가지 기능이 추가되었습니다. 카우치베이스 6.5 출시 쿼리 서비스 및 분석 서비스 모두에서 N1QL의 상당수 기능을 올해 초에 발표했습니다. 자세히 살펴보겠습니다.

MongoDB 4.4 Couchbase 6.5
출시 GA: 2020년 7월 GA: 2020년 1월
새로운 기능은 무엇인가요? https://www.mongodb.com/collateral/mongodb-4.4-guide https://docs.couchbase.com/server/current/introduction/whats-new.html
유니온 세트 작업 Introduces $UnionWith aggregation pipeline stage to bend data into a single
result set. Roughly equivalent to UNION ALL set operation in SQL.
https://docs.mongodb.com/master/reference/operator/aggregation/unionWith/#pipe._S_unionWith
Supports all SQL set operations since the initial release: UNION, UNION ALL,
EXCEPT, EXCEPT ALL, INTERSECT, INTERSECT ALL. The ALL modifier returns duplicate
documents. Using the operation without ALL avoids the sort stage required in
the MQL aggregation pipeline. These set operations can be used anywhere a
SELECT query is used (subqueries, derived tables, etc).
https://docs.couchbase.com/server/current/n1ql/n1ql-language-reference/union.html
https://blog.jooq.org/2015/10/06/you-probably-dont-use-sql-intersect-or-except-often-enough/
사용자 지정 집계 표현식 Introduces $function, allowing JavaScript snippets inside the aggregation
pipeline to customize processing. User-defined aggregations can be created
using $accumulate, $function, $merge, and $group. This approach is verbose
and must be rewritten for every query. In SQL, once a user-defined aggregate
is created, it can be reused like any other aggregate.
Other improvements include simple scalar functions.
https://docs.mongodb.com/master/release-notes/4.4/#custom-aggregation-expressions
Preview release of SQL functions and JavaScript functions usable anywhere
expressions are allowed in N1QL. These can be part of complex queries and are
expected to be GA in the next major release.
MongoDB still lacks window functions, which were released in Couchbase 6.5
and significantly improve developer productivity.
Couchbase supports JavaScript-based aggregation via map-reduce views, though
they are not accessible through N1QL.
Couchbase Eventing functions are also written in JavaScript and provide a
scalable infrastructure for modern applications.
검색 Introduces full-text $search based on Lucene, available only in MongoDB Atlas.
MongoDB itself has limited search functionality and is not Lucene-based.
$search can only be used as the first stage of an aggregation pipeline and
cannot be used in updates or deletes.
Couchbase 6.5 introduced the SEARCH() function and related metadata functions.
It supports simple string search to full-text search with deep integration
into the N1QL optimizer.
거래 Introduces the ability to create collections and indexes within a
non-sharded transaction. Using DDLs inside transactions is still rare.
Released distributed transactions for Java SDKs, allowing applications
to operate on multiple documents using get/set APIs. Distributed
transactions are not supported for N1QL statements.

리소스:

  1. 카우치베이스 문서
  2. N1QL 튜토리얼
  3. MongoDB 문서
이 문서 공유하기
받은 편지함에서 카우치베이스 블로그 업데이트 받기
이 필드는 필수 입력 사항입니다.

Author

Posted by 케샤브 머시

Keshav Murthy is a Vice President at Couchbase R&D. Previously, he was at MapR, IBM, Informix, Sybase, with more than 20 years of experience in database design & development. He lead the SQL and NoSQL R&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, and has received twenty four US patents.

댓글 남기기

카우치베이스 카펠라를 시작할 준비가 되셨나요?

구축 시작

개발자 포털에서 NoSQL을 살펴보고, 리소스를 찾아보고, 튜토리얼을 시작하세요.

카펠라 무료 사용

클릭 몇 번으로 Couchbase를 직접 체험해 보세요. Capella DBaaS는 가장 쉽고 빠르게 시작할 수 있는 방법입니다.

연락하기

카우치베이스 제품에 대해 자세히 알고 싶으신가요? 저희가 도와드리겠습니다.