Microsoft's new DocumentDB rethinks NoSQL on PostgreSQL

amai1 pts0 comments

Microsoft’s new DocumentDB rethinks NoSQL on PostgreSQL | InfoWorld

Search

Menu

Topics

Close

Analytics<br>Artificial Intelligence<br>Careers<br>Cloud Computing<br>Data Management<br>Databases<br>Development Tools<br>Devops<br>Emerging Technology<br>Enterprise Buyer’s Guides<br>Generative AI<br>IT Leadership<br>Java<br>JavaScript<br>Microsoft .NET<br>Open Source<br>Programming Languages<br>Python<br>Security<br>Software Development<br>Technology Industry

by Simon Bisson

Contributing Writer

Microsoft’s new DocumentDB rethinks NoSQL on PostgreSQL

analysis

Jan 30, 20258 mins

Standalone document-oriented database gives developers an open-source alternative to MongoDB now and perhaps an industry standard NoSQL API and engine later.

Credit: Stokkete/Shutterstock

Microsoft&rsquo;s recent launch of a standalone version of the MongoDB compatibility layer for its global-scale Azure Cosmos DB brought back an old name. Back in 2018, when the company unveiled a public version of the Project Florence database engine that powers much of Azure, they called it DocumentDB. That original name worked well for some of the database&rsquo;s personalities, but its support for much more than JSON documents soon led to a new, now more familiar name. Cosmos DB has continued to evolve, with its document database capabilities offering a familiar set of MongoDB-compatible APIs.

A recent set of updates introduced the vCore variant of Azure Cosmos DB, which moves from the multi-tenant, cross-region, transparently scalable resource unit-based Cosmos DB to an alternative architecture that behaves more like traditional Azure services, with defined host virtual machines and a more predictable pricing model. 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, and moving from one version to the other requires a complete migration of your data.

Last week Microsoft revealed the differences in the two implementations when it unveiled an open-source release of the vCore Cosmos DB engine. Built on the familiar PostgreSQL platform, the new public project adds NoSQL features with the MongoDB APIs. As it focuses purely on storing JSON content, Microsoft decided to bring back the original DocumentDB name.

The new DocumentDB comes with a permissive MIT license and is intended to provide a standard NoSQL environment for your data to reduce the complexity associated with migrating from one platform to another. Choosing to work with PostgreSQL is part of that, as it has long been a popular platform for developers, one that&rsquo;s had something of a recent renaissance.

A modern NoSQL database with PostgreSQL roots

By open sourcing a tool that&rsquo;s already widely used in Azure, Microsoft is giving developers the ability to run something that&rsquo;s already proven to work well. Most of the features we expect to find in a modern NoSQL store are already there, from basic CRUD (create, read, update, delete) operations to more complex vector search tools and the indexes needed to support them. This ensures you will be able to build on and extend a database that can support most scenarios.

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 but with implementations in most common languages. If you&rsquo;re going to build a common NoSQL store based on MongoDB APIs, then BSON will be the way you represent your standard NoSQL data structures, such as key-value pairs and arrays. It&rsquo;s easy to build JSON documents, but using BSON allows you to store and search content more effectively.

You can think of DocumentDB as a stack. At the bottom is PostgreSQL itself, then the DocumentDB extension that gives the database the ability to work with BSON data. Once installed it lets you parse BSON data and then use the PostgreSQL engine to build indexes, not only using the database engine&rsquo;s standard tools but also other extensions. The result is the ability to deliver complex indexes that support all kinds of queries.

One useful feature is the ability to use PostgreSQL&rsquo;s vector index capabilities to build your BSON data into a retrieval-augmented generation (RAG) application or use nearest-neighbor searches to build recommendation engines or identify fraud patterns. There&rsquo;s a lot of utility in a NoSQL database with many different indexing options; it gives you the necessary foundations for many different application types—all working on the same data set.

Getting started with DocumentDB

This first public release of DocumentDB inherits code already running in Azure, so it&rsquo;s ready to build and use, hosted on GitHub. The...

documentdb nosql rsquo postgresql data database

Related Articles