MongoDB Improves Query Language
Written by Kay Ewbank   
Tuesday, 04 August 2020

MongoDB 4.4 has been released with improvements to its query language and sharding. MongoDB is a NoSQL document database that stores its documents in a JSON-like format with schema.

mongodblogo

The first group of updates is to the MongoDB Query Language (MQL), specifically to the Aggregation Pipeline with new Union and Custom Aggregation Expressions.

The new union with aggregation pipeline stage makes it possible to  blend data from multiple collections and aggregation pipelines into a single result set in the database.It provides similar functionality to SQL's UNION ALL operator, but source collections aren’t constrained by needing matching schemas, and Union aggregations can be scaled-out across collections spanning multiple shards. The new support for custom aggregation expressions means developers can define custom expressions in JavaScript and use those as part of an aggregation pipeline. In earlier versions of MongoDB, you could execute custom expressions via MapReduce, but having them available as part of an aggregation pipeline simplifies their use and supports more efficient syntax and execution.

Improvements have also been made to make scaling out more flexible and faster. You can now redefine shard keys at any time without system downtime, and compound hashed shard keys are now supported that distribute load across shards more evenly without losing data locality.

Another addition is support for hedged reads. These minimize latency by submitting read requests to multiple replicas and returning the results as soon as the quickest node responds.

New streaming replication support means messages are now continuously streamed from the primary to secondary nodes. Until this release, secondary replicas would poll the primary, receiving messages in 16MB batches. The developers say their tests have measured performance improvements of up to 50% over high load, high latency networks.

Support has also been added for simultaneous Indexing, meaning new indexes are now built concurrently on the primary and all secondaries, and are available when all eligible nodes in the replica set have successfully created the index. This reduces the chances of replication lag.

mongodblogo

More Information

MongoDB Website

Related Articles

Amazon Ditches MongoDB, Launches Rival

MongoDB 4 Released

MongoDB 4.0 Gets Multi-Doc ACID Support

MongoDB Stitch Makes App Development Easier

MongoDB 3.2 Released 

MonggoDB 3 Announced

 

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

Banner


Extend NGINX With The New JavaScript Module
28/10/2024

Inject middleware functionality into NGINX with the expressive power of Javascript. NGINX JavaScript or NJS for short is a dynamic module under which you can use scripting for hooking into the NGINX e [ ... ]



DuckDB And Hydra Partner To Get DuckDB Into PostgreSQL
11/11/2024

The offspring of that partnership is pg_duckdb, an extension that embeds the DuckDB engine into the PostgreSQL database, allowing it to handle analytical workloads.


More News

espbook

 

Comments




or email your comment to: comments@i-programmer.info

Last Updated ( Tuesday, 04 August 2020 )