Amazon DocumentDB (with MongoDB compatibility) is a fully managed native JSON document database that simplifies running critical document workloads at virtually any scale without the need to manage infrastructure, making it cost-effective and easy to use.
MongoDB Compatibility: Supports popular MongoDB APIs, allowing easy migration from MongoDB.
High Performance & Scalable: Distributed storage architecture enhances read/write speed and automatically scales as needed.
Easy Management: As a fully managed service, it reduces database administration overhead.
The cost of Amazon DocumentDB depends on the following factors:
On-Demand Instances – Charged per hour based on instance type.
Database I/O – Charged per million read/write operations.
Database Storage – Charged per GB per month.
Backup Storage – Charged per GB per month beyond database storage.
AWS provides two pricing options:
Amazon DocumentDB Standard (Pay-as-you-go I/O)
Amazon DocumentDB I/O-Optimized (Includes I/O costs in instance pricing)
We will choose Amazon DocumentDB Standard to optimize costs because:
Log in to the AWS Management Console and open Amazon DocumentDB
Create a DocumentDB Cluster
In Create Amazon DocumentDB cluster, enter the following details:
docdb-nextjs-workshop
user123
user1234
Verify Connection from EC2 to DocumentDB
Open the newly created cluster, go to the Configuration tab, and copy the Cluster endpoint
In EC2, click Connect and then click Connect under the EC2 Instance Connect tab.
$ sudo apt-get install -y netcat
$ nc -zv docdb-nextjs-workshop.cluster-c10k88ou8amc.ap-southeast-1.docdb.amazonaws.com 27017