documentdb open source

DocumentDB: Open-Source Announcement from Microsoft

Spread the love

Microsoft announced the release of DocumentDB, an open-source document database platform that powers the vCore-based Azure Cosmos DB for MongoDB. Built on the robust PostgreSQL engine, DocumentDB is here to revolutionize NoSQL databases.

Bridging the Gap in NoSQL Databases

NoSQL databases have traditionally been siloed into cloud-specific solutions, lacking a common standard for portability and interoperability. This has created a growing need for a flexible, production-ready local instance of document data stores that adheres to an open standard. With the explosive growth of PostgreSQL’s popularity in the past decade, we saw an opportunity to combine the power of PostgreSQL with the evolving needs of the NoSQL community. Enter DocumentDB—a fully open-source, PostgreSQL-powered platform designed to meet the demands of modern NoSQL databases.

Our Mission: Transparency and Flexibility

DocumentDB is built with a clear purpose: to provide developers with a NoSQL datastore that offers complete transparency into its architecture. From CRUD operations to indexing and vector search capabilities, every core component is open to the public. PostgreSQL’s evolving ecosystem of extensions further enhances this, making DocumentDB a robust, flexible choice for developers.

Open-Source Freedom with the MIT License

Staying true to the spirit of open source, DocumentDB is released under the permissive MIT license, offering developers:

  • Zero restrictions on usage, distribution, and integration.
  • Freedom to customize, fork, and enhance the platform without obligations to contribute back. This ensures developers can innovate without limits.
Setting the Standard for NoSQL

DocumentDB is the first step toward creating a universal standard for NoSQL databases, akin to the ANSI SQL standard for relational databases. This initiative aims to unify APIs and engine fundamentals across NoSQL implementations, improving compatibility, interoperability, and the developer experience.

Built on a Solid Architecture

DocumentDB comprises two key components:

pg_documentdb_core: A custom PostgreSQL extension optimized for BSON (Binary JSON) data types. It enables:

  • Parsing and manipulation of deeply nested BSON documents.
  • Support for single-field, multi-key, compound, text, and geospatial indexes (leveraging PostGIS).
  • Vector search queries powered by the pg_vector extension, perfect for applications like generative AI, fraud detection, and recommendation systems.

pg_documentdb_api: Handles CRUD operations, query functionality, and index management for a seamless NoSQL experience.

A Ready-to-Use Solution for Users

Developers seeking an out-of-the-box NoSQL database can use FerretDB, a popular open-source document store powered by DocumentDB. With its permissive Apache license, FerretDB bridges the gap between the NoSQL and PostgreSQL communities, providing an intuitive interface for document database protocols.

Join the Community and Shape the Future

We’re excited to collaborate with the open-source community to make PostgreSQL the most versatile NoSQL database platform and establish a standard for document databases.

  • GitHub: Explore our roadmap, contribute to the project, and stay updated.
  • Discord: Connect with the creators, share your feedback, and engage in design discussions.
Get Started with DocumentDB

Ready to dive in? Follow these steps to install and set up DocumentDB locally:

Install Docker

  • Follow the installation guide for Docker.

Clone the Repository

  • git clone https://github.com/microsoft/documentdb.git

Build the Docker Image

  • docker build . -f .devcontainer/Dockerfile -t documentdb

Run the Container

  • docker run -v $(pwd):/home/documentdb/code -it documentdb /bin/bash

Build and Deploy

  • cd code
  • make
  • sudo make install

Start the Server

  • ./scripts/start_oss_server.sh -t documentdb

Connect to psql

  • psql -p 9712 -h localhost -d postgres

Simple CRUD Example

Create a collection:

SELECT documentdb_api.create_collection('documentdb','patient');

Insert a document:

SELECT FROM documentdb_api.insert_one('documentdb', 'patient', '{ "patient_id": "P001", "name": "Alice Smith", "age": 30, "phone_number": "555-0123", "registration_year": "2022", "conditions": ["Diabetes", "Hypertension"]}');

Let’s Build the Future Together

Clone the repository here, connect with us on Discord, and start experimenting with DocumentDB today. Join us in shaping the future of NoSQL databases!

Featured Image Source: https://www.opc-router.com/what-is-json/


Spread the love

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top
×