Amazon DocumentDB supports document workloads with MongoDB-compatible APIs and managed cluster storage.
Document workloads and compatibility
Amazon DocumentDB is a managed database for MongoDB-compatible documentA data record structured using key-value pairs that can be nested. workloads. A document stores data in key-value pairs that can be nested. Instance-based clusters use replicasA database instance that serves reads and can be a failover target. and endpointsA host address and port used to connect to a database instance. to support reads and failover.
How it works
- Choose an instance-based or elastic cluster. In an instance-based cluster, the primary instance handles writes and reads. A replica is an additional instance that serves reads.
- Instances use a shared cluster volume, with six copies across three Availability Zones. An Availability ZoneA distinct location in a Region designed to be isolated from failures in other zones. is an isolated location within an AWS Region.
- Connect through the cluster endpoint, a network address for the current primary. In replica set mode, a read preference can direct eligible reads to replicas.
Exam cues
- If the question says more read capacity and a failover target, think replicas, because replicas serve reads and can be promoted.
- If the question says a connection must follow the primary after failover, think cluster endpoint, because it connects to the current primary.
Remember
- An instance-based cluster supports up to 15 replicas. Replica reads are eventually consistent, so they can lag behind writes.
- The reader endpoint balances connections, not individual requests.
Trap: The reader endpoint balances connections, not individual read requests.
The application writes through the primary.
The primary writes to the shared cluster volume.
Replicas read from the shared volume.
From the AWS docs (16)
- Amazon DocumentDB is a managed MongoDB-compatible database service.
- Document databases store semistructured data in documents using nested key-value pairs.
- Amazon DocumentDB has functional differences from MongoDB.
- Supported MongoDB APIs and operations vary by compatibility level.
- Amazon DocumentDB supports instance-based clusters and elastic clusters.
- Availability Zones are distinct locations within an AWS Region, designed to be isolated from failures in other zones.
- In an instance-based cluster, the primary handles writes and reads.
- An instance-based cluster can have up to 15 read replicas, which can also be failover targets.
- The cluster volume has six copies of data across three Availability Zones.
- Replica reads are eventually consistent with the primary.
- The cluster endpoint connects to the current primary and supports failover.
- The reader endpoint balances connections, not requests, across replicas.
- AWS recommends the cluster endpoint in replica set mode with a suitable read preference.
- Continuous backups retain data for 1 to 35 days for point-in-time recovery.
- A manual snapshot can retain backup data beyond the backup retention period.
- Encryption at rest uses AWS KMS keys and covers backups, snapshots and replicas in the cluster.
Compatibility, storage and backups
Amazon DocumentDB is a managed database for MongoDB-compatible workloads. Before moving an application, check which operations it needs and how they behave.
Product catalogs are a document-database use case: different products can have different attributes. Amazon DocumentDB can query and index JSON data without enforcing one schema across the collection.
How it works
- Check the supported MongoDB APIs and operations for the compatibility level and review the functional differences.
- The cluster volume grows automatically as data grows, and billing reflects the space used.
- Create a manual cluster snapshotA saved copy of cluster data that can be retained beyond the backup retention period. to retain backup data beyond the backup retention period.
Exam cues
-
If the question says a product catalog has different attributes for each product, think a documentA data record structured using key-value pairs that can be nested. database such as Amazon DocumentDB, because documents accommodate that variation.
-
If the question says a managed MongoDB-compatible database, think Amazon DocumentDB, because it supports MongoDB-compatible workloads.
-
If the question says retain a backup beyond the retention period, think manual cluster snapshot, because it can keep backup data longer.
-
If the question says storage must grow with the data, think automatic cluster volume growth, because you pay for the space used.
Remember
- Cluster storage grows up to 256 TiB on engine version 8.0 and later, or 128 TiB on earlier versions.
- Supported MongoDB APIs and operations vary by compatibility level.
Trap: MongoDB compatibility does not mean every operation is supported or behaves identically. Check the supported APIs and functional differences.
From the AWS docs (7)
- Amazon DocumentDB is a managed MongoDB-compatible database service.
- Amazon DocumentDB has functional differences from MongoDB.
- Supported MongoDB APIs and operations vary by compatibility level.
- A manual snapshot can retain backup data beyond the backup retention period.
- A DocumentDB cluster volume grows automatically with data, up to 256 TiB on engine version 8.0 and later (128 TiB before), and is billed for the space used.
- Amazon DocumentDB can store, query and index JSON documents without enforcing one schema across every document in a collection.
- Document databases fit product catalogs in which different products have different sets of attributes.
Flashcards
Nothing to review here right now. Pick other topics or another filter.
·
All 10 cards as a list
An instance-based Amazon DocumentDB cluster needs more read capacity and a failover target. What should the team add?
Add a read replica. It can serve reads and act as a failover target.
A team needs an Amazon DocumentDB connection that follows the current primary after failover. Which endpoint should it use?
The cluster endpoint. It connects to the current primary and supports failover.
An application needs to distribute Amazon DocumentDB reads while leaving the primary free for writes. What connection approach should it consider?
Use the cluster endpoint in replica set mode with an appropriate read preference and replicas.
Does an Amazon DocumentDB reader endpoint balance individual read requests evenly?
No. It balances connections, not individual requests.
What consistency should a client expect when reading from an Amazon DocumentDB replica?
Eventual consistency with the primary.
Which managed database supports MongoDB-compatible document workloads?
Amazon DocumentDB. Check the supported API operations and functional differences before migration.
A team must retain an Amazon DocumentDB backup beyond the continuous backup retention period. What should it create?
A manual cluster snapshot.
Do you need to provision storage size for an Amazon DocumentDB cluster?
No. The cluster volume grows automatically as data grows and you pay for what you use.
An Amazon DocumentDB application stores JSON records whose fields vary. Can the application query and index that data without one enforced collection schema?
Yes. Amazon DocumentDB supports querying and indexing JSON data, and a collection does not enforce one schema across all documents.
A team is considering Amazon DocumentDB for a product catalog whose records have different attributes. Why does a document model fit?
Documents can represent products with different attribute sets, matching the variable structure of a product catalog.