BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Microsoft Announces a Public Preview of the MongoDB Aggregation Feature in Azure Cosmos DB

Microsoft Announces a Public Preview of the MongoDB Aggregation Feature in Azure Cosmos DB

Leia em Português

This item in japanese

Last November Microsoft announced more capabilities for the support of MongoDB in Azure Cosmos DB. With the deployment of the latest version of the Cosmos DB service, Microsoft included a preview of MongoDB aggregation pipeline support, enabling developers to create more sophisticated queries and manipulate data by combining multiple aggregation ‘stages.’ 

Microsoft’s Azure Cosmos DB is a globally distributed multi-model, multi-API database service. The multi-model support includes Graph, column family, key-value, and document. With the multi-model support comes the support for multiple types of APIs to enable access, including the MongoDB API, which means a Mongo application can talk natively to Cosmos DB. Furthermore, various native MongoDB features are built into the MongoDB API for Cosmos DB.

Mongo developed the aggregation pipeline, an alternative to map-reduce, as it is a more lightweight and more natural programming model. This feature is one of the many features Microsoft brings into the Cosmos DB service to drive customers to migrate from native MongoDB. Moreover, the Cosmos DB engineering team has built the native MongoDB features customers are demanding directly into Cosmos DB. Azure Cosmos DB does not fully support all the native MongoDB features yet, althogh it is geared towards this. In the Channel 9 Azure Friday episode on What’s New in Azure Cosmos DB’s API for MongoDB, Emily Lawton of the Cosmos DB engineering team told of Scott Hanselman:

We worked on some new features for the last couple of months and weeks, that will enable Mongo customers to migrate much more complex and powerful applications to Cosmos. And we have, with these updates much more confidently say we do support all of the most sought-after Mongo features and are fully invested in really making sure that we have any developers coming over from Mongo, that we are there to support them with the proper tools and resources to succeed in Cosmos.

With a MongoDB aggregation pipeline, more data processing ends up at the server side before results arrive at the client. The significant benefit of this feature is that less data transfer over the wire, and calling clients can receive more manageable sizes of data. A typical aggregation pipeline can find records in a MongoDB instance, perform match and group with expressions and counts in a single query.


Image source: https://azure.microsoft.com/en-us/blog/azure-cosmosdb-extends-support-for-mongodb-aggregation-pipeline-unique-indexes-and-more/

The MongoDB aggregation pipeline is built by using an aggregate command aggregate, count, or distinct followed one or more aggregation stages, where expressions, accumulators, and operators can be used. For more details, please consult the documentation on the Microsoft Website.

The open source MongoDB client drivers allow developers to communicate with the MongoDB API in Cosmos DB. The support for aggregation pipeline feature is now in public preview and developers can enable this feature on the Preview Features page of any MongoDB API account in the Azure portal.

Rate this Article

Adoption
Style

BT