13. Amazon DocumentDB

2022-04-08 00:00:00 专区 订阅 付费 交易 评论

Overview
Amazon DocumentDB (with MongoDB compatibility) is a fast, reliable, and fully managed database service.
Amazon DocumentDB makes it easy to set up, operate, and scale MongoDB-compatible databases in the cloud.
With Amazon DocumentDB, you can run the same application code and use the same drivers and tools that you use with MongoDB.
Features of Amazon DocumentDB
Amazon DocumentDB automatically grows the size of your storage volume as your database storage needs grow. Your storage volume grows in increments of 10 GB, up to a maximum of 64 TB
With Amazon DocumentDB, you can increase read throughput to support high-volume application requests by creating up to 15 replica instances.
Amazon DocumentDB lets you scale the compute and memory resources for each of your instances up or down.
Amazon DocumentDB runs in Amazon Virtual Private Cloud (Amazon VPC), so you can isolate your database in your own virtual network.
Amazon DocumentDB continuously monitors the health of your cluster.
On instance failure, Amazon DocumentDB automates failover to one of up to 15 Amazon DocumentDB replicas that you create in other Availability Zones.
The backup capability in Amazon DocumentDB enables point-in-time recovery for your cluster
With Amazon DocumentDB, you can encrypt your databases using keys that you create and control through AWS Key Management Service (AWS KMS)
Clusters
A cluster consists of 0 to 16 instances and a cluster storage volume that manages the data for those instances.
All writes are done through the primary instance.
All instances (primary and replicas) support reads.
An Amazon DocumentDB cluster volume is a virtual database storage volume that spans multiple Availability Zones.
The cluster's data is stored in the cluster volume with copies in three different Availability Zones.
An Amazon DocumentDB cluster consists of two components:
Cluster volume—Uses a cloud-native storage service to replicate data six ways across three Availability Zones, providing highly durable and available storage. An Amazon DocumentDB cluster has exactly one cluster volume, which can store up to 64 TB of data.
Instances—Provide the processing power for the database, writing data to, and reading data from, the cluster storage volume. An Amazon DocumentDB cluster can have 0–16 instances.


 

Amazon DocumentDB Endpoints
The cluster endpoint connects to your cluster’s current primary instance.
If your cluster’s current primary instance fails, and your cluster has at least one active read replica, the cluster endpoint automatically redirects connection requests to a new primary instance.
The reader endpoint load balances read-only connections across all available replicas in your cluster.
An instance endpoint connects to a specific instance within your cluster.
Connecting to the cluster endpoint in replica set mode is the recommended method for general use.
Amazon DocumentDB Storage
Amazon DocumentDB data is stored in a cluster volume, which is a single, virtual volume that uses solid state drives (SSDs). A cluster volume consists of six copies of your data, which are replicated automatically across multiple Availability Zones in a single AWSRegion.
Amazon DocumentDB Reliability
Storage Auto-Repair: When a segment of a cluster volume fails, Amazon DocumentDB immediately repairs the segment. It uses the data from the other volumes that make up the cluster volume to help ensure that the data in the repaired segment is current.
Survivable Cache Warming: Amazon DocumentDB manages its page cache in a separate process from the database so that the page cache can survive independently of the database.
Crash Recovery: Amazon DocumentDB is designed to recover from a crash almost instantaneously, and to continue serving your application data.
High Availability
Amazon DocumentDB supports highly available cluster configurations by using replicas as failover targets for the primary instance. If the primary instance fails, an Amazon DocumentDB replica is promoted as the new primary, with a brief interruption during which read and write requests made to the primary instance fail with an exception.
Replicas that are intended for use as failover targets should be of the same instance class as the primary instance.
Document Database Use Cases
Document databases are useful for workloads that require a flexible schema for fast, iterative development.
Document databases are a practical solution to online profiles in which different users provide different * of information.
Real-Time Big Data
Content Management
Transactions
To use the transactions feature, you need to meet the following requirements:
You must be using the Amazon DocumentDB 4.0 engine.
You must use a driver compatible with MongoDB 4.0 or greater.
Best Practices
Deploy a cluster consisting of two or more Amazon DocumentDB instances in two AWS Availability Zones
Connect to your Amazon DocumentDB cluster with the cluster endpoint and in replica set mod
When importing data into Amazon DocumentDB, you should create your indexes before importing large datasets.
One of the best ways to improve cluster performance is to tune your most commonly used and most resource-intensive queries to make them less expensive to run.
Document deletion resulting from TTL index expiry is a best effort process.
Migrating to Amazon DocumentDB
AWS Database Migration Service (AWS DMS) is a cloud service that makes it easy to migrate relational databases and non-relational databases to Amazon DocumentDB.
Global cluster
A global cluster consists of one primary region and up to five read-only secondary regions.
You issue write operations directly to the primary cluster in the primary region and Amazon DocumentDB automatically replicates the data to the secondary regions using dedicated infrastructure.
Latency is typically under a second.
global cluster features:
Recovery from region-wide outages
Global reads with local latency
Scalable secondary clusters
Fast replication from primary to secondary clusters
Reference
https://docs.aws.amazon.com/documentdb/latest/developerguide/what-is.html

相关文章