Getting Started navigation (v0.114-0)

You are viewing the frozen documentation for v0.114-0. It is not updated and may not reflect the latest release.

View current version →

Introduction to DocumentDB

DocumentDB is an open-source document database platform built on PostgreSQL. It offers developers a fully permissive, open-source platform for document data stores.

What is DocumentDB?

DocumentDB provides a NoSQL datastore implemented using PostgreSQL, giving developers complete visibility into the architecture and implementation of the engine. It's designed to offer:

  • Full compatibility with the MongoDB wire protocol through the pg_documentdb_gw gateway
  • Public document CRUD and management APIs through the pg_documentdb extension
  • Native BSON document support via the pg_documentdb_core PostgreSQL extension
  • Advanced indexing capabilities including single field, multi-key, compound, text, geospatial, and vector indexes
  • Vector search functionality powered by the pgvector PostgreSQL extension
  • Enterprise-grade security with SCRAM authentication
  • Full PostgreSQL compatibility for advanced SQL operations

Key Features

  • PostgreSQL Foundation: Built on the powerful PostgreSQL engine, allowing you to leverage both document and relational capabilities
  • Open Source: Released under the MIT license with no restrictions on usage, modification, or distribution
  • Document Database Standard: First implementation towards creating an open standard for document databases, similar to ANSI SQL for relational databases
  • Cloud Ready: Supports multi-cloud deployments across major cloud providers with native integration in Azure Cosmos DB
  • Developer Friendly: Rich ecosystem of tools and extensions, including VS Code integration and MongoDB compatibility

Architecture Components

DocumentDB consists of three primary components:

  1. pg_documentdb_core: A PostgreSQL extension that provides:

    • Native BSON data type support in PostgreSQL
    • Field-level indexing at any nesting depth
    • Multi-key, compound, text, and geospatial indexing primitives
    • Foundational operators and helpers used by the higher layers
  2. pg_documentdb: The data plane implementing:

    • CRUD operations with MongoDB compatibility
    • Advanced query and aggregation functionality
    • Index management and optimization
    • User and role management commands
  3. pg_documentdb_gw: The gateway that:

    • Implements the MongoDB wire protocol
    • Terminates TLS and authenticates clients (SCRAM-SHA-256)
    • Translates MongoDB commands into calls against pg_documentdb
    • Manages cursors, sessions, and connection state for MongoDB drivers

Common Use Cases

  • Modern Web Applications: Store and query JSON documents with MongoDB compatibility
  • AI/ML Applications: Leverage vector search for similarity matching and embeddings
  • Hybrid Data Models: Combine document and relational data in the same database
  • Migration Path: Easy transition from existing MongoDB workloads
  • Local Development: Full-featured local instance for development and testing

Getting Started Options

Choose the getting started guide that best fits your needs:

Quick Start Guides

Language-Specific Guides

Deployment Options

Community and Support

  • Discord Community: Join our Discord server for:
    • Community syncs and office hours
    • Real-time technical support
    • Migration assistance
    • Best practices sharing
  • GitHub Repository: documentdb/documentdb
  • Documentation: Comprehensive guides and API references
  • Issue Tracking: Report bugs and request features on GitHub

Next Steps

After choosing your preferred getting started path:

  • Explore our API Reference for detailed documentation
  • Join our community to contribute and get support