Microsoft Unveils DocumentDB, an Open-Source NoSQL Database Compatible with MongoDB
What is DocumentDB?
Microsoft has quietly unveiled DocumentDB, an open-source NoSQL database designed to be compatible with MongoDB. The project makes public the PostgreSQL-based technology behind the vCore-based Azure Cosmos DB for MongoDB. Microsoft hopes to make PostgreSQL an ANSI standard for NoSQL databases.
How Does DocumentDB Work?
DocumentDB is a document-oriented database that allows users to store data in Binary Object Notation (BSON), a JSON-like data structure also used by MongoDB. DocumentDB is built atop PostgreSQL and utilizes two PostgreSQL extensions developed by Microsoft to enable its BSON functionality.
PostgreSQL Extensions
The first PostgreSQL extension is pg_documentdb_core
, which optimizes for BSON. This library gives users the ability to parse and manipulate BSON documents in the PostgreSQL layer of the database engine; index fields in the BSON document; perform vector search queries; and implement a full authentication mechanism.
The second PostgreSQL extension is pg_documentdb_api
, which implements create, read, update, and delete (CRUD) operations, query functionality, and index management. The CRUD operations are said to be MongoDB compatible.
Availability and Licensing
DocumentDB is available on Microsoft’s GitHub code repository, distributed under the permissive MIT License, which allows for reuse with proprietary software.
Goal of DocumentDB
The goal of DocumentDB is to provide a standard for interoperability, according to Abinav Rameesh, the project management lead on Azure Cosmos DB. "The mission for DocumentDB is to provide the developer community with a NoSQL datastore, implemented using PostgreSQL with complete visibility into the architecture and implementation of the engine," Rameesh wrote.
Microsoft’s Ambitious Mission
Microsoft hopes to create a standard for open-source document databases, much like the ANSI SQL standard for relational databases. This would heighten the compatibility and interoperability of NoSQL engines in the future.
Azure Cosmos DB
Azure Cosmos DB is a non-relational database service from Microsoft that supports a variety of NoSQL data types and workloads, including a document store, a wide column store, a key-value store, and a graph store. While the API used in Azure Cosmos DB for MongoDB is MongoDB compatible, the underlying technology used in the "vCore" version of Azure Cosmos DB for MongoDB leverages a distributed database engine based on PostgreSQL, which gives it the scalability and performance of a traditional PostgreSQL setup.
Limitations of Azure Cosmos DB for MongoDB
As of October 2023, Azure Cosmos DB for MongoDB was about 32% compatible with the MongoDB API, according to MongoDB. "Azure Cosmos DB for MongoDB implements MongoDB’s Wire Protocol to allow MongoDB drivers to connect and interact with Cosmos DB as though it were a MongoDB host," MongoDB wrote. "However, this implementation has limitations…"
FAQs
Q: What is DocumentDB?
A: DocumentDB is an open-source NoSQL database designed to be compatible with MongoDB.
Q: How does DocumentDB work?
A: DocumentDB is built atop PostgreSQL and utilizes two PostgreSQL extensions to enable its BSON functionality.
Q: What is the goal of DocumentDB?
A: The goal of DocumentDB is to provide a standard for interoperability, making PostgreSQL an ANSI standard for NoSQL databases.
Q: Is DocumentDB available?
A: Yes, DocumentDB is available on Microsoft’s GitHub code repository, distributed under the permissive MIT License.