After a year of development, the release of the document-oriented DBMS MongoDB 6.0 has been presented, which occupies a niche between fast and scalable systems that operate with key/value formatted data and relational DBMS that are functional and convenient for query formation. MongoDB is coded in C++ and is distributed under the SSPL license, which is based on the AGPLv3 license but is not open, as it contains a discriminatory requirement to provide not only the application's source code but also the source texts of all components involved in providing the cloud service under the SSPL license.
MongoDB supports storing documents in a JSON-like format, has a sufficiently flexible language for forming queries, can create indexes for various stored attributes, efficiently handles large binary objects, supports logging of operations for modifying and adding data to the DB, can work according to the Map/Reduce paradigm, supports replication, and facilitates the creation of fault-tolerant configurations.
MongoDB has built-in tools for segmenting (distributing a dataset across servers based on a specific key), which, combined with replication, allow the creation of a horizontally scalable storage cluster that does not have a single point of failure (a failure of any node does not affect the operation of the DB), supports automatic recovery after a failure, and load balancing from a failed node. Expanding the cluster or transforming one server into a cluster is performed without stopping the DB operation by simply adding new machines.
Key features of the new release:
- The ability to execute queries covering data stored in encrypted form (Queryable Encryption) has been implemented. Data is decrypted on the client side and remains encrypted during query processing (the query is executed on encrypted data without prior decryption). Currently, only comparison expressions are allowed in queries, but support for checking ranges, prefixes, suffixes, substrings, and other operations is planned for future versions.
- The capabilities related to storing data in the form of time series collections have been expanded. These are optimized for storing slices of parameter values recorded at specific intervals (time and a set of corresponding values for that time). For instance, the need to store such data arises in monitoring systems, financial platforms, and sensor status polling systems. The new release provides the ability to use secondary and compound indexes with time series data collections. Support for attaching additional data, such as geographical information to account for distance and location, has been added. Reading performance, query execution, and sorting have been improved.
- New tools for tracking changes (Change Streams API) have been added, allowing applications to be notified of data changes in the database. Change information is received in real time, enabling the creation of applications using reactive and event-driven programming methods. Events are processed using the watch method, and necessary events can be filtered and aggregated using operators like $match, $project, and $redact. The new version offers the ability to retrieve the previous and subsequent state of a document (for example, when a document is deleted or modified). In addition to operations using the data manipulation language (DML), support for data definition language (DDL) operations, such as creating and deleting indexes and collections, has been provided. Tools for filtering associated notifications have been added.
- Full support for sharded storage has been implemented in the $lookup and $graphLookup operators. The performance of the $lookup operation has been optimized. For example, when there is an index on the foreign key, matching a small number of documents now occurs 5-10 times faster, and for a large number it is twice as fast. For matches without using indexes, performance gains can reach up to 100 times.
- The ability to execute complex analytical queries on consistent snapshots of operational data has been introduced. Such analytical queries can cover multiple segments in large distributed MongoDB configurations.
- New operators $maxN, $minN, and $lastN have been added to determine values in a dataset, along with the $sortArray operator for sorting array elements.
- Segmentation efficiency has been significantly increased. The default block size for segmented collections has been raised to 128 MB. The configureCollectionBalancing command has been added to defragment segmented collections.
- The client-side field-level encryption (CSFLE) tool has added support for KMIP-compliant key providers.
- The capability to compress and encrypt the audit log, which reflects user activity in the database management system, has been introduced.
- An experimental mode for data synchronization between MongoDB clusters (Cluster-to-Cluster Sync) has been implemented.
Source: opennet.ru
