
AWS DocumentDB is a document database service that provides a managed experience for MongoDB workloads. It's a fully managed service that makes it easy to set up, operate, and scale a document database.
DocumentDB supports MongoDB 3.6 and 4.0, making it a great option for developers who are already familiar with MongoDB. This means you can easily migrate your existing MongoDB database to DocumentDB without having to rewrite your code.
With DocumentDB, you don't need to worry about provisioning, patching, or scaling your database, as AWS handles all of these tasks for you. This frees up your time to focus on building your application.
Related reading: Document Db vs Mongodb
What is DocumentDB?
DocumentDB is a fully managed document database service that's based on MongoDB. It's known for its high availability, scalability, and security.
Amazon DocumentDB offers many other features beyond its basic capabilities, including high availability, scalability, and security.
DocumentDB is a good fit for storing complex data, especially for apps that require querying and storing large amounts of semi-structured or unstructured data.
A unique perspective: Aws Data Lakehouse
Some popular use cases for DocumentDB include gaming applications, social media applications, and web applications.
Here are some popular document databases, including Amazon DocumentDB, MongoDB, CouchDB, and DynamoDB:
- Amazon DocumentDB: a fully managed document database service that is based on MongoDB.
- MongoDB: an open-source document database that is widely used by developers.
- CouchDB: an open-source document database that is distributable and fault-tolerant.
- DynamoDB: a fully managed NoSQL database service that is designed for high performance and low latency.
Document Database Basics
A document database is a flexible and NoSQL type database that stores data in JSON-like documents, making it a good fit for storing complex data. This type of database is perfect for apps that require querying and storing large amounts of data.
Document databases are useful for apps that need to handle semi-structured or unstructured data, such as gaming applications, social media applications, and web applications. These types of databases are also referred to as non-relational (or NoSQL) databases.
Non-relational databases, like document databases, store data in graphs, key-value pairs, and documents, unlike traditional relational databases that store data in tables with fixed rows and columns.
Some popular document databases include Amazon DocumentDB, MongoDB, CouchDB, and DynamoDB. These databases are all NoSQL, which means they have some stark differences from SQL databases.
Consider reading: Aws Datalake
Amazon DocumentDB, in particular, is a fully managed document database service that is based on MongoDB. It offers high availability, scalability, and security, making it a great choice for big data applications, gaming applications, real-time web/mobile apps, and more.
Here are some examples of when you might use Amazon DocumentDB:
- Big data applications
- Gaming applications
- Real-time web/mobile apps
- Online shopping/advertising
- Social media applications
- Content management
- Personalization
- Catalogs
- IoT applications
DocumentDB vs Other Databases
Document databases like DocumentDB offer flexibility by storing data of varying sizes and structures, making them ideal for storing complex data.
DocumentDB is easily scalable to application requirements, providing high performance, especially for processing a large volume of queries.
In comparison to SQL databases, DocumentDB stores data in documents, whereas SQL databases store data in tables, resulting in some notable variations between the two.
Here's a comparison of DocumentDB and SQL databases in a table:
Comparison to SQL Databases
Document databases like Amazon DocumentDB and MongoDB store data in documents, whereas SQL databases store data in tables. This fundamental difference leads to some notable variations between the two.
One key difference is the way data is structured. Document databases have a flexible data structure, whereas SQL databases have a rigid one. This means that document databases can store data of varying sizes and structures, making them a good fit for storing complex data.
Document databases are also very performant for handling complex queries, whereas SQL databases can struggle with complex queries. This is because document databases use a JSON-like query language, which is designed for querying semi-structured data.
Another difference is the ease of use. Document databases are often easier to use for developers who are not familiar with SQL, whereas SQL databases can be harder to use for those who are not familiar with the language.
Here's a comparison of document databases and SQL databases in a table:
Overall, the choice between a document database and a SQL database depends on the specific needs of your project. If you need to store complex data and query it efficiently, a document database like Amazon DocumentDB may be the better choice.
vs MongoDB
Amazon DocumentDB offers compatibility with MongoDB, so it supports the same APIs that MongoDB does. However, the similarities largely end there.
One of the key differences is that DocumentDB is a fully managed document database service, whereas MongoDB is an open-source document database. This means that DocumentDB handles tasks like scaling and maintenance for you, while MongoDB requires more manual effort.
DocumentDB has explicit proficiencies that are compatible with MongoDB. Some of these include the ability to use existing MongoDB APIs for querying documents, as well as existing MongoDB drivers and tools.
Here are some of the specific capabilities that DocumentDB has that are compatible with MongoDB:
- Ability to use the existing MongoDB APIs for querying documents: Amazon DocumentDB and MongoDB utilize the same query language.
- Ability to use existing MongoDB drivers and tools: Amazon DocumentDB supports the same drivers and tools as MongoDB.
- ACID transactions across documents/databases: Amazon DocumentDB supports ACID transactions across documents and databases, as does MongoDB.
In contrast, MongoDB is known for its high levels of flexibility and scalability, which can be beneficial for certain use cases. However, this also means that MongoDB requires more manual effort to set up and maintain.
Ultimately, the choice between DocumentDB and MongoDB will depend on your specific needs and preferences. If you value the convenience of a fully managed service and don't mind giving up some flexibility, DocumentDB may be the better choice.
Additional reading: Documentdb Mongodb
DynamoDB
DynamoDB is designed for ultra-high performance at any scale and offers a higher level of versatility, supporting both document and key-value data structures.
It's a key-value and document database that's part of the AWS database services suite, making it a great option for those already invested in the AWS ecosystem.
One of the standout features of DynamoDB is its ability to handle large volumes of data with ease, making it a top choice for applications that require high performance.
DynamoDB is also highly scalable, allowing it to adapt to changing data storage needs without compromising performance.
Intriguing read: Dynamodb vs Documentdb
Setting Up and Using DocumentDB
Setting up Amazon DocumentDB is a straightforward process. To begin, ensure you have the Amazon Web Services integration set up first.
Amazon DocumentDB can handle millions of requests per second, making it highly scalable. You can easily add or remove capacity to meet your needs. This flexibility is a significant advantage over other database solutions.
Worth a look: Document Db Aws
Here are some key features to consider when setting up and using Amazon DocumentDB:
- Scalability: Amazon DocumentDB can handle millions of requests per second.
- Flexibility: It allows you to store and query data of any structure without a rigid schema.
- Availability and durability: It replicates data across multiple AZs for high availability and durability.
- Automated data management: You can use Amazon DocumentDB to automatically handle data management tasks, such as provisioning, cloud backups, and replication.
Setup
Let's get started with setting up DocumentDB. First, you need to set up the Amazon Web Services integration first. This will give you access to the features and tools you need to manage your database.
To begin, you'll want to create an AWS account if you haven't already. This will give you a starting point for accessing the DocumentDB dashboard.
Installation
To set up DocumentDB, you'll need to configure it to send logs to either an S3 bucket or CloudWatch. This is a crucial step in getting started with DocumentDB.
Amazon DocumentDB can send logs to an S3 bucket, which is a great option for storing and analyzing your logs.
Expand your knowledge: What Are Amazon S3 Buckets
Connecting to External Public IP
DocumentDB doesn't have a public endpoint by default, which means it's not intended to be exposed to the internet. It's typically deployed on a private network within a VPC and accessed by applications running on the same VPC.
To access the DocumentDB cluster from an external Public IP, you'll need to create a Network Load Balancer (NLB) in front of the Read Replica. This is a good practice to separate public access and private access.
A Network Load Balancer can enable a public endpoint for the Read Replica, allowing you to access the database from anywhere.
You'll need to put the security group that you created earlier in the security group section of the NLB. This ensures that only authorized traffic can access the database.
To test your configurations, run a PowerShell command from the folder where you downloaded the "global-bundle.pem" file. Replace the NLB endpoint and username with your credentials.
Here's an interesting read: Aws S3 Security Best Practices
Logging and Monitoring
Logging and Monitoring is a crucial aspect of managing your AWS DocumentDB. To start, you'll want to send your logs to a monitoring tool like Datadog.
First, set up the Datadog Forwarder Lambda function, which will allow you to forward your logs to Datadog. This is a one-time setup process.
Once the Lambda function is installed, you'll need to manually add a trigger on the S3 bucket or CloudWatch log group that contains your Amazon DocumentDB logs in the AWS console. This will enable the forwarding of your logs to Datadog.
Expand your knowledge: Aws Lambda S3
Protect with N2WS
Protect with N2WS is a great way to safeguard your Amazon DocumentDB databases. Automate backups to ensure your data is always safe.
You can even orchestrate 1-click recovery of your DocumentDB databases, giving you peace of mind in case of any issues.
Main Features and Capabilities
Amazon DocumentDB is a powerful database service that offers a range of features and capabilities that make it an attractive option for developers and businesses. It has compatibility with MongoDB, allowing for easy migration from MongoDB to DocumentDB.
DocumentDB uses the same query language as MongoDB, making it easy to transition to the service. It also supports the same drivers and tools as MongoDB, reducing the learning curve for developers. ACID transactions across documents and databases ensure that data is always consistent, even with multiple concurrent operations.
DocumentDB automatically scales databases up or down according to requirements or workloads, ensuring that your database can handle changing demands. It also provides high availability, allowing you to replicate data across multiple Availability Zones (AZs) for reliability.
DocumentDB stores JSON data natively, making it ideal for complex data structures. It provides single document lookups, index scans, regular expression queries, and aggregations to improve query performance.
Here are some key features of DocumentDB:
- Single document lookups
- Index scans
- Regular expression queries
- Aggregations
- Single-field, compound, and multi-key indexes
DocumentDB's architecture separates storage and computing, allowing each layer to scale independently. It uses the Aurora Storage Engine, which is distributed, fault-tolerant, self-healing, and durable. This ensures that your data is always available and protected.
Cloud Storage Essentials
Amazon DocumentDB is a great choice for a wide variety of applications, including big data, gaming, real-time web and mobile applications, online shopping/advertising, social media, content management, personalization, catalogs, and IoT.
It offers the tools and performance needed for efficient cloud storage, allowing businesses to grow and scale their cloud environment in the most optimal way possible.
Amazon DocumentDB provides performance, scalability, availability, security, and compatibility of MongoDB with the ease of use and management of other managed services.
For another approach, see: Aws Cloud Foundry
Businesses transitioning from MongoDB or starting anew can benefit from Amazon DocumentDB's features and capabilities, making it a top choice for long-lasting cloud management solutions.
It's designed to offer the best of both worlds, combining the benefits of MongoDB with the ease of use and management of other managed services.
Frequently Asked Questions
Is AWS DocumentDB the same as MongoDB?
No, AWS DocumentDB is not the same as MongoDB. It emulates the MongoDB API but runs on a different backend platform, limiting its compatibility and functionality.
Is DocumentDB SQL or NoSQL?
Amazon DocumentDB is a NoSQL database service, designed for JSON data management at scale. It's a great option for applications that require flexible schema and high scalability.
Featured Images: pexels.com

