# DocumentDB

## DocumentDB

{% embed url="<https://docs.aws.amazon.com/documentdb/latest/developerguide/what-is.html>" %}

* Makes easy to set-up, operate and scale **MongoDB** compatible databases
  * Basically it is like running MongoDB in AWS.
* Launched as instances in a cluster.
  * Supports `instance-based clusters` and `elastic clusters`.
* It automatically grows the size of your storage volumes as your database increases.
* You can increase read throughput for higher requests volume by creating more instance replicas in the cluster.
  * You can also scale compute and memory of the replicas up and down .
* It runs on a `VPC` to isolate the database.
* Automatically monitors the health of the cluster, replacing failing instances.
  * Automatic failover of instances.
* Automatic, incremental and continuous backups, to `S3`.
  * Backup capabilities allows you to restore your cluster to any second during your retention period, up to the last 5 minutes. (Retention period up to 35 days)
  * Backups have zero impact on cluster performance.
* You can encrypt your databases with `KMS`.
* Cluster volume is replicated to three different AZs.

## Clusters

<figure><img src="https://4257107599-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FO7iF3qcu25MOrAYlRsn6%2Fuploads%2F4CFdXcBilt41CLyjKpIj%2Fimage.png?alt=media&#x26;token=d9e04c9f-cf91-4cd4-90d7-be1d08175ebc" alt="" width="545"><figcaption></figcaption></figure>

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. (Meaning the other instances are read-only)

## Basic Price Models

* Instance hours (per-hour)
* I/O requests (per 1 million requests per month)
