AWS TL;DR: Amazon DocumentDB (with MongoDB Compatibility)
Back to AWS TL;DR Hub

Amazon DocumentDB

/tldr: Managed, scalable, high-performance NoSQL document database compatible with MongoDB.

NoSQL Document Store MongoDB API

1. MongoDB Compatibility

DocumentDB allows existing MongoDB applications and tools to connect and communicate with it using the standard MongoDB wire protocol. This means you can migrate workloads without rewriting extensive application code.

Key Takeaways on Compatibility

  • **Wire Protocol:** DocumentDB implements the MongoDB 3.6, 4.0, and 5.0 APIs.
  • **Drivers & Tools:** You can use existing MongoDB drivers, SDKs, and command-line tools (like `mongosh` or `mongoimport`).
  • **Focus:** It’s a compatibility layer, not an identical replica. It offers core document database features but may not support every specialized MongoDB feature.

2. Cloud-Native Architecture

DocumentDB utilizes the same cloud-native, shared-storage architecture as Amazon Aurora. This decouples the compute nodes (the instances) from the persistent, distributed storage layer.

Architecture Benefits (Scalability & Durability)

  • **Durability:** Data is replicated six ways across three Availability Zones (AZs) and automatically healed.
  • **Storage Auto-Scaling:** Storage automatically scales up to 128TB without any performance degradation or maintenance windows.
  • **Fast Failover:** Since all instances share the same storage volume, failover to a Read Replica is typically very fast (often under 30 seconds).
  • **Performance:** It processes I/O operations more efficiently than self-managed MongoDB.

3. High Availability and Read Scaling

Availability in DocumentDB is achieved by maintaining multiple read-replica instances within the cluster, all sharing the same physical data.

Read and Write Endpoints

  • **Cluster Endpoint (Writer):** The single, active instance used for all write operations. All reads can also go here, but this is the bottleneck for scale.
  • **Reader Endpoint:** A load-balanced endpoint that distributes read traffic across up to 15 Read Replicas, significantly improving read performance and reducing load on the writer.
  • **Instance Endpoints:** Direct connections to specific read-replica instances, useful for specific operational tasks or troubleshooting.

4. Security & Billing

DocumentDB is secured using standard AWS mechanisms and features a flexible billing model for compute and storage.

// Security Measures:

// 1. Networking: Isolated within a VPC, controlled by Security Groups.

// 2. Encryption: Always-on encryption at rest using AWS KMS.
//    SSL/TLS is required for connections, securing data in transit.

// Pricing Model:

// 1. Compute: Charged per instance-hour (based on instance size).
// 2. Storage: Charged by the amount of data consumed (billed in chunks, typically 10GB).
// 3. I/O: Charged per million I/O requests.
            

DocumentDB is the scalable, highly available choice for MongoDB workloads on AWS.

AWS Fundamentals Series: Amazon DocumentDB