In this article, we will explain how to connect to AWS Amazon DocumentDB in Moon Modeler and how to automatically create a diagram of an existing DocumentDB database.
What is AWS DocumentDB?
Amazon DocumentDB (with MongoDB compatibility) is a fast, scalable, highly available, and fully managed document database service that supports MongoDB workloads. It implements the Apache 2.0 open source MongoDB 3.6, 4.0 and 5.0 API by emulating the responses that a MongoDB client expects from a MongoDB server. For more information about Amazon DocumentDB, please visit https://aws.amazon.com/documentdb/
DocumentDB structure created in AWS
Please visit the following page and read the tutorial:
https://docs.aws.amazon.com/documentdb/latest/developerguide/get-started-guide.html
Creating a DocumentDB database connection in Moon Modeler
To create a new connection to the DocumentDB, click the Connections button and then click Create new connection. Enter a name for the connection and enter the DocumentDB connection string to the URL field.
- Start with mongodb://
- Specify URL
- Include the 27017 port number
- Enable the Direct connection option
- Keep the Retry writes option turned off
The path should be specified as:
mongodb://docdb-xxxxx.docdb.amazonaws.com:27017/
Then go to the Authentication tab
In the next step, enable SSH and enter the values on the SSH tab.
Enter the host, port, username, and private key path.
Now it’s important to enable TLS. So go to the TLS tab and just enable this option and specify the path to the CA Certificate. Then make sure the Allow invalid hostnames option is enabled.
Now you can go back to the first tab. If you don’t know the name of the database and didn’t fill in this value directly, click on Load databases. A list of available databases will load and you can conveniently select the one you want to visualize with the drop-down element. Then select the database and save the connection settings.
Reverse engineering
A new database connection is created. Now just click on the Connect and load existing database structure link.
Moon Modeler will load the information from the database and create the project including the diagram.
Editing connection properties
If you need to optimize the speed of reverse engineering, or if you have data without references in the structure, you can change the database connection Settings and run reverse engineering again.
For more information visit page Database connections
Creating documentation for Document DB
Once you have successfully created a project, you can add logical information to it, such as labels, set captions to references, specify estimated sizes, and add other important information to the project that is useful to document or use when communicating with others. You can generate an interactive HTML report for these purposes, or export the diagram to PDF.
Forward engineering and script generation
In Moon Modeler, you have the option to generate validation scripts for your DocumentDB schema design. You can also generate your own output by defining custom templates!
Get started today and try Moon Modeler
Download
Is a Free Trial of AWS Amazon DocumentDB Available?
Yes, visit the following page: https://aws.amazon.com/documentdb/free-trial/
Here you can find out who is eligible for the offer, what types of instances it can be used on, and how many free hours you can get.
Once you have set up your environment, you can use Moon Modeler to create a diagram of an existing DocumentDB database. Of course, you can also make a project from scratch.
Are There Differences Between DocumentDB and MongoDB?
Of course there are. Each provider has detailed information on their website about the benefits of MongoDB and why to use DocumentDB.
However, in terms of schema modeling and understanding the structure of how data is stored, these differences are less significant. And because DocumentDB is to some extent compatible with MongoDB, you can create connections in Moon Modeler for both MongoDB and DocumentDB – always using the MongoDB as the target database platform.
How is Amazon DocumentDB compatible with MongoDB?