Microsoft builds open source document database on PostgreSQL

Microsoft has unveiled a new document database platform that is built on a robust relational PostgreSQL backend. This development marks a significant step in the company’s embrace of open-source technologies, as it encourages users to initiate their journey with the platform by implementing the open-source solution, FerretDB.

Open Source Commitment

In a recent blog post, Microsoft articulated its commitment to creating “a fully open source platform powered by” PostgreSQL, designed to fulfill the community’s NoSQL database requirements. This initiative is a response to the growing demand for document databases, a trend that has been evolving for over a decade, championed by innovators like MongoDB. These proponents have long argued that a less schema-restrictive database would better accommodate the semi-structured data types prevalent in modern web applications.

The new platform not only leverages a relational database structure but also incorporates open-source governance, with contributions from esteemed organizations such as MIT, Apache, and the PostgreSQL Global Development Group. Abinav Rameesh, a product marketing manager at Microsoft, emphasized the platform’s accessibility, stating, “There are no commercial licensing fees, no usage or distribution restrictions, and no gimmicks.” He further noted that while contributions are encouraged, users are not obligated to share their customizations back to the project, thanks to the MIT license that ensures complete freedom to fork, use, and distribute the repository.

Innovative PostgreSQL Extensions

Microsoft has introduced two key PostgreSQL extensions to enhance this platform. The first, pg_documentdb_core, is a custom extension optimized for Binary JavaScript Object Notation (BSON), a binary-encoded serialization format for JSON documents. This follows PostgreSQL’s addition of JSON document support back in 2013. The second extension, pg_documentdb_api, facilitates essential operations such as creating, reading, updating, and deleting data, along with query functionality and index management.

Moreover, Microsoft encourages users to leverage FerretDB, an existing open-source interface that provides a document database protocol. Rameesh noted, “While users can interact with DocumentDB through Postgres, FerretDB 2.0 offers an interface specifically designed for document databases.” FerretDB operates under a similarly permissive Apache license and enjoys a strong presence in both the PostgreSQL and NoSQL communities.

Performance Enhancements

FerretDB has reported that utilizing DocumentDB as the backend for its 2.0 version results in performance improvements, boasting speeds up to 20 times faster for certain workloads compared to previous iterations. Peter Farkas, co-founder and CEO of FerretDB, highlighted the advantages of this collaboration: “DocumentDB introduces the BSON data type and operations to PostgreSQL, providing us with the tools to store and query data much more efficiently than before.” He also emphasized that maintaining compatibility between DocumentDB and FerretDB allows users to run document database workloads on PostgreSQL with enhanced performance and improved support for existing applications.

This collaborative effort among Microsoft, PostgreSQL, and FerretDB could pose a competitive challenge to established players in the document database market, such as MongoDB and Couchbase. While MongoDB has cultivated a loyal user base, including major corporations like Toyota, Wells Fargo, and SwissCom, developers seeking to innovate within the document database space may find themselves exploring new options.

Tech Optimizer
Microsoft builds open source document database on PostgreSQL