Amazon DocumentDB のアイコン

Amazon DocumentDB Specialized2019年〜

A MongoDB-compatible managed document database service

What It Does

Amazon DocumentDB is a fully managed document database service with a MongoDB-compatible API. It flexibly stores and queries JSON document data while AWS handles infrastructure management and patching automatically. Storage auto-scales up to 128 TiB, and data is replicated across three Availability Zones.

Use Cases

It is well suited for storing data with frequently changing schemas, such as content management systems, user profiles, catalog information, and mobile app backends. It is also used when migrating existing MongoDB workloads to the cloud.

Everyday Analogy

Think of it like a filing cabinet where you can file documents freely. While a relational database only accepts forms in a fixed format, DocumentDB can store documents of different formats as-is and retrieve them instantly when needed.

What Is DocumentDB?

Amazon DocumentDB is a database service for storing and querying JSON documents. Since it provides a MongoDB-compatible API, you can use your existing MongoDB drivers and tools as-is. You don't need to define table schemas in advance, and each document can have a different structure - offering great flexibility.

Architecture and Availability

DocumentDB uses an architecture where compute and storage are separated. Storage automatically creates six copies across three Availability Zones, providing high durability. You can add up to 15 read replicas to distribute read workloads. Failover typically completes within 30 seconds.

MongoDB Compatibility

DocumentDB is compatible with MongoDB 3.6, 4.0, and 5.0 APIs. You can migrate existing MongoDB applications with minimal code changes. However, some MongoDB-specific features (such as server-side JavaScript execution) are not supported, so it is important to verify compatibility before migration. AWS Database Migration Service enables migration from a running MongoDB with minimal downtime. For reference materials on MongoDB compatibility, technical books (Amazon) can also be useful.

Getting Started

Select 'Create cluster' in the DocumentDB console and specify the instance class and number of replicas. An endpoint is issued - set this endpoint in your MongoDB driver's connection string and you're connected. Choosing Elastic Clusters enables horizontal scaling through sharding.

Things to Watch Out For

  • Not all MongoDB features are compatible, so verify compatibility with the Amazon DocumentDB Compatibility Tool before migration
  • Unlike DynamoDB's on-demand pricing, DocumentDB uses instance-based pricing, meaning costs are incurred continuously while instances are running
  • Elastic Clusters enable sharding but have a different pricing model than standard clusters
共有するXB!