Microsoft Unveils Open-Source DocumentDB, a Standalone NoSQL Database Alternative to MongoDB

Max Carter

Max Carter

January 30, 2025 · 5 min read
Microsoft Unveils Open-Source DocumentDB, a Standalone NoSQL Database Alternative to MongoDB

Microsoft has launched a standalone version of its DocumentDB, a document-oriented database that offers an open-source alternative to MongoDB. This move marks a significant development in the NoSQL database landscape, as DocumentDB is built on the popular PostgreSQL platform and provides a familiar set of MongoDB-compatible APIs.

The new DocumentDB is a result of Microsoft's recent updates to its Azure Cosmos DB, which introduced the vCore variant. This variant moves away from the multi-tenant, cross-region, transparently scalable resource unit-based Cosmos DB to an alternative architecture that behaves more like traditional Azure services. The vCore-based MongoDB APIs are the same as those used with the cloud-scale resource unit version, but the underlying technologies are quite different, requiring a complete migration of data to switch between versions.

By open-sourcing the vCore Cosmos DB engine, Microsoft is giving developers the ability to run a proven tool that has already been widely used in Azure. DocumentDB comes with a permissive MIT license and is intended to provide a standard NoSQL environment for data, reducing the complexity associated with migrating from one platform to another. The choice to work with PostgreSQL is part of this strategy, as it has long been a popular platform for developers and has recently experienced a renaissance.

DocumentDB sits on top of the existing PostgreSQL platform, which manages storage, indexing, and other key low-level operations. The result is that DocumentDB is implemented using two components: one to add support for BSON (Binary JavaScript Object Notation) data types and one to support the DocumentDB APIs, adding CRUD operations, queries, and index management. BSON is the fundamental data type used in MongoDB, and its implementation in most common languages allows for effective storage and searching of content.

The new DocumentDB offers a modern NoSQL database with a wide range of features, including basic CRUD operations, vector search tools, and indexes. By building on top of PostgreSQL, DocumentDB inherits the ability to deliver complex indexes that support various queries. This makes it an attractive option for developers looking for a flexible and scalable NoSQL database solution.

Getting started with DocumentDB is relatively straightforward, with the project hosted on GitHub and instructions available in the project wiki. Developers can use VS Code and Docker to build on top of WSL 2.0, and the DocumentDB container already holds PostgreSQL, allowing for easy experimentation with BSON support.

The GitHub wiki serves as the main source of documentation for DocumentDB, although it could benefit from more examples. For now, developers will need to build their own calls to the API, which are based on MongoDB, making porting applications relatively easy. The lack of an SDK is a temporary limitation, but it's expected to be addressed in future updates.

The reasoning behind the DocumentDB project appears to be Microsoft's ambition to deliver a standard NoSQL API and engine, similar to what has been developed for SQL. Microsoft's experience working in standards bodies and delivering extensive test suites for protocols and languages suggests that the company is committed to creating a robust and widely adopted NoSQL standard.

DocumentDB's layered approach to delivering basic functionality is a key aspect of Microsoft's strategy. The blog post announcing DocumentDB talks about "a protocol translation layer" on top of the BSON extension, bridging APIs to the document store in a way that makes it possible to have a single store that looks like MongoDB to one set of clients, Aerospike to another, or CouchDB, Couchbase, and more. This approach has the potential to make DocumentDB a reference implementation for a new NoSQL standard, allowing vendors to compete on performance and other business-essential features such as scalability and resilience.

The latest release of the open-source FerretDB NoSQL database, FerretDB 2.0, is built using DocumentDB and is reportedly seeing a considerable performance increase. This demonstrates the potential of DocumentDB to become a foundation for a NoSQL standard, enabling developers to use the APIs they're familiar with, regardless of their source.

As Microsoft continues to develop and refine DocumentDB, it's clear that this project has the potential to significantly impact the NoSQL database landscape. With community support, DocumentDB could become a widely adopted standard, providing a common API and engine for NoSQL databases and enabling seamless data portability across different platforms.

Similiar Posts

Copyright © 2024 Starfolk. All rights reserved.